Search code examples
websphere-7

WebSphere 7 - Classpath is different on both servers within the same cluster


I am facing a peculiar issue in WebSphere 7. Our Spring WS application has several Jars under /WEB-INF/lib and it doesnt have an explicit Classpath. The application is deployed in 2 clustered servers. The EAR contains only one Module and no other Jars. Its working on one of the servers but failing on other. We are getting the below error: Caused by: java.lang.NoSuchMethodError: org/w3c/dom/Node.getLocalName()Ljava/lang/String;

The runtime Classpath of both Servers is different as seen in WebSphere Classpath Viewer. I suspect this is the cause for the error. I also made sure that the Classloading on both Servers is same and set to PARENT_LAST/Application

How to make sure the Classpath is same on both the servers?


Solution

  • The issue is resolved. Caused by: java.lang.NoSuchMethodError: org/w3c/dom/Node.getLocalName()Ljava/lang/String; was caused due to "xml4j.jar" which contained a version of Node class without the getLocalName() method. The Node class and the getLocalName() method are also part of "dom.jar". In one of the server where it didnt work might be loading the incorrect version of Node class. It worked in all environments after removing the "xml4j.jar"

    Thanks!