[jboss-user] [EJB 3.0] - Re: @EJB injection gives null

kgrjb do-not-reply at jboss.com
Sun Sep 3 02:42:28 EDT 2006


peter suggestion didnot help.

ive been using this as a workaround.

LocalIntf ejbField;

    @PostConstruct
    public void initBean() {
        try {
            InitialContext ctx = new InitialContext();
            ejbField = ejbField == null ? (LocalIntf) ctx.lookup("earName" + "/beanClassName" + "/local") : ejbField;
        } catch (NamingException e) {
            // do whatever
        }
    }

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

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



More information about the jboss-user mailing list