my dog learned polymorphism*
The moose likes EJB and other Java EE Technologies and the fly likes Error casting looked up ejb Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Error casting looked up ejb" Watch "Error casting looked up ejb" New topic
Author

Error casting looked up ejb

Jeffrey Coleman
Greenhorn

Joined: May 25, 2012
Posts: 23
I'm just trying to get a working example up. I am using rad and running this on the built in websphere server version seven. The app that I am eventually going to be developing with EJBs will be using JEE5 so I cannot use the @EJB annotation outside of the container so I am learning how to do the lookup.

The error msg that I get is this:

Error 500: java.lang.ClassCastException: ejb.EJSLocal0SLHelloEJB_9fbc1047 incompatible with ejb.HelloEJB

Here is the code for the servelet



And here is the web.xml



This is the EJB



And here is the local interface



Any help would be much appreciated. Thanks in advance.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30789
    
157

Does it work if you cast to HelloEJBLocal? The idea of the interfaces is to refer to them rather than bean implementation.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Jeffrey Coleman
Greenhorn

Joined: May 25, 2012
Posts: 23
Yes that works. Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error casting looked up ejb