[jboss-user] [EJB3] - Test EJB3 using Junit 4 in Glassfish 3.1.1

Sharma Ragav do-not-reply at jboss.com
Sat Jul 6 03:18:31 EDT 2013


Sharma Ragav [https://community.jboss.org/people/ragav] created the discussion

"Test EJB3 using Junit 4 in Glassfish 3.1.1"

To view the discussion, visit: https://community.jboss.org/message/826697#826697

--------------------------------------------------------------
Hi,
I am using Glassfisg 3.1.1 server and test EJB3 class using junit4.
Below are the code written in setUp() in test class.

Getting below exception:
javax.ejb.EJBException: No EJBContainer provider available: no provider names had been found.
 at javax.ejb.embeddable.EJBContainer.reportError(EJBContainer.java:216)
 at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:146)
 at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)

@Before
 public void setUp() throws Exception {
  System.out.println("Inside setUp");
    InitialContext context = null;
  Properties prop = new Properties();
  prop.put("org.glassfish.ejb.embedded.glassfish.instance.root",
        "");
  prop.put(EJBContainer.MODULES, new File("/classes/"));
  EJBContainer container =EJBContainer.createEJBContainer();
  settingEJB = (SettingsBean) container.getContext().lookup("java:global/SettingsEJB");
 }

Added glassfish-embedded-static-shell.jar in classpath.
Anything missed?
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/826697#826697]

Start a new discussion in EJB3 at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2029]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20130706/cef9f3f7/attachment.html 


More information about the jboss-user mailing list