[jboss-user] [EJB 3.0] - Re: EJB3: StandardWrapper.Throwable
jaikiran
do-not-reply at jboss.com
Wed Sep 26 05:01:05 EDT 2007
anonymous wrote : private TestStatelessBean statelessBean;
|
| public void init() {
| try {
| InitialContext ctx = new InitialContext();
| statelessBean = (TestStatelessBean) ctx.lookup("TestStatelessBean/remote");
|
| } catch (NamingException e) {
| e.printStackTrace();
| }
| }
Change the code to cast the returned object to the interface instead of the bean implementation class:
private TestStateless statelessBean;
|
| public void init() {
| try {
| InitialContext ctx = new InitialContext();
| statelessBean = (TestStateless) ctx.lookup("TestStatelessBean/remote");
|
| } catch (NamingException e) {
| e.printStackTrace();
| }
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4088715#4088715
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4088715
More information about the jboss-user
mailing list