dev@jersey.java.net

some errors about spring,hibernate

From: ??? <belivexiaoqi_at_gmail.com>
Date: Fri, 20 Feb 2009 10:36:18 +0800

hi ,guys ,
i met the problem when i using jersey + spring + hibernate ,

the code :


@Path("/rest")
@Singleton
public class UserRestInterface {
    @Autowired
    UserService userService;
    @Autowired
    User user;

    @POST
    @Path("user/{userid}/")
    public User getUser(@PathParam("userid") String userid){
        user= userService.getUser(Long.parseLong(userid));
        return user;
    }
}


when i using http://localhost:****/rest/user/1

does someone has any idear about it ? thanks !

the background error is :

SEVERE: Servlet.service() for servlet Jersey Spring threw exception
java.lang.AbstractMethodError:
javax.ws.rs.core.UriBuilder.replacePath(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
    at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:619)
2009-02-20 10:31:23,644 [http-8888-1] ERROR
o.a.catalina.core.ContainerBase.[Catalina].[localhost].[/cpo].[Jersey
Spring] - Servlet.service() for servlet Jersey Spring threw exception
java.lang.AbstractMethodError:
javax.ws.rs.core.UriBuilder.replacePath(Ljava/lang/String;)Ljavax/ws/rs/core/UriBuilder;
    at
com.sun.jersey.spi.container.servlet.ServletContainer.service(ServletContainer.java:334)
[jersey-bundle-1.0.1.jar:1.0.1]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
[servlet-api.jar:na]
    at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
[catalina.jar:na]
    at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
[catalina.jar:na]
    at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
[catalina.jar:na]
    at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
[catalina.jar:na]
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
[catalina.jar:na]
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
[catalina.jar:na]
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
[catalina.jar:na]
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
[catalina.jar:na]
    at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)
[tomcat-coyote.jar:na]
    at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
[tomcat-coyote.jar:na]
    at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
[tomcat-coyote.jar:na]
    at java.lang.Thread.run(Thread.java:619) [na:1.6.0_10]