This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Any ideas why my class isn't getting found? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Any ideas why my class isn Watch "Any ideas why my class isn New topic
Author

Any ideas why my class isn't getting found?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

I wrote a custom task for Ant (using Ant 1.7, Java 1.6). The custom task references the log4j framework, and even though I include it in my classpath, I'm getting a "class cannot be found" error. Here is the relevant part of my Ant task ...



and here is the output I'm getting ...



Notice that log4j is included. I have verified the path exists. Any ideas what else I should check for? - Dave
Greg Charles
Sheriff

Joined: Oct 01, 2001
Posts: 2840
    
  11

Hmm, that's a puzzle. Still, it must be something. You're picking up log4j from Tomcat, right? (/Library/Tomcat/Home/common/log4j-1.2.4.jar) I'd suggest to keep picking at the obvious things. Is the jar really there with exactly the same name? (I know you verified it already, and Ant must be picking it up somehow. Still a quick "file /Library/Tomcat/Home/common/log4j-1.2.4.jar" would double-check) Is the file readable by whatever user is running Ant? If you look in the jar, is the Logger class there and in the right package?

 
 
subject: Any ideas why my class isn't getting found?
 
Similar Threads
Problem running Spring Application
Ant taskdef & classpath
Hibernate Validation not working.. default provider not available
Ant classpath issues
Configurin Spring AOP with Spring 3.0.0