users@glassfish.java.net

Re: Embedded GlassFish no EJBContainer available

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Fri, 03 Sep 2010 10:20:46 +0200

Hi,

my source code (for Maven) is available at
http://stewie.sch.bme.hu/gitweb/?p=aldaris/korok;a=tree;f=sch-pek-test/src/main/java/hu/sch/test/base;h=79d07f721ad29b25ab5747a6e3128d8fd666329d;hb=HEAD

you should see another error messages prior to failed startup, what is
it? We have builded by hand an own embedded a few months ago, it is
available at
http://stewie.sch.bme.hu/nexus/content/repositories/thirdparty/org/glassfish/extras/glassfish-embedded-all/3.1-STABLE/glassfish-embedded-all-3.1-STABLE.jar
. It is more or less stable, since it creates 'null' named directories,
but that's all the problem we had with it. Can you try with this? GF
trunk is a bit messy, and time-to-time there are buggy snapshots :( .

Also you need to make sure, that only one EJB container is created in a
single JVM (check out ContainerHolder singleton).

Regards,
Peter

2010-09-03 09:00 keltezéssel, glassfish_at_javadesktop.org írta:
> 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