REST Web服务 - Swagger获取错误404

时间:2016-04-22 22:12:03

标签: java rest swagger swagger-ui

我在我的Web服务中使用了swagger定义,我已经创建了java(JAX-RS)项目。当我将项目部署到服务器(JBoss 7.1.1)时,我遇到了一些错误,但项目已成功部署,但是当我去尝试操作时,它总是返回错误404。 Example of a request

我还没有在impl目录中做过任何事情,但是对于所有请求,它应该返回默认响应,即魔法!"

MyLib.IS_EVEN::test

错误是:

return Response.ok().entity(new ApiResponseMessage(ApiResponseMessage.OK, "magic!")).build();

依赖关系:

22:53:16,318 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web]. [default-host].[/VoiceAuthMiddleware]] (MSC service thread 1-6) Marking servlet jersey as unavailable
22:53:16,319 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/VoiceAuthMiddleware]] (MSC service thread 1-6) Servlet /VoiceAuthMiddleware threw load() exception: java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer from [Module "deployment.VoiceAuthMiddlewareEAR.ear.VoiceAuthMiddleware.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

22:53:16,325 INFO  [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/VoiceAuthMiddleware]] (MSC service thread 1-6) Marking servlet DefaultJaxrsConfig as unavailable
22:53:16,325 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/VoiceAuthMiddleware]] (MSC service thread 1-6) Servlet /VoiceAuthMiddleware threw load() exception: java.lang.ClassNotFoundException: io.swagger.jaxrs.config.DefaultJaxrsConfig from [Module "deployment.VoiceAuthMiddlewareEAR.ear.VoiceAuthMiddleware.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:72) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1156) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1102) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3655) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3873) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_79]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_79]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]

感谢任何帮助!

0 个答案:

没有答案