aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes NoClassDefFoundError with no class name Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "NoClassDefFoundError with no class name" Watch "NoClassDefFoundError with no class name" New topic
Author

NoClassDefFoundError with no class name

ryan pampush
Greenhorn

Joined: May 29, 2012
Posts: 3
I'm trying to run a build on a redhat box using ant and java sdk 1.6. I can build the source fine, but when I try to run the junit tests in ant it craps out when I have fork="true". If I set it to false all is good in the world. Ideally, I would like to have fork="true". I looked at the classpath and it seemed like everything was ok. One thing of note is that the ant script runs fine within eclipse regardless if fork="true" or false. It's only when it goes on the linux box it blows up. I am getting a cryptic error that says it can't find the class definition, but it doesn't tell me what class it's look for. Has anyone seen this before? First the stack trace, then the relevant pieces of the ant script.





Any ideas? Thanks!
ryan pampush
Greenhorn

Joined: May 29, 2012
Posts: 3
Another weird thing. If I take the output from the verbose where it tells me the command it runs and the arguments, if I throw that into the command prompt it executes just fine with the arguments it says it executes with, no exceptions thrown.
ryan pampush
Greenhorn

Joined: May 29, 2012
Posts: 3
After a ridiculous amount of googling/combing the apache bugzilla page, I finally found the problem. Apparently when running a fork in ANT 1.7x if you pass a JVM arg that is empty it causes that cryptic error message. I put in dummy values for the args when they aren't used and it works fine. Ugh.

For anyone else who has a similar problem, here is a link to the bug report - may keep you a little more sane.

https://issues.apache.org/bugzilla/show_bug.cgi?id=43586
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5827
    
    7

Ryan, welcome to Java Ranch, and thank you for posting that information.! I'm sure it will help others.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NoClassDefFoundError with no class name