[jboss-user] [EJB 3.0] - test on ejb3 with junit by eclipse

folal do-not-reply at jboss.com
Thu Aug 6 04:13:36 EDT 2009


Dear all,

I want to write JUnit Tests for my EJB3.0 SessionBeans. How do I access the
application server?

InitialContext ctx = new InitialContext(); bean = (BeanInterface) ctx.lookup("...");

does not work since the initial context cannot be resolved
(javax.naming.NoInitialContextException: Need to specify class name in
environment or system property, or as an applet parameter, or in an application
resource file: java.naming.factory.initial).

Obvoiusly, for the same reason, dependency injection doesn't work either: @EJB BeanInterface bean;

What do I have to do?

Best regards 
Alan

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

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



More information about the jboss-user mailing list