[jboss-user] [EJB 3.0] - Re: Accessing stateless EJB3 bean from a WAR

michael.litherland do-not-reply at jboss.com
Mon Jul 21 16:05:07 EDT 2008


I almost hate to point this out because it might confuse things, but if I don't use the EJB injection I can get things to work:


  |     // @EJB(name="java:comp/env/ejb/MyBean")
  |     private MyBeanRemote mbr;
  | 
  |     private Logger logger = Logger.getLogger(MainForm.class.getSimpleName());
  |     
  |     public MainForm() {
  |         try {
  |             Context c = new InitialContext();
  |             Object obj = c.lookup("jnp://localhost:1099/custom/remote/MyBean");
  |             mbr = (MyBeanRemote) PortableRemoteObject.narrow(obj, 
  |                     MyBeanRemote.class);
  |         } catch (NamingException e) {
  |             logger.log(Level.SEVERE, "Naming Exception", e);
  |         }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4165742#4165742

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4165742



More information about the jboss-user mailing list