Solved

NoClassDefFoundError while starting the application

Posted on 2006-07-18
15
568 Views
Last Modified: 2012-06-27
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
0
Comment
Question by:expertsit
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 2
  • +2
15 Comments
 
LVL 92

Expert Comment

by:objects
ID: 17133816
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");
0
 
LVL 92

Accepted Solution

by:
objects earned 32 total points
ID: 17133824
If its in custom.app.workorder.CustWOSet then add the parent directory of custom to your classpath
0
 

Author Comment

by:expertsit
ID: 17133847
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.
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 1

Assisted Solution

by:soft_techy
soft_techy earned 31 total points
ID: 17135608
try

java custom.app.workorder.CustWOSet  

and see what happens
0
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 31 total points
ID: 17135858
make sure the class "CustWOSet" is in "E:\Maximo\custom\app\workorder" folder and u have "E:\Maximo" in classpath.
0
 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 31 total points
ID: 17136102
If you're running this from the command-prompt and you're setting the class-path using My Computer -> Properties, you need to close the command-window and start a new one. If you are using some IDE like Eclipse, you need to set the class-path there instead of using the system class-path.
0
 

Author Comment

by:expertsit
ID: 17138355
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.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 17138462
>> 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.
0
 

Author Comment

by:expertsit
ID: 17138486
So where else should I define the classpath if the weblogic ignores the system class-path?

thanks,
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 17138567
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).
0
 

Author Comment

by:expertsit
ID: 17138597
I am building the ear file using the build.xml

0
 
LVL 30

Expert Comment

by:Mayank S
ID: 17138830
That's fine. The classes the application needs have to be locatable.
0
 

Author Comment

by:expertsit
ID: 17139214
Actually that error is fixed. I modified the build.xml and rebuilt the ear files and it worked.

thanks,
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
This video teaches viewers about errors in exception handling.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question