I have a jersey rest controller called Test.
@Path("/listusers")
public class Test {
@Context
private HttpServletRequest request;
@GET
public void listUser(){
System.out.println("testing...");
//getting parameters from the request and doing something
}
}
When I run the code, I am getting error saying that
No thread local value in scope for proxy of class com.sun.proxy.$Proxy18
I am not able to understand the reason for this. I have some other classes where I am using similar url, without any problem.
I tried googling, but was not able to find any solution.
My web.xml entry is
<servlet>
<servlet-name>rest-controller</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>jersey.config.server.provider.packages</param-name>
<param-value>com.mypackage</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>rest-controller</servlet-name>
<url-pattern>/listusers</url-pattern>
</servlet-mapping>
Can someone help me with this?