Results 1 to 1 of 1
  1. #1
    Daniela is offline Member
    Join Date
    Jul 2011
    Posts
    1
    Rep Power
    0

    Default jaxb and xml exstenstion

    Hi,

    I have the xsd files BannerXml, BatchBanner and BatchResponse. jaxb generates OriginalBannerXmlType for BannerXml and BannerXmlType for BatchBanner.
    When I try to marshall Response which contains in the media banner xml I receive the following exception:
    javax.xml.bind.UnmarshalException: null
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.cr eateUnmarshalException(Unknown Source) ~[na:1.6.0_23]
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.createUnmarshalException(UnmarshallerImpl. java:514) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:215) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal(UnmarshallerImpl.java:184) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(Unknown Source) ~[na:1.6.0_23]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.un marshal(Unknown Source) ~[na:1.6.0_23]
    at com.amobee.nc.protocol.af.AFBatchRequestReader.rea d(AFBatchRequestReader.java:109) ~[classes/:na]
    at com.amobee.nc.protocol.AbstractRequestReader.readR equest(AbstractRequestReader.java:89) [classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.r unCommand(AbstractBaseServlet.java:102) [classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.d oPost(AbstractBaseServlet.java:84) [classes/:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:595) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:668) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:511) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:390) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:182) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:765) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:418) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:114) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:542) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:938) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:755) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:218) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:404) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.bio.SocketConnector$Connection.r un(SocketConnector.java:228) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:582) [jetty-util-6.1.22.jar:6.1.22]
    Caused by: org.xml.sax.SAXParseException: Content is not allowed in prolog.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.util.ErrorHandlerWrapper.fatalEr ror(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLScanner.reportFatalError (Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLDocumentScannerImpl$Prol ogDispatcher.dispatch(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLDocumentFragmentScannerI mpl.scanDocument(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.parsers.XML11Configuration.parse (Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.parsers.AbstractSAXParser.parse( Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser .parse(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at com.sun.xml.bind.v2.runtime.unmarshaller.Unmarshal lerImpl.unmarshal0(UnmarshallerImpl.java:211) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    ... 25 common frames omitted
    2011-07-28 19:42:46,721 ERROR [540485573@qtp-1545215993-0] com.amobee.frontend.servlets.AbstractBaseServlet -
    com.amobee.exceptions.UpsteedException: null
    at com.amobee.nc.protocol.af.AFBatchRequestReader.rea d(AFBatchRequestReader.java:114) ~[classes/:na]
    at com.amobee.nc.protocol.AbstractRequestReader.readR equest(AbstractRequestReader.java:89) ~[classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.r unCommand(AbstractBaseServlet.java:102) [classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.d oPost(AbstractBaseServlet.java:84) [classes/:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:595) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:668) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:511) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:390) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:182) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:765) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:418) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:114) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:542) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:938) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:755) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:218) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:404) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.bio.SocketConnector$Connection.r un(SocketConnector.java:228) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:582) [jetty-util-6.1.22.jar:6.1.22]
    2011-07-28 19:42:47,609 ERROR [540485573@qtp-1545215993-0] com.amobee.nc.protocol.af.AFBatchResponseWriter - ad fetcher xml response is invalid
    javax.xml.bind.MarshalException: null
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(M arshallerImpl.java:318) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.marshal (MarshallerImpl.java:244) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at javax.xml.bind.helpers.AbstractMarshallerImpl.mars hal(Unknown Source) ~[na:1.6.0_23]
    at com.amobee.nc.protocol.af.AFBatchResponseWriter.ma rshallXml(AFBatchResponseWriter.java:695) ~[classes/:na]
    at com.amobee.nc.protocol.af.AFBatchResponseWriter.wr iteErrorResponse(AFBatchResponseWriter.java:190) ~[classes/:na]
    at com.amobee.nc.protocol.AbstractResponseWriter.writ eError(AbstractResponseWriter.java:122) [classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.r unCommand(AbstractBaseServlet.java:150) [classes/:na]
    at com.amobee.frontend.servlets.AbstractBaseServlet.d oPost(AbstractBaseServlet.java:84) [classes/:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:595) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:668) [geronimo-servlet_3.0_spec-1.0.jar:1.0]
    at org.mortbay.jetty.servlet.ServletHolder.handle(Ser vletHolder.java:511) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.ServletHandler.handle(Se rvletHandler.java:390) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.security.SecurityHandler.handle( SecurityHandler.java:216) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.servlet.SessionHandler.handle(Se ssionHandler.java:182) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.ContextHandler.handle(Co ntextHandler.java:765) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebA ppContext.java:418) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:114) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.handler.HandlerWrapper.handle(Ha ndlerWrapper.java:152) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.Server.handle(Server.java:326) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handleRequest(Htt pConnection.java:542) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection$RequestHandler.co ntent(HttpConnection.java:938) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseNext(HttpParser. java:755) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpParser.parseAvailable(HttpPa rser.java:218) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.HttpConnection.handle(HttpConnec tion.java:404) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.jetty.bio.SocketConnector$Connection.r un(SocketConnector.java:228) [jetty-6.1.22.jar:6.1.22]
    at org.mortbay.thread.QueuedThreadPool$PoolThread.run (QueuedThreadPool.java:582) [jetty-util-6.1.22.jar:6.1.22]
    Caused by: org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'ns2:bannerxml'. One of '{"http://ads.vodafone.com/schema/banner/2.2":bannerxml}' is expected.
    at org.apache.xerces.util.ErrorHandlerWrapper.createS AXParseException(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.util.ErrorHandlerWrapper.error(U nknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.XMLErrorReporter.reportErro r(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.xs.XMLSchemaValidator$XSIEr rorReporter.reportError(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.repor tSchemaError(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.handl eStartElement(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.impl.xs.XMLSchemaValidator.start Element(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.apache.xerces.jaxp.validation.ValidatorHandler Impl.startElement(Unknown Source) ~[xercesImpl-2.9.1.jar:na]
    at org.xml.sax.helpers.XMLFilterImpl.startElement(Unk nown Source) ~[na:1.6.0_23]
    at com.sun.xml.bind.v2.runtime.output.SAXOutput.endSt artTag(SAXOutput.java:124) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.output.ForkXmlOutput.e ndStartTag(ForkXmlOutput.java:102) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.XMLSerializer.endAttri butes(XMLSerializer.java:306) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsX siType(XMLSerializer.java:695) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.property.ArrayElementN odeProperty.serializeItem(ArrayElementNodeProperty .java:65) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.property.ArrayElementP roperty.serializeListBody(ArrayElementProperty.jav a:168) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.property.ArrayERProper ty.serializeBody(ArrayERProperty.java:155) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.seri alizeBody(ClassBeanInfoImpl.java:340) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsX siType(XMLSerializer.java:696) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.property.SingleElement NodeProperty.serializeBody(SingleElementNodeProper ty.java:152) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.seri alizeBody(ClassBeanInfoImpl.java:340) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsS oleContent(XMLSerializer.java:593) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.ClassBeanInfoImpl.seri alizeRoot(ClassBeanInfoImpl.java:324) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.XMLSerializer.childAsR oot(XMLSerializer.java:494) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    at com.sun.xml.bind.v2.runtime.MarshallerImpl.write(M arshallerImpl.java:315) ~[jaxb-impl-2.2.1.1.jar:2.2.2]
    ... 25 common frames omitted

    How can I solve it?
    Thanks,
    Daniela
    Attached Files Attached Files

Similar Threads

  1. JAXB Unmarshalling
    By milan.nosal in forum XML
    Replies: 0
    Last Post: 09-01-2010, 02:15 PM
  2. JAXB Binding
    By Fusebox in forum XML
    Replies: 0
    Last Post: 06-11-2010, 10:06 PM
  3. Jaxb
    By Paul Richards in forum XML
    Replies: 1
    Last Post: 08-03-2009, 09:56 PM
  4. JAXB Marshalling
    By akbar4ums in forum XML
    Replies: 1
    Last Post: 12-20-2008, 04:39 AM
  5. JAXB Unmarshalling
    By prateek in forum XML
    Replies: 0
    Last Post: 07-10-2008, 06:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •