• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to run a client?

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to run a client (page :57)from the book"head first EJB" by Kathy Sierra & Bert bates
My problem is when I tried to run the client using the command
C:\projects\advice>javac -classpath {$CLASSPATH}:latClient.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:21: cannot resolve symbol
symbol : class advicehome
location: class adviceclient
advicehome home=(advicehome) PortableRemoteObject.narrow(O,advicehome.class);
^
adviceclient.java:21: cannot resolve symbol
symbol : class advicehome
location: class adviceclient
advicehome home=(advicehome) PortableRemoteObject.narrow(O,advicehome.class);
^
adviceclient.java:21: 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
C:\projects\advice>
can somebody tell me why I am getting this many errors
may be Kathy or Bert can answer easily.
thanks
Pradeep
 
Ranch Hand
Posts: 1066
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

adviceclient.java:5: package javax.ejb does not exist
import javax.ejb.*;
^


You need to have the j2ee classes in your path. Usually they come bundled along with the Application Server. Sun's Ref implementation includes them.These need to be in classpath. I guess U can fix the other java errors....
U can search in the SCBCD forum, and Kathy has explained how to run the client. You can use the JavaRanch's search facility...
http://www.javaranch.com
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a similar problem trying to compile AdviceClient.java. The command line given in Head First EJB is:

I changed this to

and the program then compiled cleanly. I am running on Win2000. Maybe things are different if you are running java from a Unix box. Although I am still getting exceptions when I try to run it
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic