Solved

NoClassDefFoundError while starting the application

Posted on 2006-07-18
15
567 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
java mysql insert application 14 68
Html split(text) 2 48
How does initial implicit objects  are set up in JSP? 7 40
Eclipse neon2 "Java build path" correctness 7 43
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This video teaches viewers about errors in exception handling.
Suggested Courses

732 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