Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EJB 3.0 Problems

 
Mark Spangler
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Your client is remote cyou will need to narrow the
result here


Try instead


It might be helpful..


Mike H
 
Mike Henry
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oops

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

It should say ...


Sorry..
Mike H
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mike,

Mark is using EJB 3.0

There is no narrowing in EJB 3.0.

Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic