• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

java.lang. NoClassDefFoundError

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator




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
 
Aruna Rao
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no application client below it.
 
Eddie Long
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 146
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i sent a mail to the id i got form the profile... hope it helps
 
Aruna Rao
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic