• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with page 57. Surprise?!

 
Christer Hedstr�m
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have problem, like so many, with compiling the AdviceClient. I've looked at
the different suggestions but it just won't work.
I do as it says on pg 57 and this is what i get:
AdviceClient.java:4: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:5: package javax.ejb does not exist
import javax.ejb.*;
^
AdviceClient.java:18: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)
^
AdviceClient.java:18: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
PortableRemoteObject.narrow(o, AdviceHome.class)
;
^
AdviceClient.java:21: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
6 errors
 
James Nuzzi
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you need to add the current directory and j2ee.jar to your classpath.
 
Rajnish Bhasin
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Provide the current working directory...the place u r compiling from in the classpath aswell..
 
Christer Hedstr�m
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, apparently my classpath was ok (at some point I added the "." for the current directory but my problem remained) because I got through the compilation with this command-line:
javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClient.java
When I try to run the client I get the "CORBA BAD_OPERATION"-exception but that's another story (I've haven't have time to look at that on the forum).
 
Jai Verma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For the exception go to the following link:
http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html
cheers,
Jai
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic