Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ClassCastException while running first application

 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
i am new to EJBs. i just started reading HF EJB, and tried the example given in 1st chapter in HF book. i was successful to package and deploy the bean. but, on invocation of client application, i am getting ClassCastException.
Can anybody tell me a solution to run the application to success.
Also, book says the jar file and the client application must be in project folder not in classess folder. I tried this first, but was unable to compile client code. so, i moved both client jar file and client application file into classes folder. Here, i was able to compile it successfully but i am unable to run the client application.
Whatever i have done, is it right? if not, please tell me how to do it?

Thanks and Regards,
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Rename the business method getAdvice() to something else as it contain characters that matches with the interface name which cause the bug..
 
Awishek sinha
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this Errata to find errors on HFEjb
http://www.oreilly.com/catalog/hfjejb/errata/hfjejb.confirmed
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
 
KRK Gowda
Ranch Hand
Posts: 132
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried all those things mentioned in errata, but still this exception is persisting.
following is the extract from exception log.

java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PoratableRemoteObject.narrow(Unknown Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at AdviceClient.getMessage (AdviceClient.java:20)
at AdviceClient.main (AdviceClient.java:14)

Please help me to resolve this problem. I am stuck with it from past 1 week

Thanks and Regards,
 
rajareddy annavaarm
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you typecast home object with fully qualified class name(with package).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic