?
Solved

NoClassDefFoundError while starting the application

Posted on 2006-07-18
15
Medium Priority
?
578 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 128 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
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 1

Assisted Solution

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

java custom.app.workorder.CustWOSet  

and see what happens
0
 
LVL 26

Assisted Solution

by:ksivananth
ksivananth earned 124 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 124 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

Get real performance insights from real users

Key features:
- Total Pages Views and Load times
- Top Pages Viewed and Load Times
- Real Time Site Page Build Performance
- Users’ Browser and Platform Performance
- Geographic User Breakdown
- And more

Question has a verified solution.

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

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses
Course of the Month10 days, 4 hours left to enroll

762 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