File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
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
Author

AdviceClient does not run,very dissapointing

Loukas G
Greenhorn

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() {
try
{
Context ic = new InitialContext();
Object o = ic.lookup("Advisor");
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHome.class);
Advice advisor = home.create();
System.out.println(advisor.getAdvice());
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
}
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
Greenhorn

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: 1064
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: http://aspose.com/file-tools
 
subject: AdviceClient does not run,very dissapointing
 
Similar Threads
Problem while Running First Example Of HFEJB.
Error running AdviceClient
headfirst AdviceClient throws NoClassDefFound exception
Head First Ejb -- Sample Program Exception
Can't run the Client program - of HFE -- HELP -- Urgent