• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

AdviceClient Compile Error

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic