0

I have a Java EAR application deployed in a Oracle Weblogic Application Server. The Application is processing among others some HTTP requests In one of them it is processing some XML files (form the file system)

What makes this interesting is that the very same EAR file is deployed on another server machine, that was set up based on the same installation manual like the first one and there I get the following Class Not Found Exception:

org.xml.sax.SAXException: SAX2 driver class org.apache.xerces.parsers.SAXParser not found
java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
    at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:230)
    at org.xml.sax.helpers.XMLReaderFactory.createXMLReader(XMLReaderFactory.java:191)
    at org.example.application.BL.data.ResourceParser.parse(ResourceParser.java:178)
    at org.example.application.BL.data.DataModel.validate(DataModel.java:323)
    at org.example.application.BL.action.Update.execute(Update.java:165)
    at org.example.application.webapp.ActionControl.doGet(ActionControl.java:78)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3682)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
    at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
    at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
    at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
    at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
    at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
    at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
    at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)
Caused by: java.lang.ClassNotFoundException: org.apache.xerces.parsers.SAXParser
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:1026)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:987)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.findClass(ChangeAwareClassLoader.java:83)
    at weblogic.utils.classloaders.GenericClassLoader.doFindClass(GenericClassLoader.java:608)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:540)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:493)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:470)
    at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:62)
    at org.xml.sax.helpers.NewInstance.newInstance(NewInstance.java:82)
    at org.xml.sax.helpers.XMLReaderFactory.loadClass(XMLReaderFactory.java:228)
    ... 32 more

on the suspect lines:

final XMLReader parser = XMLReaderFactory.createXMLReader();

I checked that on both servers (Same Java, Weblogic, ...) there is the same classpath available to the applications, the same commandline arguments and and as well checked that they have opened the same files (lsof) and they match for all the jar files etc (except for log files).

Currently I'm a bit irritated where the one loads the SAX form that is not accessible for the other.

Running on: Java 8, WebLogic 12c;

Edit: I've found a well this in the logs - but couldn't identify the cause:

Apr 15, 2019 12:30:04 PM weblogic.wsee.runtime.JMSStoreRoutableIDMapper addServerSetListener
INFO: add ServerSetListener for partition: DOMAIN
Warning: org.apache.xerces.parsers.SAXParser: Feature 'http://javax.xml.XMLConstants/feature/secure-processing' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
Warning: org.apache.xerces.parsers.SAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
Apr 15, 2019 12:30:38 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-tx/wsat/2006/06}ATAssertion" was evaluated as "UNKNOWN".
Apr 15, 2019 12:30:38 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector]  selectAlternatives
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".
PaulEdison
  • 897
  • 1
  • 15
  • 36
  • Looks like the class is not in the path. – J_D Apr 15 '19 at 19:17
  • @J_D: Are you sure? why on the one server and not on the other - both having the same files open? any Ideas? – PaulEdison Apr 15 '19 at 20:25
  • The class is not available to the class loader. Hence it was not deployed. Did your deploy complete correctly or where there any errors? Other factors that could produce a 'class not found' maybe the permissions on the jar containing the class. – J_D Apr 16 '19 at 08:06
  • @J_D: The JVM opens the exact same files on both servers. EAR file matches the MD5 sum (as well as the opened files) the class is avalible in the rt.jar (this is part of the standard JRE) that is opened by the JVM that is hosting the application. there have been off no errors during deployment. It seems that due to what ever reason the ClassLoader is not searching on booth servers with the same order/logic. – PaulEdison Apr 21 '19 at 12:55

0 Answers0