my dog learned polymorphism*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Error while compiling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Error while compiling" Watch "Error while compiling" New topic
Author

Error while compiling

Johnson Jose
Greenhorn

Joined: May 19, 2004
Posts: 19
Hi All,

I am getting the following error while running the client code.
-------------------------------- Start -----------------------------
F:\Java\ejb\HF_EJB\projects\advice>javac -classpath {$CLASSPATH}:AdviceAppClient.jar AdviceClient.java
AdviceClient.java:14: package headfirst does not exist
import headfirst.*;
^
AdviceClient.java:17: package javax.ejb does not exist
import javax.ejb.*;
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:34: cannot resolve symbol
symbol : class AdviceHome
location: class AdviceClient
AdviceHome home = (AdviceHome)PortableRemoteObject.narrow(o,AdviceHome.class);
^
AdviceClient.java:35: cannot resolve symbol
symbol : class Advice
location: class AdviceClient
Advice advisor = home.create();
^
6 errors
------------------------------- End --------------------------------

I have the projects\advice\classes\headfirst directory structure.
and my AdviceAppClient.jar in the projects\advice directory.

I am not sure why it is not able to locate my headfirst package.
Please help me.

Regards
Johnson
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
I'm not going to bother giving you all the specific information, but basically you aren't setting up your classpath correctly to include those JARs that container all the necessary things. Also, make sure your j2ee.jar is included in your classpath.

You may want to search the forum for past posts on this topic, which seem to come up on average once every 12 minutes.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Error while compiling
 
Similar Threads
help!: AdviceClient.java does not compile
AdviceClient compiler error in HFE
problem on hfejsb page 57
Error compiling the AdviceClient.java
Getting compile error for AdviceClient.java from Head First EJB