I need some advice about this… I have a program that serves as a utility for another system. My program’s function is to monitor the database and locate certain entries with a specific value; This value is produced when the main system encounters a specific condition wherein it cannot process the entry further. When the specific value is located, my program will validate if the requirements needed to process it is available, and call the method where the system stopped it’s processing so that it could complete the entry.
My program encounters an error every time it tries to call the method of the main system. The command prompt shows this error “Exception in thread “timer-0″ java.lang.NoClassDefFoundError”
bear in mind that the main program is continuously running. It gets another entry every time an entry is finished. So it is possible that my program could be calling a method which is currently in use by the main system.
I’m not sure if the error is due to my program, not locating the method needed as for the NoClassDefFoundError or if my program is trying to call the method which is currently in use by the main program as per the Exception in thread “timer-0”.
Also the main and my program is not using any threads.
A
NoClassDefFoundErrormeans that your program was trying to load a class that was not on its classpath (or strictly, could not be resolved by the classloader).If this never works, it could simply be that you’re launching it without including a required library on the classpath.
Alternatively, I have seen this before with Java apps that communicate between themselves, when an internal class from the remote app is passed back to the caller and cannot be instantiated. For example, the remote app might be using some JDBC/ORM framework, which throws a custom subclass of
SQLException. This exception bubbles up through the remote call and back across to the local app, which cannot instantiate the specific subclass. In this latter case, have a look at logs on the remote app to see if you can spot a problem that’s occurring there.In any case, you should be able to resolve this by adding some class/JAR to your classpath; it may simply be a challenge to work out exactly which one. A “kitchen sink” approach might help you get past this specific problem and see what the underlying one (if any) is.