File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Commons logging not loading into Ant when using Beanshell Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Commons logging not loading into Ant when using Beanshell" Watch "Commons logging not loading into Ant when using Beanshell" New topic
Author

Commons logging not loading into Ant when using Beanshell

Mike Mootin
Greenhorn

Joined: Sep 29, 2009
Posts: 1
I am using a tag in my ant build (1.7.1), and am executing it from within Eclipse. I have it set to "use same JRE as workspace". When Ant goes to execute the beanshell script, I am getting the error "java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory". However I can clearly see that Ant is on the classpath (see attachment).

I have also tried moving the jar into ANT_HOME/lib and get the same results. Using give "C:\ganymede2\plugins\org.eclipse.equinox.launcher_1.0.101.R34x_v20081125.jar" - not at all useful of course.

What's strange is that when I execute Ant using a separate JRE (instead of the workspace one), Ant is able to load the commons logging class, but then I run into other problems related to eclipse compiler-related stuff not being on the classpath.

I recently upgraded to using Java 1.6, so thought it might be related. However, switching back to 1.5 doesn't make any difference.



[Thumbnail for eclipse_ant_classpath.png]

David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

IIRC you need to set the classpath inside Ant, either in the build file, or in the Ant Eclipse setup (I could be way off base on this though).

Having Ant on the classpath, as you state you have, isn't relevant; that's not the error you're getting.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Commons logging not loading into Ant when using Beanshell