users@glassfish.java.net

Re: Running embedded test with multimodule project

From: Marina Vatkina <marina.vatkina_at_oracle.com>
Date: Thu, 17 Jun 2010 16:34:32 -0700

3.0.1 has a problem with the manifest file (3.1 also had it until
today). Add 'Bundle-SymbolicName: org.glassfish.embedded.all' to the
manifest file of the -all.jar.

Add module-name to the ejb-jar.xml for the ejb module(s) and java:global
will a) work and b) not depend on the directory name. You can continue
using java:comp inside your beans, but for the client code only
java:global is supported.

HTH,
-marina

Major Péter wrote:
> 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
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>