This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of The Career Toolkit and have Mark Herschberg on-line!
See this thread for details.
Win a copy of The Career Toolkit this week in the Jobs Discussion 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
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

AdviceClient compiler error in HFE

 
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using windowsXP.
When I compile AdviceClient with the command
javac -classpath {$CLASSPATH}:AdviceClient.jar AdviceClient.java I get the following error
AdviceClient.java:4: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:5: package javax.ejb does not exist
import javax.ejb.*;
^
AdviceClient.java:20: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home=(AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class)
^
AdviceClient.java:20: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home=(AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class)
^
AdviceClient.java:20: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home=(AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class)
^
AdviceClient.java:22: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor=home.create();
^
6 errors
And when I compile AdviceClient with the command javac AdviceClient.java it compiles fine even when I have not included the AdviceAppClient.jar in classpath.
Do I need to compile AdviceClient by including AdviceAppClient.jar inorder to run it successfully?
Has anybody compiled and ran AdviceBean example from HFE book successfully?
Thanks
Veena
[ February 08, 2004: Message edited by: Veena Point ]
 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Veena,
It looks that your classpath setting has some problem. We all got this errors and they have been solved successfully.
Check on
http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html
And see my earlier post on this example headed by -
head first ejb pg:57 client problem!!!please help urgent
Make sure that you have folder structure as described in the book and you have added * j2ee.jar * in the classpath setting.
Hope this helps.

Thanks,
Jayant
[ February 09, 2004: Message edited by: Jayant Kulkarni ]
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jsdk1.4 .If I compile using the command
javac -classpath %CLASSPATH%;adviceappClient.jar adviceclient.java
I am getting following
javac: invalid flag: and
Usage: javac <options> <source files>
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing
-deprecation Output source locations where deprecated APIs are us
ed
-classpath <path> Specify where to find user class files
-sourcepath <path> Specify where to find input source files
-bootclasspath <path> Override location of bootstrap class files
-extdirs <dirs> Override location of installed extensions
-d <directory> Specify where to place generated class files
-encoding <encoding> Specify character encoding used by source files
-source <release> Provide source compatibility with specified release
-target <release> Generate class files for specific VM version
-help Print a synopsis of standard options
My path and classpath settings are
PATH
C:\WINDOWS;C:\Program Files\SSH Communications Security\SSH Secure Shell;C:\j2sdkse1.4.1\bin;C:\j2sdkee1.3\bin
CLASSPATH
.;C:\j2sdkee1.3\lib\j2ee.jar;C:\veena\projects\advice\classes;C:\tomcat5.0\common\lib\servlet-api.jar;C:\Documents and Settings\VEENA\commons-collections.jar;C:\Documents and Settings\VEENA\commons-beanutils.jar;C:\Documents and Settings\VEENA\commons-logging.jar;C:\Documents and Settings\VEENA;
I don't see anything wrong in classpath settings.Please can somebody help me in finding out the problem?It has been already 4th day I am living with this problem.
Veena
[ February 09, 2004: Message edited by: Veena Point ]
 
Veena Pointi
Ranch Hand
Posts: 469
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Atlast I solved compiletime problem.As always it was classpath problem.In my classpath the folder called Documents And Settings was creating the problem due to the space...Servlets were working well.But I faced problem with EJB's.
Thanks to all.
Veena
[ February 09, 2004: Message edited by: Veena Point ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic