*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Need Help with AdviceHome (from Head First EJB) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Need Help with AdviceHome (from Head First EJB)" Watch "Need Help with AdviceHome (from Head First EJB)" New topic
Author

Need Help with AdviceHome (from Head First EJB)

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello,

I am running the J2EE 1.3 Reference Implementation under WinXP. I have the following directory structure:

F:\Java Projects\J2EE Projects\Advice\

underneath the Advice directory, I have the following 3 subdirectories:

<src>
<dist>
<cls>

I followed everything that the book wanted me to do and now I am stuck on the point where you compile the client app.

The AdviceAppClient.jar & AdviceApp.ear are in the <dist> subdirectory.

All the interpreted bytecode (.class files) are in the <cls> subdirectory.

The AdviceClient.java file is in the <src> directory.

Now, when I tried to compile the AdviceClient.java file like this:


F:\Java Projects\J2EE Projects\Advice\src>javac -classpath %CLASSPATH%;..\dist\AdviceAppClient.jar;..\cls AdviceClient.java
AdviceClient.java:19: cannot access AdviceHome
bad class file: .\AdviceHome.java
file does not contain class AdviceHome
Please remove or make sure it appears in the correct subdirectory of the classpath.
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o, AdviceHome.class);
^
1 error

Does anyone understand what's going on?

With thanks,
Natarajan Shankar
Ranch Hand

Joined: Jun 10, 2004
Posts: 53
Hello,
Can you make sure your CLASSPATH variable contain current path or append as CLASSPATH=%CLASSPATH%;.; as your AdbiceHome is in ...src/ directory which might miss in your classpath.

Shankar


Best Regards<br />N.Shankar<br />SCJP, SCWCD
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Shankar,

I just tried:

F:\Java Projects\J2EE Projects\Advice\src>javac -d ..\cls -classpath
%CLASSPATH%;.;..\dist\AdviceAppClient.jar;.;..\cls AdviceClient.java

AdviceClient.java:19: cannot access AdviceHome
bad class file: .\AdviceHome.java
file does not contain class AdviceHome

Please remove or make sure it appears in the correct subdirectory of the classpath.
AdviceHome home = (AdviceHome)PortableRemoteObject.narr
ow(o, AdviceHome.class);
^
1 error

I am still unable to compile the AdviceClient.java file.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Need Help with AdviceHome (from Head First EJB)
 
Similar Threads
Problem compiling simple standalone client for EJB.
Error while compiling
Error compiling the AdviceClient.java
CORBA BAD_OPERATION
AdviceClient Compile Error