HTTP status 500 - сервер обнаружил внутреннюю ошибку (), которая не позволила ему выполнить этот запрос

Когда я пытался получить доступ к веб-службе Restful, используя JAXRS на локальном хосте, я получаю ниже ОШИБКУ. Я проверил наличие дубликатов jar-файлов, и даже мой web.xml кажется правильным. Любая идея, где я иду не так?

ОШИБКА (i): [при попытке доступа к localhost ]

ОШИБКА (ii): [в консоли Eclipse]

INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
May 10, 2012 2:08:19 PM org.apache.catalina.core.StandardContext loadOnStartup
SEVERE: Servlet /validatorService threw load() exception
javax.servlet.ServletException: Resource configuration class, validatorService.ValidatorServiceConfig, is not a super class of class javax.ws.rs.core.Application
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:741)
    at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678)
    at com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373)
    at com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556)
    at javax.servlet.GenericServlet.init(GenericServlet.java:160)
    at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
    at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
    at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
    at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
    at java.util.concurrent.FutureTask.run(FutureTask.java:166)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

May 10, 2012 2:08:19 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\apache-tomcat-7.0.27\webapps\docs
May 10, 2012 2:08:19 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\apache-tomcat-7.0.27\webapps\examples
May 10, 2012 2:08:20 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
May 10, 2012 2:08:20 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
May 10, 2012 2:08:20 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@79e582c1')
May 10, 2012 2:08:20 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\apache-tomcat-7.0.27\webapps\host-manager
May 10, 2012 2:08:20 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\apache-tomcat-7.0.27\webapps\manager
May 10, 2012 2:08:20 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory C:\Program Files (x86)\apache-tomcat-7.0.27\webapps\ROOT
May 10, 2012 2:08:20 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 10, 2012 2:08:20 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 10, 2012 2:08:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 675 ms

ОШИБКА (iii) Apache / log

127.0.0.1 - - [10/May/2012:14:28:18 -0500] "GET / HTTP/1.1" 200 11444
0:0:0:0:0:0:0:1 - - [10/May/2012:14:28:18 -0500] "GET /validatorService/WEB-INF/classes/validatorService/ValidatorService.java HTTP/1.1" 404 952
0:0:0:0:0:0:0:1 - - [10/May/2012:14:28:34 -0500] "GET /validatorService/rest/ HTTP/1.1" 500 2604
0:0:0:0:0:0:0:1 - - [10/May/2012:14:28:39 -0500] "GET /validatorService/rest/valid HTTP/1.1" 500 2604
0:0:0:0:0:0:0:1 - - [10/May/2012:14:28:52 -0500] "GET /validatorService/rest/valid HTTP/1.1" 500 2604

1 ответ

Решение

Должен был понять это, как только я увидел это. В любом случае это моя ошибка

ОШИБКА:

javax.servlet.ServletException: Resource configuration class, validatorService.ValidatorServiceConfig, is not a super class of class javax.ws.rs.core.Application

FIX:

public class ValidatorServiceConfig extends Application

ДО:

public class ValidatorServiceConfig
Другие вопросы по тегам