Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

HFEJB AdviceClient.java Compilation Error

 
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();
^
 
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
 
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.
 
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic