facebook

NoClassDefFoundError

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #219950 Reply

    Sam
    Member

    I have been testing code for the Quartz Scheduler at work. There, I use
    IBM’s WSAD. I have two classes, one of which has a main method. I can run this as a “Java Application”, and it executes fine.

    Yesterday, I brought the code home, set up a project in Eclipse/myEclipse, imported the needed JAR, and copied the class files into their respective packages (even went as far as copy/pasted the text into newly created files). All looks fine, no syntax errors. When I try and run it as I do at work (as a Java Application), I get the following error. Can anyone shed any light on what I may be doing wrong?

    java.lang.NoClassDefFoundError: org/apache/commons/logging/Log
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
    at java.lang.Class.getDeclaredMethods(Unknown Source)
    at java.beans.Introspector$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.beans.Introspector.getPublicDeclaredMethods(Unknown Source)
    at java.beans.Introspector.getTargetMethodInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at java.beans.Introspector.getBeanInfo(Unknown Source)
    at org.quartz.impl.StdSchedulerFactory.setBeanProp(StdSchedulerFactory.java:913)
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:522)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1020)
    at main.Timer.main(Timer.java:40)
    Exception in thread “main”

    Thanks,
    Sam

    #219968 Reply

    Riyad Kalla
    Member

    Sam
    This is really an Eclipse question, but what you seem to be missing is the commons-logging.jar file from Jakarta Commons added to your Java Build Path > Libraries tab.

    #219982 Reply

    Sam
    Member

    Thanks, Riyad…

    I wasn’t sure where I should post my question, and I did in this forum as well as an Eclipse group on usenet.

    There is a commons-logging.jar in the Quartz lib, so I imported that and added to the build path. Glad to say that it worked, and emarrased to say that now it is quite obvious looking at the error, what I needed to do!

    Thanks for your help,
    Sam

    #219983 Reply

    Riyad Kalla
    Member

    Glad it worked!

    Moving to OT > Soft Dev.

    #279910 Reply

    JY05537
    Member

    Im new to Quartz, I tried to run the example on the Quartz tutorial in Eclipse. and I got the following error:

    **********************************************************************************************
    Exception in thread “main” java.lang.NoClassDefFoundError: javax/transaction/UserTransaction
    at org.quartz.impl.StdSchedulerFactory.instantiate(StdSchedulerFactory.java:1104)
    at org.quartz.impl.StdSchedulerFactory.getScheduler(StdSchedulerFactory.java:1355)
    at org.quartz.impl.StdSchedulerFactory.getDefaultScheduler(StdSchedulerFactory.java:1371)
    at ie.aib.viper.tibco.quartz.JobManager.main(JobManager.java:42)

    *************************************************************************************************
    I have all the jar files imported and added to the build path, also has copied quartz.properties to the project folder(i.e. same level as src folder). Dont know why I still get this error. Do I missing something? Please advise!!

    Thanks

    #281169 Reply

    In order to run the Quartz demo applications, you MUST have the Sun Java Transaction API classes (available here: http://java.sun.com/products/jta/)

    Download the class files and create a JAR file named jta.jar by executing the command: jar cf jta.jar javax

    Then add the file jta.jar to your eclipse project and add the library to the class path.

    If you don’t do this, you will get the following error when you try to execute a Quartz based application: java.lang.NoClassDefFoundError: javax/transaction/UserTransaction

Viewing 6 posts - 1 through 6 (of 6 total)
Reply To: NoClassDefFoundError

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