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

AdviceClient Compile Error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry if I ask a stupid question. I am new for EJB and J2EE. I have spend almost 6 months on this topics but still confused. I try to run an example in Head First EJB and hope it helps me to solve my confusion. I have downloaded the sample code (Advice guy bean) and follow step by step. Everything went well until the last two final steps. It kept showing the error.

I type to Dos Command line
H:\projects\Advice>javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java
AdviceClient.java:4: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:5: package javax.ejb does not exist
import javax.ejb.*;
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHo
me.class);
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHo
me.class);
^
AdviceClient.java:19: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHo
me.class);
^
AdviceClient.java:20: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
6 errors
then I just put AdviceClient.class directly to the same directory as AdviceAppClient.jar
and run
H:\projects\Advice>java -cp {$CLASSPATH}:AdviceAppClient.jar AdviceClient
Exception in thread "main" java.lang.NoClassDefFoundError: AdviceClient
What have I done incorrectly?
Please help me!
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks lord, I am not the only one stuck on this problem and this is driving me crazy.
You might wana see my thread HFEJB AdviceClient.java Compilation Error started just few hours before your this thread

Long story in short, command given in book is good for Linux. But for windows, you have to change it to
javac -classpath "{$CLASSPATH};AdviceAppClient.jar" AdviceClient.java
or try this
javac -classpath "%CLASSPATH%;AdviceAppClient.jar" AdviceClient.java
(Please note ; (semicolon) instead of a colon( : ) , qutoes, and %)
With this change I am amble to compile but stuck at running the example.
[ May 03, 2004: Message edited by: Alfred Harre ]
 
Phirun Phung
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much! Alfred. It works now. You just save my life. I stuck to this poing almost 2 days.
Thanks again!
 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Alfred
I have some problem .Can u helpme out plz look at this link
::
https://coderanch.com/t/159249/java-EJB-SCBCD/certification/run-ee-Server
Thanks
Sam
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic