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

headfirst ejb AdviceClient problem

Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
New to EJB here.I am trying to run the AdviceClient problem from HeadFirst EJB book and I am getting a ClassCastException with the following code. I was able to deploy the bean and I am trying to run the client test from command line.

Context ic = new InitialContext();
Object o = ic.lookup("Advisor");
**** AdviceHome home = (AdviceHome) PortableRemoteObject.narrow(o,AdviceHome.class);
Advice advisor = home.create();

I am getting exception on the line PortableRemoteObject.narrow......

In other words how do I
1.Select the service provider of the corresponding service I want to access.
2.Specify any configuration that the initial context needs.

I am trying to run a client from command line in order to test a stateless session bean as given in HeadFirstEJB ( AdviceClient.java)

I am using j2sdkee1.3.1 from Sun.

Thanks in advance
[ May 07, 2005: Message edited by: Mat Matthew ]
Farmers know to never drive a tractor near a honey locust tree. But a tiny ad is okay:
a bit of art, as a gift, that will fit in a stocking
    Bookmark Topic Watch Topic
  • New Topic