4 Replies Latest reply: Aug 26, 2010 4:22 PM by 97488 RSS

    XMLGregorianCalendarImplParser NoClassDefFound

    718753
      Fellow folks,
      I am running JAX-WS webservices on Weblogic 10.3 and have a xsd:datetime element in the request. The issue I am facing is that I get a occasional ClassNotFound error for XMLGregorianCalendarImpl$Parser. Once this issue occurs, if I restart my server it just goes away and might occur anytime later.
      Following are the facts:
      1) I have XercesImpl.jar in my EAR and there is only one copy of it in the EAR.
      2) That jar contains XMLGregorianCalendarImpl$Parser for sure.
      3) Apart from my EAR, there are two version of this class in my weblogic -one in rt.jar(Sun's version) and one in modules(apache's version).

      I am wondering why the heck this issue occurs though this class is present in my EAR And weblogic/modules folders as well.Also this issue occurs occasionally, which is unpredictable.

      I am not sure, if this is a bug with weblogic or something to do with classloader.

      Any suggestions, thoughts?

      FOllowing is the stack trace:
      'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1250876931733> <BEA-101017> <[weblogic.servlet.internal.WebAppServletContext@1bc475 - appName: 'OrderProcessService_5', name: 'orderprocessservices', context-path: '/orderprocessservices', spec-version: '2.5'] Root cause of ServletException.
      java.lang.NoClassDefFoundError: org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl$Parser
           at org.apache.xerces.jaxp.datatype.XMLGregorianCalendarImpl.<init>(Unknown Source)
           at org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl.newXMLGregorianCalendar(Unknown Source)
           at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$13.parse(RuntimeBuiltinLeafInfoImpl.java:543)
           at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$13.parse(RuntimeBuiltinLeafInfoImpl.java:517)
           at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTransducedAccessorImpl.parse(TransducedAccessor.java:241)
           at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(LeafPropertyLoader.java:61)
           at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(UnmarshallingContext.java:462)
           at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.processText(StAXStreamConnector.java:367)
           at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.handleEndElement(StAXStreamConnector.java:245)
           at com.sun.xml.bind.v2.runtime.unmarshaller.StAXStreamConnector.bridge(StAXStreamConnector.java:214)
           at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:358)
           at com.sun.xml.bind.v2.runtime.BridgeImpl.unmarshal(BridgeImpl.java:120)
           at com.sun.xml.bind.api.Bridge.unmarshal(Bridge.java:233)
           at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$DocLit.readRequest(EndpointArgumentsBuilder.java:517)
           at com.sun.xml.ws.server.sei.EndpointArgumentsBuilder$Composite.readRequest(EndpointArgumentsBuilder.java:188)
           at com.sun.xml.ws.server.sei.EndpointMethodHandler.invoke(EndpointMethodHandler.java:243)
           at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:93)
           at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
           at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
           at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
           at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
           at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
           at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
           at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
           at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:134)
           at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:272)
           at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:185)
           at weblogic.wsee.jaxws.JAXWSServlet.doPost(JAXWSServlet.java:180)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
           at weblogic.wsee.jaxws.JAXWSServlet.service(JAXWSServlet.java:64)
           at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
           at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
           at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
           at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
           at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
           at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
           at weblogic.security.service.SecurityManager.runAs(Unknown Source)
           at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
           at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
           at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
           at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
           at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

      Edited by: user10398489 on Aug 22, 2009 2:22 PM
        • 1. Re: XMLGregorianCalendarImplParser NoClassDefFound
          739426
          We have the exact same problem (WLS 10.3)
          I'll test it with WLS 10.3.1 later this week to see if the "bug" goes away.
          • 2. Re: XMLGregorianCalendarImplParser NoClassDefFound
            709108
            I am having this problem as well. Has this exception been resolved and how? What is the root cause?
            • 3. Re: XMLGregorianCalendarImplParser NoClassDefFound
              sandeep_singh
              This may be happening because of the following reason:

              The JAXP factories cache the classes used to instantiate the factories,therefore you cannot changed dynamically these properties at runtime.
              You will have absolutely NO guarantee that this will work.
              If a factory is instantiated before yours, it will use this one. Additionaly, Weblogic
              already defines these properties at startup so that they refer to their own factories that can look into the XML registry.

              If you need to define a specific parser (such as apache xerces), then put xerces
              in your system classpath and set the XML registry appropriately using the following flags:
              -Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl
              -Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl
              -Djavax.xml.parsers.SAXParser=org.apache.xerces.jaxp.SAXParserImpl


              If you want to take a look at jaxp strategy. Use the JVM following Property:
              -Djaxp.debug=true.
              As well use following for Weblogic XML related info:
              -Dweblogic.xml.debug=true

              Thanks,
              Sandeep
              • 4. Re: XMLGregorianCalendarImplParser NoClassDefFound
                97488
                I had the same problem with WebLogic 10.3.1. I fixed it by just removing the xerces_impl.jar from my war file. Remember, there's already a xerces implementation included in the Java 1.6 runtime.