You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Lewis, Eric" <Er...@ipi.ch> on 2012/05/02 17:30:00 UTC

Findbugs 2.4.0 fails with NoClassDefFoundError

Hi

We're having a very weird error with the latest Findbugs plugin.
It works fine on our test build server, but it fails on our production build server.

Here's the output:
     [java] java.lang.NoClassDefFoundError: org/apache/bcel/classfile/ClassFormatException
     [java] Caused by: java.lang.ClassNotFoundException: org.apache.bcel.classfile.ClassFormatException
     [java] 	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
     [java] 	at java.security.AccessController.doPrivileged(Native Method)
     [java] 	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
     [java] 	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
     [java] 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
     [java] Could not find the main class: edu.umd.cs.findbugs.FindBugs2.  Program will exit.
     [java] Exception in thread "main"

When running in debug mode, we can see that the classpathes of the test and production servers differ.

Here are the JARs that appear on the test server, but not on the production server:
[DEBUG]          com.google.code.findbugs:bcel:jar:2.0.0:compile
[DEBUG]          com.google.code.findbugs:jsr305:jar:2.0.0:compile
[DEBUG]          com.google.code.findbugs:jFormatString:jar:2.0.0:compile
[DEBUG]          com.google.code.findbugs:annotations:jar:2.0.0:compile
[DEBUG]          dom4j:dom4j:jar:1.6.1:compile
[DEBUG]          jaxen:jaxen:jar:1.1.1:compile
[DEBUG]             jdom:jdom:jar:1.0:compile
[DEBUG]             xom:xom:jar:1.0:compile
[DEBUG]                xerces:xmlParserAPIs:jar:2.6.2:compile
[DEBUG]                xalan:xalan:jar:2.6.0:compile
[DEBUG]                com.ibm.icu:icu4j:jar:2.6.1:compile
[DEBUG]          asm:asm:jar:3.3:compile
[DEBUG]          asm:asm-tree:jar:3.3:compile
[DEBUG]          asm:asm-commons:jar:3.3:compile

Any hints what we're doing wrong or how I could chase that bug better?

Thanks & best regards,
Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Findbugs 2.4.0 fails with NoClassDefFoundError

Posted by Wayne Fay <wa...@gmail.com>.
> The real issue was that we had to upload our own Findbugs 2 version into our
> Nexus repo (due to Proxy problems), and somehow that POM was corrupted,
> without any dependencies.

In the future, run "mvn -X ..." and then compare the output from the 2
environments. If one shows a huge list of dependencies related to a
plugin and one does not, it is a good indication of the root of your
problem.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


AW: Findbugs 2.4.0 fails with NoClassDefFoundError

Posted by "Lewis, Eric" <Er...@ipi.ch>.
Hi Wayne

Thanks for the reply.

Just now we had another idea (after searching for hours), and it showed that the fault is on our side, so I apologize for the mail...

The real issue was that we had to upload our own Findbugs 2 version into our Nexus repo (due to Proxy problems), and somehow that POM was corrupted, without any dependencies.
So while Findbugs 2 was found, all its dependencies were not, and the only reason it worked on the test system was the local repo. After cleaning that, the build also failed.

Anyway, what we learned: Be very careful with third-party JARs that you upload to your repository. Well will now clean it up soon!

Thanks & best regards,
Eric

-----Ursprüngliche Nachricht-----
Von: Wayne Fay [mailto:waynefay@gmail.com] 
Gesendet: Mittwoch, 2. Mai 2012 18:00
An: Maven Users List
Betreff: Re: Findbugs 2.4.0 fails with NoClassDefFoundError

> We're having a very weird error with the latest Findbugs plugin.
> It works fine on our test build server, but it fails on our production build server.
...
> When running in debug mode, we can see that the classpathes of the test and production servers differ.

This should not occur if you have plugin versions locked down in your
pom.xml files and aren't using profiles and don't have local (not
checked in yet) changes in one environment. Did you check "mvn
help:effective-pom" in both environments to compare plugin and
dependency versions? Also compare the settings.xml files in the 2
environments.

Are you literally checking the full code tree out from the same place
into the 2 environments, then running the same command and getting
different results?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Findbugs 2.4.0 fails with NoClassDefFoundError

Posted by Wayne Fay <wa...@gmail.com>.
> We're having a very weird error with the latest Findbugs plugin.
> It works fine on our test build server, but it fails on our production build server.
...
> When running in debug mode, we can see that the classpathes of the test and production servers differ.

This should not occur if you have plugin versions locked down in your
pom.xml files and aren't using profiles and don't have local (not
checked in yet) changes in one environment. Did you check "mvn
help:effective-pom" in both environments to compare plugin and
dependency versions? Also compare the settings.xml files in the 2
environments.

Are you literally checking the full code tree out from the same place
into the 2 environments, then running the same command and getting
different results?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org