users@glassfish.java.net

Re: [Fwd: [embedded] How to unit test an EJB with Maven ?]

From: Antonio Goncalves <antonio.mailing_at_gmail.com>
Date: Tue, 22 Sep 2009 22:28:48 +0200

Hum... I need a full GlassFish distribution ? Isn't this jar is the GF Maven
repository ? At the moment I'm using :
 <dependency>
            <groupId>org.glassfish</groupId>
            <artifactId>javax.ejb</artifactId>
            <version>3.0-b64</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.ejb</groupId>
            <artifactId>ejb-container</artifactId>
            <version>3.0-b64</version>
        </dependency>

Antonio

2009/9/22 Alexis Moussine-Pouchkine <alexis.mp_at_sun.com>

> glassfish/lib/embedded/glassfish-embedded-static-shell.jar is your friend.
> Requires full GlassFish distribution. No properties required.
> -Alexis
>
>
> On Sep 22, 2009, at 21:54, Antonio Goncalves wrote:
>
> Hi,
>>
>> I'm still trying to make the EJBContainer work in a test environment. I'm
>> using the latest GlassFish build (3.0-b64) but this time I have other
>> exceptions :
>>
>>
>> Exception in thread "main" javax.ejb.EJBException: No EJBContainer
>> provider available
>> Provider named org.glassfish.ejb.embedded.EJBContainerProviderImpl threw
>> unexpected exception at create EJBContainer:
>> java.lang.NoSuchMethodError
>> java.lang.NoSuchMethodError:
>> javax.ejb.spi.EJBContainerProvider.createEJBContainer(Ljava/util/Map;)Ljavax/ejb/embeddable/EJBContainer;
>> at
>> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
>> at
>> javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:78)
>>
>>
>> In my code I do the following :
>>
>> EJBContainer ec = EJBContainer.createEJBContainer();
>> Context ctx = ec.getContext();
>> BookService bookEJB = (BookService) ctx.lookup("java:global/BookService");
>>
>> book = bookEJB.createBook(book);
>>
>>
>> I call the createEJBContainer() method but I was wondering if I should
>> pass some properties with the createEJBContainer(Map <?,?>) method.
>>
>> Any idea ?
>>
>> Thanks,
>> Antonio
>>
>> 2009/9/7 <glassfish_at_javadesktop.org>
>> I also read Antonio's book :)
>>
>> @Antonio: do you have any news on this? Did you get to have a working
>> method to unit test EJBs ?
>>
>> Regards,
>> J.
>> [Message sent by forum member 'jayeff' (jforns_at_gmail.com)]
>>
>> http://forums.java.net/jive/thread.jspa?messageID=363119
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>>
>>
>>
>>
>> --
>> --
>> Antonio Goncalves (antonio.goncalves_at_gmail.com)
>> Software architect
>>
>> Web site : www.antoniogoncalves.org
>> Blog: agoncal.wordpress.com
>> Feed: feeds2.feedburner.com/AntonioGoncalves
>> Paris JUG leader : www.parisjug.org
>> LinkedIn: www.linkedin.com/in/agoncal
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: users-help_at_glassfish.dev.java.net
>
>


-- 
--
Antonio Goncalves (antonio.goncalves_at_gmail.com)
Software architect
Web site : www.antoniogoncalves.org
Blog: agoncal.wordpress.com
Feed: feeds2.feedburner.com/AntonioGoncalves
Paris JUG leader : www.parisjug.org
LinkedIn: www.linkedin.com/in/agoncal