users@jersey.java.net

Re: [Jersey] Jersey Test Framework init failures

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Mon, 02 Aug 2010 10:41:03 +0200

Hello,

you can user client and server logging filter ([1] and [2]), and set jdk
logging to display info messages of
"com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainer"
logger (but there are only simple messages which state starting/stopping
container).

Additionally, you may want to check that port localhost:9998 is not used
(netstat -aln or similar command for your OS).

Or if you can share your code, I can help you with debugging.

Regards,

Pavel

[1]
https://jersey.dev.java.net/nonav/apidocs/1.3/jersey/com/sun/jersey/api/client/filter/LoggingFilter.html
[2]
https://jersey.dev.java.net/nonav/apidocs/1.3/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html



On 7/31/10 3:46 AM, Charley Robinson wrote:
> Howdy-
> Suddenly, one of my jersey webservices is failing to run it's test
> harness from maven. It appears the grizzly container is silently
> failing, leaving an unsatisfying trail of logs:
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running IpAddressJpaTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.133 sec
> Running CidrblockResourceTest
> Jul 30, 2010 6:18:21 PM
> com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory$GrizzlyWebTestContainer
> <init>
> INFO: Creating Grizzly Web Container configured at the base URI
> http://localhost:9998/
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.095
> sec <<< FAILURE!
> Running CidrblockJpaTest
> Tests run: 0, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.01 sec
> ...and so on
>
> Reading the surefire reports just shows a connection refused exception
> -- the request is making it to the local server, but nothing's
> listening as Grizzly never finished start up.
>
> Running the sample app tests such as helloworld-1.3, and even other
> web services we're working on all look fine. We've got similar
> dependencies in pom.xml files for these projects.
>
> Question: Is there any way to get more verbose logging on the Grizzly
> container when running mvn test? I want to figure out why this thing
> is dying (silently).
> Thanks,
> Charley