File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 Problems Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 Problems" Watch "EJB 3.0 Problems" New topic
Author

EJB 3.0 Problems

Mark Spangler
Greenhorn

Joined: Feb 21, 2006
Posts: 1
I'm trying to create this simple EJB 3.0 test and I keep getting a java.lang.ClassCastException when I do the InitialContext lookup. I'm using Java 1.5 with JBoss 4.0.4RC1.

The error I get is:


My Client Class:

My Remote Class:

My Bean Class:
Mike Henry
Greenhorn

Joined: Dec 18, 2003
Posts: 6
As Your client is remote cyou will need to narrow the
result here


Try instead


It might be helpful..


Mike H


:-D People who smile, do it 'cause they know something, To Learn what... do as they do.
Mike Henry
Greenhorn

Joined: Dec 18, 2003
Posts: 6
oops

Typing way too fast for my own (or your )good

It should say ...


Sorry..
Mike H
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Mike,

Mark is using EJB 3.0

There is no narrowing in EJB 3.0.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

Just out of curiosity.

Try removing the "(name="MyBean")" and let it bind to JNDI with the class name instead of naming it.

Then look it up with

(TestRemote)ctx.lookup("TestBean");

Mark
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3.0 Problems
 
Similar Threads
Exception during calling a entity bean from a standalone client
Calling EJB From the Client
Session bean , Local and Remote interface with answer.
ejb 3.0,jboss 4.2.2 netbeans 6.0.1
Client for Calling a Entity Bean