users@jersey.java.net

Re: [Jersey] Any way to get a fine/debug log?

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Wed, 8 Sep 2010 17:35:14 +0200

On Sep 8, 2010, at 4:46 PM, Franco Graziosi wrote:

> Hi,
>
> I am trying to use Jersey under Netbeans 6.10 + Tomcat 6 + Maven. I am
> constantly getting the following error:
>
> java.lang.ClassNotFoundException:
> com.sun.ws.rest.spi.container.servlet.ServletContainer
>

That is a very old (pre 1.0) and now defunct class name for the Jersey
servlet class name, it should be:

   com.sun.jersey.spi.container.servlet.ServletContainer

as described here:

   https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html
#d4e223

Thus it does not matter what logging you enable Jersey will never be
invoked because the wrong Servlet is reference and cannot be found.

What version of Jersey are you using?

For tracing see here:

   http://blogs.sun.com/sandoz/entry/tracing_in_jersey

For logging requests/responses see here:

   https://jersey.dev.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/LoggingFilter.html

Paul.

> I made many attempts with no positive result, with both following
> servlet
> parameters:
>
> (A)
>
> <init-param>
> <param-name>com.sun.jersey.config.property.packages</param-name>
> <param-value>net.cbsolution.x2p.ezrest</param-value>
> </init-param>
>
>
> (B)
>
> <init-param>
> <param-name>javax.ws.rs.Application</param-name>
> <param-value>net.cbsolution.x2p.ezrest.RestApplication</param-value>
> </init-param>
>
>
> What I really can't understand is the message case (B). If I provide
> an
> application that defines which classes to use, why the message?
> Seems Jersey is
> making a scan anyway.
>
> What I would like to know is if there is some way to fine log Jersey
> to
> understand what is going wrong. Also seems my resource paths are not
> recognized.
> I suppose there shall be some way to trace how Jersey perform
> routing but I
> found no documentation about it.
>
> Thanks a lot for any kind of help.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>