gpt4 book ai didi

java - 部署到 JBoss 7 的 Resteasy war 提示找不到 "org.resteasy.plugins.server.servlet.ResteasyBootstrap"

转载 作者:行者123 更新时间:2023-11-30 04:53:19 27 4
gpt4 key购买 nike

我有一个使用restEasy编写的restful服务并部署到JBoss。我有一个 web.xml 被玷污为:

<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<display-name>Web Application</display-name>

<listener>
<listener-class>org.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<listener>
<listener-class>org.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>
</listener>

<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>org.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>

</web-app>

但是,当我部署此 war 文件时,它会生成错误消息:

20:06:46,225 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.deployment.unit."orderservice-develop
er.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."orderservice-developer.war".POST_MODULE: Failed to process
phase POST_MODULE of deployment "orderservice-developer.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.0.Final.jar:7.1.0
.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011093: Could not load component class org.resteasy.plugins.server.se
rvlet.ResteasyBootstrap
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:113)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.0.Final.jar:7.1.0
.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: org.resteasy.plugins.server.servlet.ResteasyBootstrap from [Module "deployment.orderservice-developer.war
:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.1.GA]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.1.GA]
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:111)
... 7 more

看起来找不到类“org.resteasy.plugins.server.servlet.ResteasyBootstrap”。实际上,我已经深入研究了 war 文件中部署的所有 jar 文件,并在“resteasy-jaxrs-2.3.1.GA”中找到了这个类。

这门课怎么不能选?我的 web.xml 有什么问题吗?

最佳答案

应该是:

<listener-class>org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>

而不是:

<listener-class>org.resteasy.plugins.spring.SpringContextLoaderListener</listener-class>

在文档中它的定义是错误的。

关于java - 部署到 JBoss 7 的 Resteasy war 提示找不到 "org.resteasy.plugins.server.servlet.ResteasyBootstrap",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9402543/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com