aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes java.lang. NoClassDefFoundError Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "java.lang. NoClassDefFoundError" Watch "java.lang. NoClassDefFoundError" New topic
Author

java.lang. NoClassDefFoundError

Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
Hi,

I am using the HF to study ejb. In Chapter 1 everything went fine upto the compilation of AdviceClient.java file. But...when i tried to run the AdviceClient I got the following error:
Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient

i tried runing it by giving the follwing command but alas to no avail.
java -cp c:\JavaExamples\advice\AdviceAppClient.jar AdviceClient

Can anyone help me out.

Thanks
Eddie Long
Ranch Hand

Joined: Nov 02, 2003
Posts: 69



i tried runing it by giving the follwing command but alas to no avail.
java -cp c:\JavaExamples\advice\AdviceAppClient.jar AdviceClient


Make sure you have added the advice client classes to you EJB App in the deploy tool. You should be able to see the jar in the General tab when you click on the app displayed in the left hand side of the deploytool screen. Check the jars to make sure you have all the class files and not the *.java files.

If this does not work then try running just AdviceClient class to make sure it works. To do this you should run it with the package intact i.e. if the package declaration at the top of the AdviceClient class is foo.ejb.client then you will need to cd to the directory just above foo then do
java foo.ejb.client.AdviceClient


...and so help me God.
Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
It is still not working. AdviceClient is not in a package and i tried running just AdviceClient as u adviced but it is still not working.
Eddie Long
Ranch Hand

Joined: Nov 02, 2003
Posts: 69
You may need to check all your settings and redeploy your ear
After redeploying, cd to the directory that contains the client jar and do
set APPCPATH="jarname"

The jar i'm refering to is the jar returned during the deploy. [I hope you are ticking the return client jar checkbox on the deploy screen?] The path to the jar is shown in the textfield below the checkbox

Now try runclient -client EARFILENAME.ear -name AdviceClient

NB: Make sure there is a public static main(String[] args) in the AdviceClient class

Hope this helps
Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
Sorry still not working.
I did as specified i.e:
set APPCPATH=AdviceAppClient.jar :No problem with this statement
runclient -client AdviceApp.ear -name AdviceClient
It gives the following error: No application client descriptors defined for: AdviceClient.class

Maybe i am not doing correctly.Can you explain it more clearly. The jar deturned during deployment is AdviceAppClient.jar and i did check the check box and redeployed the entire thing as specified in Head First EJB book.
Eddie Long
Ranch Hand

Joined: Nov 02, 2003
Posts: 69


set APPCPATH=AdviceAppClient.jar :No problem with this statement

This should be set APPCPATH="AdviceAppClient.jar"
your current directory should be the location of the above jar


It gives the following error: No application client descriptors defined for: AdviceClient.class

right click on the client jar in the deploytool and view the descriptor. You should have an ejb-ref entry. If you don't then you'll need to add the right entries to EJB Ref tab of the client. This should be in the book you are using

Try these...
[ January 17, 2005: Message edited by: Eddie Long ]
Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
Still no luck
In the RI deployment tool i am working on in the general tab for my ejb has one jar called ejb-bar-ic.jar. And i am unable to right click that. I can't find the AdvieAppClient.jar in the deployment tool but it is there in my JavaExample\advice folder on my local system.
Eddie Long
Ranch Hand

Joined: Nov 02, 2003
Posts: 69
Under the enterprise app folder for your application, you should have a jar for the ejbs in the app and an application client just beneath it.

All this should be on the left hand side of the deploytool window. Try right clicking on each of these and click the Descriptor Viewer. You should be able to check that you have the ejb references from you client to the ejbs
Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
There is no application client below it.
Eddie Long
Ranch Hand

Joined: Nov 02, 2003
Posts: 69
You need to add a new application client. I suggest you have a look at the Duke's bank Application and see how that is deployed and executed. All the steps you need to follow to successfully deploy an application is included in the tutorial.

J2EE 1.3 Tutorial

If you prefer to use the HF code then you can download it from HFE Code, although you are still stuck with the explanation from the book.
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
hi
I am also preparing using the HF... i can help u out with this... if u give me ur mail id i can give u what i did to run it...
Srividhya
Balaji Anand
Ranch Hand

Joined: Nov 03, 2004
Posts: 146
i sent a mail to the id i got form the profile... hope it helps
Aruna Rao
Greenhorn

Joined: Feb 25, 2003
Posts: 10
Finally got my program up and running. Adding j2sdkee.jar solved the problem of noclassdef error but, gave me coba.no_permission error.
The CORBA error had to do with the settings. It seesm there are some issues with J2ee1.3. All i had to do was the following:

In the Security tab of the EJB inspector in deploytool, click
"Deployment Settings..". Under the box "Client Authentication", make
sure "Support Client Choice" is checked instead of "Certificate" or
"Password".

So after making these changes i just updated and redeployed....and
voila the program gives results.
 
Consider Paul's rocket mass heater.
 
subject: java.lang. NoClassDefFoundError