users@jersey.java.net

[Jersey] Re: Jersey test framework using embedded glassfish

From: Pavel Bucek <pavel.bucek_at_oracle.com>
Date: Tue, 29 Mar 2011 11:43:36 +0200

Hello,

not sure what is missing or actually what do you have on classpath.

Following should be sufficient:

[INFO] --- maven-dependency-plugin:2.1:tree (default-cli) @
jersey-test-framework-embedded-glassfish ---
[INFO]
com.sun.jersey.jersey-test-framework:jersey-test-framework-embedded-glassfish:jar:1.7-SNAPSHOT
[INFO] +- org.glassfish.extras:glassfish-embedded-all:jar:3.1:compile
[INFO] \-
com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.7-SNAPSHOT:compile
[INFO] +- org.glassfish:javax.servlet:jar:3.0:compile
[INFO] +- junit:junit:jar:4.8.2:compile
[INFO] +- com.sun.jersey:jersey-server:jar:1.7-SNAPSHOT:compile
[INFO] | +- asm:asm:jar:3.1:compile
[INFO] | \- com.sun.jersey:jersey-core:jar:1.7-SNAPSHOT:compile
[INFO] \- com.sun.jersey:jersey-client:jar:1.7-SNAPSHOT:compile

(mvn dependency:tree on jersey-test-framework-embedded-glassfish)

Regards,
Pavel

On 3/28/11 6:49 PM, NBW wrote:
> Hi folks,
>
> I'm trying to use the embedded glassfish test container in my
> non-maven project with Jersey 1.5 & GF3.1 by specifying
> -Djersey.test.containerFactory=com.sun.jersey.test.framework.spi.container.embedded.glassfish.EmbeddedGlassFishTestContainerFactory
> but I must be missing a dependency. When I run my test I get the
> following exception:
>
> java.lang.NoClassDefFoundError: org/glassfish/embed/EmbeddedException
> at
> com.sun.jersey.test.framework.spi.container.embedded.glassfish.EmbeddedGlassFishTestContainerFactory.create(EmbeddedGlassFishTestContainerFactory.java:82)
> at
> com.sun.jersey.test.framework.JerseyTest.getContainer(JerseyTest.java:338)
> at
> com.sun.jersey.test.framework.JerseyTest.<init>(JerseyTest.java:213)
> at
> com.sun.jersey.test.framework.JerseyTest.<init>(JerseyTest.java:231)
>
> Can anyone point me in the right direction?
>
> Thnx,
>
> -Noah