dev@jersey.java.net

jsersey on tomcat

From: alberto <algo.idv_at_libero.it>
Date: Mon, 31 Mar 2008 19:38:40 +0200

Thanks for your help.

I am not trying with curl also because I don't know what it is ;), but
the browser is performing a simple GET over the address, so why should
work different with curl?

This is the web.xml I'm using:

<?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
    version="2.5">

    <servlet>
        <servlet-name>jersey</servlet-name>

<servlet-class>com.sun.ws.rest.impl.container.servlet.ServletAdaptor</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>jersey</servlet-name>
        <url-pattern>/resources/*</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>30</session-timeout>
    </session-config>
</web-app>

I am hitting /resources/user URL.

I could put my "hello world" application in some free SVN repository if
you can't find the mistake and if you have time to check (it's managed
by maven so it's immediate to compile and package the war).

I also turned on the Jersey logger, and this is the response:

INFO: Starting service Catalina
31-mar-2008 17.26.54 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.14
31-mar-2008 17.26.54 org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive prova-jsersey.war
31-mar-2008 17.26.54 com.sun.ws.rest.api.core.ClasspathResourceConfig init
INFO: Scanning for root resource and provider classes in the paths:
  /usr/local/tomcat/webapps/prova-jsersey/WEB-INF/lib
  /usr/local/tomcat/webapps/prova-jsersey/WEB-INF/classes
31-mar-2008 17.26.55 com.sun.ws.rest.api.core.ClasspathResourceConfig init
INFO: Root resource classes found:
  class jserseyprova.UserResource
31-mar-2008 17.26.55 com.sun.ws.rest.api.core.ClasspathResourceConfig init
INFO: Provider classes found:
  class com.sun.ws.rest.impl.container.servlet.JSPTemplateProcessor
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Searching for providers that implement: interface
javax.ws.rs.ext.MessageBodyReader
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, javax/mail/MessagingException, of the
class com.sun.ws.rest.impl.provider.entity.MimeMultipartProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, com/sun/syndication/io/FeedException, of
the class com.sun.ws.rest.impl.provider.entity.AtomFeedProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, com/sun/syndication/io/FeedException, of
the class com.sun.ws.rest.impl.provider.entity.AtomEntryProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, org/codehaus/jettison/json/JSONException,
of the class com.sun.ws.rest.impl.provider.entity.JSONArrayProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, org/codehaus/jettison/json/JSONException,
of the class com.sun.ws.rest.impl.provider.entity.JSONObjectProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyReader is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.StringProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.ByteArrayProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.FileProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.InputStreamProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.DataSourceProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.FormURLEncodedProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.XMLJAXBElementProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.JSONJAXBElementProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Searching for providers that implement: interface
javax.ws.rs.ext.MessageBodyWriter
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, javax/mail/MessagingException, of the
class com.sun.ws.rest.impl.provider.entity.MimeMultipartProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyWriter is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, com/sun/syndication/io/FeedException, of
the class com.sun.ws.rest.impl.provider.entity.AtomFeedProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyWriter is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, com/sun/syndication/io/FeedException, of
the class com.sun.ws.rest.impl.provider.entity.AtomEntryProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyWriter is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, org/codehaus/jettison/json/JSONException,
of the class com.sun.ws.rest.impl.provider.entity.JSONArrayProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyWriter is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55
com.sun.ws.rest.spi.service.ServiceFinder$AbstractLazyIterator hasNext
AVVERTENZA: A dependent class, org/codehaus/jettison/json/JSONException,
of the class com.sun.ws.rest.impl.provider.entity.JSONObjectProvider
implementing the provider interface javax.ws.rs.ext.MessageBodyWriter is
not found. The provider implementation is ignored.
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.StringProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.ByteArrayProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.FileProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.InputStreamProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.DataSourceProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.FormURLEncodedProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.XMLJAXBElementProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.provider.entity.JSONJAXBElementProvider
31-mar-2008 17.26.55 com.sun.ws.rest.impl.application.MessageBodyFactory
getProviderMap
CONFIG: Provider found: class
com.sun.ws.rest.impl.template.ViewableMessageBodyWriter
31-mar-2008 17.26.55
com.sun.ws.rest.impl.modelapi.annotation.IntrospectionModeller
createResource
FINISSIMO: A new abstract resource created by IntrospectionModeler:
AbstractResource("/user", - UserResource: 1 res methods, 0 subres
methods, 0 subres locators )
31-mar-2008 17.26.55
com.sun.ws.rest.impl.modelapi.annotation.IntrospectionModeller
createResource
FINISSIMO: A new abstract resource created by IntrospectionModeler:
AbstractResource(WadlResource: 1 res methods, 0 subres methods, 0 subres
locators )
31-mar-2008 17.26.55 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
31-mar-2008 17.26.55 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
31-mar-2008 17.26.55 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31 config=null
31-mar-2008 17.26.55 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1141 ms


The problem is that when I hit the URL the page is blank and anything
happen in the log file!

Thanks a lot!

Alberto Gori