users@jersey.java.net

[Jersey] Glassfish embedded server does not start in junit tests after upgrading to 1.6

From: Pierre Radermecker <pradermecker_at_yahoo.ca>
Date: Mon, 16 May 2011 08:39:15 -0700 (PDT)

Hi,

Since the 1.6 Jersey upgrade (from 1.5), I have the following error message
while I try to run my tests (using "jersey-test-framework-embedded-glassfish")


Caused by: org.glassfish.embeddable.GlassFishException: Already bootstrapped
    at
org.glassfish.embeddable.GlassFishRuntime._bootstrap(GlassFishRuntime.java:150)
    at
org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:106)
    at
org.glassfish.embeddable.GlassFishRuntime.bootstrap(GlassFishRuntime.java:80)
    at
com.sun.jersey.test.framework.spi.container.embedded.glassfish.EmbeddedGlassFishTestContainerFactory$EmbeddedGlassFishTestContainer.instantiateServer(EmbeddedGlassFishTestContainerFactory.java:258)

    ... 33 more

Here is my pom entry (${jerseyVersion} is 1.6):

        <dependency>
            <groupId>com.sun.jersey.jersey-test-framework</groupId>
            <artifactId>jersey-test-framework-embedded-glassfish</artifactId>
            <version>${jerseyVersion}</version>
            <scope>test</scope>
        </dependency>

Any ideas ?

Thanks for your help,

- Pierre