13

I'm having this exception with some stubs generateds by Axis2:

"The type org.apache.axiom.om.OMElement cannot be resolved. It is indirectly referenced from required .class files"

I've been reading many posts, and trying to find a solution. What I've found so far is to add the apache tomcat 5.5 library to the build path. It removed the error in the java file, but then, when I to execute any java program inside the project, I got this error:

'Launching myApp' has encountered a problem Exception occurred executing command line. Cannot run program "C:\Program Files\Java\jdk1.5.0_22\bin\javaw.exe" (in directory "D:\Digicel\workspace\Digicel\myClassSample"): CreateProcess error=87, The parameter is incorrect

then if I remove the apache tomcat library from the build path, I can run the other java programs, but not the one mentioned initially.

Any thoughts about it?

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Fernando Moyano
  • 1,097
  • 4
  • 15
  • 29
  • 1
    Ok, I've found the cause of the problem with the help of a friend :) The thing is that Eclipse is aware that one of my dependencies, depends of another library, and Eclipse is checking for it when it tries to build the code. So, what I've done is try to check which jar file contains this library: " org.apache.axiom.om.OMElement". I've googled it and found that it is "axiom-api-1.2.10.jar" and finally my file compiled with 0 errors. So, the fix was to find the appropriate jar and add it to the project. – Fernando Moyano Sep 19 '11 at 19:54
  • He also explained to me that my original solution of adding the apache tomcat server library is adding all the jars that cames with apache tomcat (which is a big list), and probably there may have been a version conflict with my current list of added jars. So, the fix was to find the appropriate jar and add it to the project. As I'm a new user, I have to wait 7 more hours to post a solution to my own question, so, I'm sending teh comment instead :) – Fernando Moyano Sep 19 '11 at 19:54

3 Answers3

18

Okay, I've found the cause of the problem with the help of a friend :)

The thing is that Eclipse is aware that one of my dependencies, depends of another library, and Eclipse is checking for it when it tries to build the code.

So, what I've done is try to check which jar file contains this library: " org.apache.axiom.om.OMElement".

I've googled it and found that it is "axiom-api-1.2.10.jar" and finally my file compiled with 0 errors.

He also explained to me that my original solution of adding the apache tomcat server library is adding all the jars that cames with apache tomcat (which is a big list), and probably there may have been a version conflict with my current list of added jars.

So, the fix was to find the appropriate jar and add it to the project.

Matt Ball
  • 354,903
  • 100
  • 647
  • 710
Fernando Moyano
  • 1,097
  • 4
  • 15
  • 29
4

This error can also occur when a indirect dependency has a corrupt jar file. This may be caused by problems at the public maven repository.

If this is the case removing the local maven repository to download fresh jar files will fix your problem:

rm -Rf ~/.m2/repository/{enter/path/to/broken/stuff}
Martin
  • 2,347
  • 1
  • 21
  • 21
  • Yes - this was the reason why I had this issue. You won't know this until you try to open the JAR file. The error I saw in Eclipse when attempting to view a class in the correupted JAR file is "invalid LOC header (bad signature)" – Danger Aug 13 '18 at 15:07
0

Goto Maven >Update Maven project>checkmark the Force update >Then Run ..That error Will gone....