• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

headfirst ejb AdviceClient problem

 
Greenhorn
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();
System.out.println(advisor.getMessage());


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
Matt
[ May 07, 2005: Message edited by: Mat Matthew ]
 
I'm all tasted up for a BLT! This tiny ad wants a monte cristo!
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic