File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes AdviceClient does not run,very dissapointing 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 "AdviceClient does not run,very dissapointing" Watch "AdviceClient does not run,very dissapointing" New topic

AdviceClient does not run,very dissapointing

Loukas G

Joined: Mar 04, 2004
Posts: 7
The AdviceClient is compiled but not executed.Everything is executed according to the Head First EJb book's first example.Windows XP - J2EE 1.3.1 RI - J2SDK 1.4.2_03 are used.When i try to run AdviceClient :
java -classpath E:\j2sdkee1.3.1\lib\j2ee.jar;E:\source\projects\advice\AdviceAppClient.jar AdviceClient
The following error is provided which is very strange:
javac -classpath E:\j2sdkee1.3.1
Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient
Here is the code:
import javax.naming.*;
import java.rmi.*;
import javax.rmi.*;
import headfirst.*;
import javax.ejb.*;

public class AdviceClient
public static void main(String[] args)
new AdviceClient().go();
public void go() {
Context ic = new InitialContext();
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor = home.create();
catch (Exception ex)
Anyone who knows please tell me if i do something wrong or there is a bug in the RI.Thank you in advance
Loukas G

Joined: Mar 04, 2004
Posts: 7
Please, ignore the first line of the error message.
Thank you.
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
1. I suspect that this could be something to do with classpath.
Make sure the package of the AdviceClient or the classes that it uses
is in the classpath.
2. If you try posting this in the SCBCD cert forum, U are likely to get
more responses, as people there have obtained and solved all kinds of
problems related to the AdviceClient sample in the HF EJB book.
[ March 05, 2004: Message edited by: Vish Kumar ]
I agree. Here's the link:
subject: AdviceClient does not run,very dissapointing
It's not a secret anymore!