gpt4 book ai didi

java - Tomcat 7.0.30 不适用于 Resteasy 2.3.4

转载 作者:搜寻专家 更新时间:2023-10-31 19:40:27 25 4
gpt4 key购买 nike

我使用 resteasy 2.3.4 Final 创建了一个小型 Web 应用程序,并将其部署到 Tomcat 7.0.30。 tomcat启动时出现如下错误信息:

...
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Sep 11, 2012 9:28:08 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter org.jboss.resteasy.plugins.server.servlet.Filter30Dispatcher
java.lang.NoClassDefFoundError: javax/enterprise/context/spi/Contextual
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404)
...

我的web.xml如下:

<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/services</param-value>
</context-param>

<context-param>
<param-name>resteasy.scan.resources</param-name>
<param-value>true</param-value>
</context-param>

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

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

最佳答案

通过删除 resteasy-cdi-2.3.4.Final.jar 解决了问题。

关于java - Tomcat 7.0.30 不适用于 Resteasy 2.3.4,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12371366/

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