users@jersey.java.net

[Jersey] Re: [Jersey-issues] Jersey deployment on WebSphere

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Wed, 23 Mar 2011 22:10:07 +0100

Hi Dilip,

The other sub-resource method looks fine.
What do you get from:

http://localhost:9081/RestTest/rest/application.wadl

?

Just in case: are you sure you properly re-deployed the application
after adding the new method? Could you please try to manually
un-deploy/deploy the application?

~Jakub


On 03/23/2011 09:14 PM, Marek Potociar wrote:
> Redirecting to Jersey users mailing list...
>
> On 03/23/2011 12:27 PM, Dilip G Champaneri wrote:
>> I am new to Jersey/REST. I am trying to test simple application with Jersey 1.5 on WebSphere 7. Basic hello world
>> works, but sub-resource request fails.
>>
>> I get successful response when I point to: http://localhost:9081/RestTest/rest/helloworld. But I get 404 error when I
>> point to:
>>
>> http://localhost:9081/RestTest/rest/helloworld/Test
>>
>> Somehow sub-resource doesn't get mapped. I don't see any errors under WebSphere console as well.
>>
>> Appreciate any help or pointers as I am really stuck.
>>
>> Here is sample code:
>> ===============
>> *package*com.sun.jersey.samples.helloworld.resources;
>>
>> *import*javax.ws.rs.GET;
>> *import*javax.ws.rs.PathParam;
>> *import*javax.ws.rs.Produces;
>> *import*javax.ws.rs.Path;
>> *import*javax.ws.rs.WebApplicationException;
>>
>> // The Java class will be hosted at the URI path "/_helloworld_"
>> @Path("/helloworld")
>> *public**class*HelloWorldResource {
>>
>> // The Java method will process HTTP GET requests
>> @GET
>> // The Java method will produce content identified by the MIME Media
>> // type "text/plain"
>> @Produces("text/plain")
>> *public*String getClichedMessage() {
>> // Return some _cliched_ textual content
>> *return*"Hello World";
>> }
>>
>> @GET
>> @Path("{name}")
>> @Produces("text/plain")
>> *public*String sendMessage(@PathParam("name") String name) {
>> // Return some _cliched_ textual content
>> *return*"Hello World, "+ name;
>> }
>>
>> }
>>
>> Here is web.xml file:
>> =============
>> <?xmlversion=/"1.0"/encoding=/"UTF-8"/?>
>> <web-appversion=/"2.4"/xmlns=/"//http://java.sun.com/xml/ns/j2ee//"/xmlns:xsi=/"//http://www.w3.org/2001/XMLSchema-instance//"/xsi:schemaLocation=/"//http://java.sun.com/xml/ns/j2ee////http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd//"/>
>>
>> <servlet>
>> <servlet-name>Jersey Web Application</servlet-name>
>> <servlet-class>_com_.sun.jersey._spi_.container._servlet_.ServletContainer</servlet-class>
>> <init-param>
>> <param-name>_com_.sun.jersey._config_.property.packages</param-name>
>> <param-value>_com_.sun.jersey.samples._helloworld_.resources</param-value>
>> </init-param>
>> <init-param>
>> <param-name>_com_.sun.jersey._config_.property.resourceConfigClass</param-name>
>> <param-value>_com_.sun.jersey._api_.core.PackagesResourceConfig</param-value>
>> </init-param>
>> <load-on-startup>1</load-on-startup>
>> </servlet>
>> <servlet-mapping>
>> <servlet-name>Jersey Web Application</servlet-name>
>> <url-pattern>/rest/*</url-pattern>
>> </servlet-mapping>
>> <display-name>
>> SimpleServlet</display-name>
>> <welcome-file-list>
>> <welcome-file>index._html_</welcome-file>
>> </welcome-file-list>
>> <session-config>
>> <session-timeout>
>> 30
>> </session-timeout>
>> </session-config>
>> </web-app>
>>
>> Thank you,
>>
>> DILIP CHAMPANERI, PMP
>> Software Engineering Manager
>> CSC
>>
>> 1111 Broadway, Oakland CA 94607
>> FSG - Integrated Payments | o: +1.510.645.3066 | m: +1.510.289.0383 | f: +1.510.465.3141 | _dchampan_at_csc.com _
>> <mailto:dchampan@csc.com>| _www.csc.com _<http://www.csc.com/>
>>
>> This is a PRIVATE message. If you are not the intended recipient, please delete without copying and kindly advise us by
>> e-mail of the mistake in delivery.
>> NOTE: Regardless of content, this e-mail shall not operate to bind CSC to any order or other contract unless pursuant to
>> explicit written agreement or government initiative expressly permitting the use of e-mail for such purpose.