Package javax.xml.bind

Examples of javax.xml.bind.UnmarshalException


        } catch(JAXBException jaxbException) {
            throw jaxbException;
        } catch (XMLMarshalException xmlMarshalException) {
            throw handleXMLMarshalException(xmlMarshalException);
        } catch (Exception exception) {
            throw new UnmarshalException(exception);
        }
    }
View Full Code Here


    private JAXBException handleXMLMarshalException(XMLMarshalException xmlMarshalException) {
        if(xmlMarshalException.getErrorCode() == XMLMarshalException.NULL_ARGUMENT) {
            throw new IllegalArgumentException(xmlMarshalException);
        } else {
            return new UnmarshalException(xmlMarshalException);
        }
    }
View Full Code Here

    private XMLStreamReader createXmlStreamReader(Reader reader) throws JAXBException {
        try {
            return Stax2JettisonFactory.createReader(reader, jsonConfig);
        } catch (XMLStreamException ex) {
            throw new UnmarshalException("Error creating JSON-based XMLStreamReader", ex);
        }
    }
View Full Code Here

            throw new IllegalStateException();

        if(!aborted)       return result;

        // there was an error.
        throw new UnmarshalException((String)null);
    }
View Full Code Here

        // from the unmarshaller.getResult()
        if(!recover)    aborted = true;

        if( !canRecover || !recover )
            throw new SAXParseException2( event.getMessage(), locator,
                new UnmarshalException(
                    event.getMessage(),
                    event.getLinkedException() ) );
    }
View Full Code Here

        reader.setErrorHandler(coordinator);

        try {
            reader.parse(source);
        } catch( IOException e ) {
            throw new UnmarshalException(e);
        } catch( SAXException e ) {
            throw createUnmarshalException(e);
        }

        Object result = connector.getResult();
View Full Code Here

        // that could throw away some meaningful exception information.
        Throwable ne = e.getNestedException();
        if(ne instanceof JAXBException)
            return (JAXBException)ne;
        if(ne instanceof SAXException)
            return new UnmarshalException(ne);
        return new UnmarshalException(e);
    }
View Full Code Here

                        }
                    } catch (UnmarshalException e) {
                        String errorMsg = localStrings.getLocalString("enterprise.webservice.errorUnMarshalMethod",
                                "Error unmarshalling method for ejb {0}",
                                new Object[]{ejbName()});
                        ie = new UnmarshalException(errorMsg);
                        ie.initCause(e);
                        throw ie;
                    } catch (Exception e) {
                        ie = new Exception(localStrings.getLocalString("enterprise.webservice.methodNotAuth",
                                "Client not authorized for invocation of {0}",
View Full Code Here

   protected UnmarshalException createUnmarshalException(SAXException pException) {
     Exception ex = pException.getException();
     if (ex != null  &&  ex instanceof UnmarshalException) {
       return (UnmarshalException) ex;
     } else {
       return new UnmarshalException(pException);
     }
   }
View Full Code Here

  /** <p>Returns a new JMUnmarshaller.</p>
   */
  public JMUnmarshaller getJMUnmarshaller() throws UnmarshalException {
    Class c = getJMUnmarshallerClass();
    if (c == null) {
      throw new UnmarshalException("A JMUnmarshaller class is not set.");
    }
    try {
      return (JMUnmarshaller) c.newInstance();
    } catch (Exception e) {
      throw new UnmarshalException("Failed to instantiate JMUnmarshaller class " + c, e);
    }
  }
View Full Code Here

TOP

Related Classes of javax.xml.bind.UnmarshalException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.