java.lang.ClassNotFoundException: org.glassfish.jersey.servlet.ServletContainer

后端 未结 10 1455
名媛妹妹
名媛妹妹 2020-12-14 20:58

You may feel this is a duplicated question, but none of the questions with the same title solve my problems. I am using Jersey 2.0 creating a RESTful web service in Eclipse,

10条回答
  •  情歌与酒
    2020-12-14 21:53

    For me, the fix was doing this:

    Right click on Project -> Properties -> Java Build Path -> Libraries ->
    Add Library... -> Server Runtime -> Apache Tomcat v7.0 -> Finish
    

    Another step i did was to import stuff in Maven but it wasnt neccessary as it is running fine without it too.

    But here it is if it helps anyone

        
            javax.servlet
            servlet-api
            2.5
            provided
        
        
            javax.servlet.jsp
            jsp-api
            2.2.1-b03
            provided
        
    

    putting servlet jars in WEB-INF/lib just did things more complicated as the Exception Message got more complicated and irrelevant

    EDIT: oh what also does help is to do an Update Project on your Maven Project.

提交回复
热议问题