As I wrote before I am currently building EJB3/ JSF1.2 applications which I build and deploy with Maven2. Last time I was building my web project when suddenly I got a Maven error, stating:
[INFO] ————————————————————————
[ERROR] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
An exception has occurred in the compiler (1.5.0_09). Please file a bug at the
Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates.
Include your program and the following diagnostic in your report. Thank you.
com.sun.tools.javac.code.Symbol$CompletionFailure: file javax\ejb\ApplicationException.class not found
When I started to read the error message my first reaction was: WTF! A bug in the compiler?!?!
But then I read the last line in which it says it misses a class from the EJB3 library, so I added to my pom:
1 2 3 4 5 6 | <dependency> <groupId>javax.ejb</groupId> <artifactId>ejb-api</artifactId> <version>3.0</version> <scope>provided</scope> </dependency> |
Now the Maven build works without any problem. So that’s why you should study the entire error stack trace before you start to panic about bugs in the JDK compiler that you are using :-)
You are the man!!!!
It’s true that we should always read the complete trace, but when you see that your compiler has a bug …
In my case the problem was using JAX-WS and the missing class javax.xml.bind.annotation.XmlSeeAlso, it was solved by adding jaxb-api-2.1.jar to my pom.
Thanks!