This content has been marked as final.
Show 1 reply
-
1. Re: EJB lookup after deploying to Jboss
rmcdonough Jan 21, 2007 11:21 AM (in response to richard.luo)It would be a bit more helpful if provided the stack trace of the error you are getting. But part of the problem is that you're assuming you'll be getting back you bean class, which you will not. With your HelloWorldBean, you should have a corresponding HelloWorld interface marked with an @Remotae annotation. Then your code should read:
InitialContext ic = new InitialContext(); HelloWorld hw = (HelloWorld) ic.lookup("HelloWorldBean/remote");
That would be the proper way to write your code. Otherwise, you'll get a ClassCastException.
Ryan-