Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFEJB AdviceClient.java Compilation Error

 
Alfred Harre
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
HFEJB chapter 1, I have deployed Advice bean successfuly but I am having trouble compiling AdviceClient.java

/*---- I am using command ------*/
javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java
/*---- My CLASSPATH is------*/
%CLASSPATH%;
C:\jakarta-tomcat-4.0.1\common\lib\servlet.jar;
C:\jakarta-tomcat-4.0.1\webapps\project\WEB-INF\classes;
C:\j2sdkee1.3.1\lib\j2ee.jar;
C:\projects\advice\classes\
/*--------- ERROR MESSAGE IS *------/
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) PortableRemoteObject.narrow(o, AdviceHom
e.class);
^
AdviceClient.java:18: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHom
e.class);
^
AdviceClient.java:18: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o, AdviceHom
e.class);
^
AdviceClient.java:20: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
 
Galder Zamarre�o
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try typing this:
javac -classpath "{$CLASSPATH};AdviceAppClient.jar" AdviceClient.java
i think the main problem with your compilation is that you use a : instead ;
even though the book uses the : symbol, i have never seen it before as a path separator.
good luck
 
Alfred Harre
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Galder Zamarre�o
thanks a lot I have changed the command but I am still unable to compile and the only error I am left with is

AdviceClient.java:5: package javax.ejb does not exist
import javax.ejb.*;
Any ideas?
I can compile if I copy j2ee.jar in JAVA_HOME/jre/lib/ext but then my server fails to start.
thanks for your help.
Regards
 
Abbu Rahman
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Alfred Harre:
Dear Galder Zamarre�o
AdviceClient.java:5: package javax.ejb does not exist
import javax.ejb.*;
Regards

try putting j2ee.jar in CLASSPATH as u have done for AdviceAppClient.jar.
else (in win2k) add j2ee.jar path to envornment variable CLASSPATH.
hope that helps.
Rafay
 
Alfred Harre
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
j2ee.jar is already in classpath. Please see my very first message.
 
Dale Seng
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'd just forget the classpath and make a batch file that had everything you need, and nothing you didn't need. In other words, don't try and pull-in the OS environment variable for classpath, since that may be part of the problem.
--Dale--
 
Alfred Harre
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dale Seng:
I'd just forget the classpath and make a batch file that had everything you need, and nothing you didn't need. In other words, don't try and pull-in the OS environment variable for classpath, since that may be part of the problem.
--Dale--

Can anybody give me sample batch files BOTH for COMPILE and RUNNING that I would know what is required to run and compile a bean (or this example bean).
This is driving me crazy.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic