0

I got below NoClassDefFoundError exception while writing java code to consume web service. after some google search I realized this class is present in axiom-impl-1.2.12.jar and i am using axiom-impl-1.2.5.jar. I replaced it and then started getting other similar Exception due to axiom-api-1.2.5.jar so took latest axiom.jar ( which contains axiom-impl-1.2.14.jar, axiom-dom-1.2.14.jar and axiom-api-1.2.14.jar) and problem got resolved.

java.lang.NoClassDefFoundError: org/apache/axiom/om/OMSourcedElement
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at org.apache.axiom.om.OMAbstractFactory.getOMFactory(OMAbstractFactory.java:55)
    at org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:566)
    at org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBuilder.java:96)
    at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig(AxisConfigBuilder.java:79)
    at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:615)
    at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(FileSystemConfigurator.java:115)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:64)
    at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
    at org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClient.java:146)
    at org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:139)

But the problem is similar code is working on my team mates machine with older jars (axiom-impl-1.2.5.jar, axiom-dom-1.2.5.jar and axiom-api-1.2.5.jar ). I doubt i am using some configuration in eclipse(3.7)/tomcat(6.0) due to this my code is looking for latest axiom jars. I am using JDK 1.7.0_45 and Axis2(1.3)

So the question is What is this configuration ( or any other reason ) ? how can i change it so that i can work with older axiom jars ( 1.2.5 version ) also ?

Vipin
  • 4,851
  • 3
  • 35
  • 65
  • You should compare the versions of the jars that your colleague has and also do check his version of JDK. – Omoro Feb 05 '14 at 17:51
  • these are same , we take jars from same repository. – Vipin Feb 06 '14 at 04:14
  • Also try checking if you have other exceptions besides the NoClassDefFoundError and again inspect your jars and versions thoroughly and make sure that you don't have different versions of the same class in your classpath. – Omoro Feb 06 '14 at 09:53
  • As I told you we take jars from same repository so versions are also same. Just one diff I notice version of jdk7 I am using latest version. They are using some older version of jdk7 – Vipin Feb 07 '14 at 02:21
  • Also today I deployed my code on Unix server and it is running perfectly using older axiom jars(1.2.5 version) , so there is some seems to be something wrong with my local eclipse setup – Vipin Feb 07 '14 at 02:27
  • Oke that could be, but you should also check under which JDK/JRE the Eclipse compiles your project. That might give some clue also if it was working well before. – Omoro Feb 07 '14 at 07:39
  • compliance level is 1.7 , java library is 1.7 facet is also 1.7 – Vipin Feb 07 '14 at 08:54

0 Answers0