quality@glassfish.java.net

Re: Unit testing EJB modules with GlassFish Embeddable

From: Richard Kolb <rjdkolb_at_gmail.com>
Date: Wed, 6 Jan 2010 10:09:20 +0200

Hi Wouter

2010/1/6 Wouter van Reeven <wouter_at_van.reeven.nl>

>
> On Wed, Jan 06, 2010 at 08:21:48AM +0200, Richard Kolb wrote:
> > You pom.xml does not have a
> > <dependency>
> > <groupId>javax</groupId>
> > <artifactId>javaee-api</artifactId>
> > <version>6.0</version>
> > <scope>provided</scope>
> > </dependency>
> >
> > Where does the 'import javax.ejb.Stateless;' come from for example ?
>
>
> From glassfish-embedded-all
>

Ah, ok. Was wondering how you got it compiled :)


>
> > Your packaging is also 'jar' should that not be 'ejb' ?
>
> Personally I don't see how the packaging influences running the app.
> What does a packaging 'ejb' mean?


Oh, in your project change <packaging>jar</packaging> to
<packaging>ejb</packaging> and bob's your aunty it's a EJB packaging.



> And isn't the whole point of this
> exercise to have GlassFish running outside an ejb environment?
>

Um, yes and no.
You would want to run the application without stating a entire glassfish but
it's a EJB module I am writing and I need to deploy to production so that's
why I spec EJB.

Cool, did not know you could do it with JAR packaging and get it working.
Thought it would need to be EJB or WAR


regards
Richard.