Jersey Services with Tomcat and Eclipse

前端 未结 4 1722
傲寒
傲寒 2020-12-10 09:24

I\'m developing a rest service with Jersey 2.0 (I downloaded from http://repo1.maven.org/maven2/org/glassfish/jersey/bundles/jaxrs-ri/2.5/jaxrs-ri-2.5.zip) and I\'m using To

4条回答
  •  星月不相逢
    2020-12-10 09:47

    My solution:

    1. Add into Tomcat/lib all libraries that you download from Jersey and are including into /ext folder of the Jersey .zip
    2. Add into Web-Inf/lib of my project only libraries that are under /lib folder of the Jersey zip file
    3. Add into Web-Inf/lib of my project javax.ws.rs-api-2.jar that you can find in /api folder of Jersey

    With this, I don't have problems to run Tomcat with Jersey.

    And this is my web.xml for Jersey 2.0

    
    
      MyRESTServices
      
        index.html
        index.htm
        index.jsp
        default.html
        default.htm
        default.jsp
      
    
      
            Jersey Web Application
            org.glassfish.jersey.servlet.ServletContainer
            
                 jersey.config.server.provider.packages
                 com.myservice.services
            
            1
        
        
            Jersey Web Application
            /rest/*
        
    
    
    

    Where com.myservice.services is the package where I have my services

    Thanks for your comments!!

提交回复
热议问题