You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@wink.apache.org by achoi <us...@gmail.com> on 2013/10/03 03:50:02 UTC

Register problem - Why we can not use JAX-RS servlet extension mapping(*.xxxx)?

If I use the following extension mapping of JAX-RS servlet,  

	<display-name>jaxrs_wink</display-name>
	<servlet>
		<description>
		JAX-RS Tools Generated - Do not modify</description>
		<servlet-name>JAX-RS Servlet</servlet-name>
	
<servlet-class>org.apache.wink.server.internal.servlet.RestServlet</servlet-class>
		<init-param>
			<param-name>javax.ws.rs.Application</param-name>
			<param-value>tests.SampleApplication</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
		<enabled>true</enabled>
		<async-supported>false</async-supported>
	</servlet>
	<servlet-mapping>
		<servlet-name>JAX-RS Servlet</servlet-name>
		<url-pattern>*.do</url-pattern>
	</servlet-mapping>

package tests;

import javax.ws.rs.GET;
import javax.ws.rs.Path;

@Path("/")
public class SampleResource {

	@GET
	@Path("hi.do")
	public String sayHi() {
		return "Hello World!";
	}

}

package tests;

import java.util.HashSet;
import java.util.Set;

import javax.ws.rs.core.Application;

public class SampleApplication extends Application {

	@Override
	public Set<Class&lt;?>> getClasses() {
		Set<Class&lt;?>> classes = new HashSet<Class&lt;?>>();
		classes.add(SampleResource.class);
		return classes;
	}

}

Browse to http://localhost:9081/jaxrs_wink/hi.do.

WebApplicationException (405)


[10/2/13 21:46:13:725 EDT] 00000021 ResourceRegis I
org.apache.wink.server.internal.registry.ResourceRegistry
filterDispatchMethods The system cannot find any method in the
tests.SampleResource class that supports GET. Verify that a method exists.
[10/2/13 21:46:13:731 EDT] 00000021 RequestProces I
org.apache.wink.server.internal.RequestProcessor logException The following
error occurred during the invocation of the handlers chain:
WebApplicationException (405) with message 'null' while processing GET
request sent to http://localhost:9081/jaxrs_wink/hi.do




--
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/Register-problem-Why-we-can-not-use-JAX-RS-servlet-extension-mapping-xxxx-tp7572710.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.

Re: Register problem - Why we can not use JAX-RS servlet extension mapping(*.xxxx)?

Posted by achoi <us...@gmail.com>.
Additional information:  The exactly same program works for Jersey. So, we
can use an extension mapping when we register JAX-RS servlet to web.xml.



--
View this message in context: http://apache-wink-users.3471013.n2.nabble.com/Register-problem-Why-we-can-not-use-JAX-RS-servlet-extension-mapping-xxxx-tp7572710p7572711.html
Sent from the Apache Wink Users mailing list archive at Nabble.com.