Link to home
Start Free TrialLog in
Avatar of expertsit
expertsit

asked on

NoClassDefFoundError while starting the application

I am getting this exception while starting my application.

Here is the stack trace of the exception:

In my folder structure, I have this class CustWOSet.class in the workorder folder.  I also tried to add this in the classpath explicitly in the environmental variables but still didnt work.

Tue Jul 18 15:55:05 CDT 2006 java.lang.NoClassDefFoundError: custom/app/workorder/CustWOSet
      at java.lang.ClassLoader.defineClass0(Native Method)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.ClassLoader.defineClass(ClassLoader.java:488)Tue Jul 18 15:55:05 CDT 2006
      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:106)Tue Jul 18 15:55:05 CDT 2006
      at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:401)Tue Jul 18 15:55:05 CDT 2006
      at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:162)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.ClassLoader.loadClass(ClassLoader.java:294)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.ClassLoader.loadClass(ClassLoader.java:250)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:310)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.Class.forName0(Native Method)Tue Jul 18 15:55:05 CDT 2006
      at java.lang.Class.forName(Class.java:115)Tue Jul 18 15:55:05 CDT 2006
      at psdi.mbo.MboSetInfo.getMboSetClass(MboSetInfo.java:115)Tue Jul 18 15:55:05 CDT 2006
      at psdi.server.AppService.getMboSet(AppService.java:350)Tue Jul 18 15:55:05 CDT 2006
Avatar of Mick Barry
Mick Barry
Flag of Australia image

what package is the class in?
If its in workorder package then u need to add custom/app to your classpath
and call
Class.forName("workorder.CustWOSet");
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of expertsit
expertsit

ASKER

The custom.app.workorder.CustWOSet is in a folder called Maximo which is in E:\ drive. So I should include E:\Maximo in my classpath. I already have that in the classpath.

thanks for the quick response.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I already have E:/Maximo in my classpath. Also, I am not running this application from the command line. The ear file is deployed in the weblogic server and I start the application by typing the url in a browser.

thanks for your ideas.
>> I already have E:/Maximo in my classpath

Weblogic ignores the system class-path.

>> I start the application by typing the url in a browser.

Browser is the client :) the server would've been started somewhere else.
So where else should I define the classpath if the weblogic ignores the system class-path?

thanks,
If the class is JARed, place it in the lib directory of the project or server. Otherwise place the custom directory inside the classes directory (the entire hierarchy custom/app/workorder along with the class file should be present).
I am building the ear file using the build.xml

That's fine. The classes the application needs have to be locatable.
Actually that error is fixed. I modified the build.xml and rebuilt the ear files and it worked.

thanks,