ClassNotFoundException when starting tomcat

前端 未结 12 2197
孤城傲影
孤城傲影 2020-12-14 07:38

I\'m trying to make a REST web service.

My project looks like :

\"enter

<
12条回答
  •  Happy的楠姐
    2020-12-14 08:25

    Solution:

    Only add the dependency in pom.xml:

     
          com.sun.jersey
          jersey-servlet
          1.13
     
    

    Now your application will have the class com.sun.jersey.spi.container.servlet.ServletContainer

    ps: Remember to check if the libraries are being sent to the tomcat deploy.

    To check:

    Right-click on your project -> Properties -> Deployment Assembler and make sure the Source tab contains Maven Dependecies.

    Otherwise:

    Click on button Add -> Java Build Path -> Maven Dependecies -> Finish.

    Ready whenever you run the application all the libs will be imported in the deploy.

    ps: Where the Maven project is updated, you must remake these steps.

提交回复
热议问题