javax.ws.rs.NotFoundException: Could not find resource for full path

后端 未结 3 1728
遥遥无期
遥遥无期 2021-01-02 11:08

Environment

Windows 7(64)
jdk1.7.0_51(64)
RESTEasy3.0.7
apache-tomcat-7.0.50
Project Name: hello

RESTEasyHelloWor

3条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 11:50

    I had the same problem when I was migrating my app from resteasy version 3.0.4 to 3.0.12

    Web service was working fine with web.xml similar to one that user3926093 pasted above. What I released is that version 3.0.7 is changing point. Before that version you didn't even need resteasy-servlet-initializer as fasfsfgs stated above. But with 3.0.7 and later versions I started getting "Could not find resource for full path:" exception.

    What I did in order to make it work is to change web.xml to look the same as fasfsfgs stated above (basically I removed all configuration from it) and I created subclass of javax.ws.rs.core.Application class also as fasfsfgs stated above but I don't agree that "You don't need to provide any implementation for that class". The way how you could implement this class could be found here: https://goo.gl/9TJ3Y2. Note that if you want per-request model than this implementation is not good for you. And lastly don't forget to add resteasy-servlet-initializer dependency.

提交回复
热议问题