File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

log4j commons-logging problem.

 
lee kris
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have a problem with the log4j logging framework.
I followed the steps for coniguring the log4J and have the commons-logging.jar in my my /lib folder and the log4j.properties in the /WEB-INF/class folder.
now when i import in some of my java files and then compile, i get "package does not exist" error. the imports are as follows:

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

everything seems to be in place as far as configuration goes but i do not know why the package is not being recongnized. can anyone suggest some silly mistakes that I might be making?
Thank you for your suggestions in advance and have a great day.
lee
 
Ray Stojonic
Ranch Hand
Posts: 326
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Having the jar in your web-inf lib is one of the ways to use it in your app, but, having it there doesn't tell javac where it is, you'll still need to add it to your classpath arg for javac to find it.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Putting a jar file in WEB-INF/lib allows the application server to find the class as runtime, but it doesn't necessarily put the jar file in the compile time classpath. Check to see that your WEB-INF/lib/commons-logging.jar is in your classpath at compile time.
 
lee kris
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
to Ray Stojonic and Merrill Higginson,
Thank you both for the immediate response. I knew it was something silly. Now it is compiling correctly.
lee
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic