facebook

NoClassDefFoundError: org/apache/commons/logging/LogFactory

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #271342 Reply

    I’m able to run my Hibernate Java application within the MyEclipse IDE but when I launch the class from the command line using

    java mmm.Notifier

    I get the following error:

    Exception in thread “main” java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at mmm.NotificationDAO.<clinit>(NotificationDAO.java:20
    )
    at mmm.Notifier.main(Notifier.java:58)

    I’ve verified that my CLASSPATH variable contains log4j-1.2.11.jar. Is there any way of deploying the application from MyEclipseIDE when it is a standalone java app? Again, the app runs from within the IDE.

    #271359 Reply

    Loyal Water
    Member

    If you open your project properties and go to Java Build Path then your libraries tab, do you see all your Hibernate libraries added there? Do you see commons-logging? If not, you need to add it. If you added the libraries to your project when you added Hibernate capabilities, click Add then drill down to WEB-INF/lib and add all the JARs listed. If you didn’t, then click Add Library, then MyEclipse Library then both the Hibernate libraries.

    Now redeploy and try and run your example, commons-logging.jar should be deployed and should avoid that ClassNotFoundException

    #271438 Reply

    Thanks. I had the commons-logging jar in the classpath but didn’t have the right path to it. I had to build the classpath manually outstide of th IDE. Is there anyway to export the project to a standalone app so that I can launch it from outside the IDE like a standard java app? I.e., java -CLASSPATH …

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: NoClassDefFoundError: org/apache/commons/logging/LogFactory

You must be logged in to post in the forum log in