Advice: read the complete stacktrace

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 :-)

categories: Maven

About Pascal Alma

Pascal started as an Oracle Developer in 1997 and developed numerous applications with Oracle Designer/Developer and PL/SQL. Since 2001 Pascal becomes more and more active with the development of software at the Java/J2EE platform. Nowadays Pascal is a senior JEE Developer/ Architect and has a lot of experience with several open source initiatives/ frameworks especially within the Enterprise Integration area. Besides these technical skills Pascal is a big Scrum enthusiastic.

One Response to Advice: read the complete stacktrace

  1. Jesus says:

    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!