users@glassfish.java.net

Re: Running embedded test with multimodule project

From: Major Péter <majorpetya_at_sch.bme.hu>
Date: Fri, 18 Jun 2010 01:22:32 +0200

Thanks, that was it!!
The new problem:
Running the simple test with glassfish-embedded-all:3.0 results:
INFO: Portable JNDI names for EJB UserManagerBean :
[java:global/classes/UserManagerBean,
java:global/classes/UserManagerBean!hu.sch.services.UserManagerLocal]

which is good, but I can't access my EJB with
ic.lookup("UserManagerBean") nor ic.lookup("java:comp/env/UserManagerBean").

When I run the tests with 3.0.1 I always get:
INFO: [EJBContainerProviderImpl] Cleaning up on failure ...
java.lang.AssertionError
        at org.jvnet.hk2.config.Dom.<init>(Dom.java:153)
        at org.jvnet.hk2.config.ConfigBean.<init>(ConfigBean.java:81)
        at
org.glassfish.config.support.GlassFishConfigBean.<init>(GlassFishConfigBean.java:81)

And when I run the tests with 3.1-SNAPSHOT (recent build from svn):
INFO: Portable JNDI names for EJB UserManagerBean :
[java:global/spring-ldap-core-1.3.0.RELEASE/UserManagerBean,
java:global/spring-ldap-core-1.3.0.RELEASE/UserManagerBean!hu.sch.services.UserManagerLocal]

so the JNDI name is totally messed up, and it's absolutely transient,
since for the next build it will be the jta.jar and so on from random
point of the classpath..

I think I stay with 3.0, hopefully using the global JNDI name I will not
have more issues...

Thanks again Marina,
Peter

//the persistence.xml was intentional, but didn't had much influence so
I'm controlling the used database from domain.xml instead.

2010-06-17 23:39 keltezéssel, Marina Vatkina írta:
> You have META-INF/ejb-jar.xml in that dir, which makes it an EJB module.
> And in the /tmp/ejb-app* it's copied over with _jar suffix, i.e. from
> initial asserion it *was* considered an EJB module (but initial sorting
> is very preliminary - it doesn't match ejb-jar.xml content, just looks
> for its existance).
>
> Unless persistence.xml is there on purpose, remove META-INF dir altogether.
>
> Best,
> -marina