aspose file tools*
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
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Error casting looked up ejb" Watch "Error casting looked up ejb" New topic

Error casting looked up ejb

Jeffrey Coleman

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
internet detective

Joined: May 26, 2003
Posts: 29261

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

Joined: May 25, 2012
Posts: 23
Yes that works. Thank you.
subject: Error casting looked up ejb
Similar Threads
jsp-property-group error in web.xml
getting error when deploying web app in weblogic 10.0
ejb3 with javaee client helloworld
Getting error while upgrading my running application from jboss-4.2.1.GA to jboss-6.0.0.Final.
Help executing an EJB persistence application