users@glassfish.java.net

Re: Embedded GlassFish no EJBContainer available

From: <glassfish_at_javadesktop.org>
Date: Fri, 03 Sep 2010 00:00:42 PDT

Hello Péter, Tim

Péter, how did you hardcode your module path?

I am trying to use Glassfish Embedded Ejb Container form a junit test. I use ant, i don't use maven.

No matter what I do, I always get the "No EJBContainer provider available: no provider names had been found." error.

I tried specifying the all the possible properties I have found on the web, but I had no luck.

  Map properties = new HashMap();
  properties.put(EJBContainer.MODULES, new File("[MyProjectsFolder]/build/classes"));
  properties.put("org.glassfish.ejb.embedded.glassfish.installation.root",
    "/Develop/servers/glassfishv3/glassfish/domains/domain1");
            
  EJBContainer ejbC = EJBContainer.createEJBContainer(properties);
  Context context = ejbC.getContext();

I want have the tests in an EJB project which is a part of an EAR project.

I also tried using OpenEJB which only worked if I have @Local interfaces for my beans, what I don't need, and also CDI (weld) does not work if I have any.

I would really like to use the embedded EJBContainer. Is there a complete guide somewhere about how to set it up without maven?

Any answer is highly appreciated

Best Regards - István
[Message sent by forum member 'szobi']

http://forums.java.net/jive/thread.jspa?messageID=481770