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
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to