Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat 7.0.30 does not work with Resteasy 2.3.4

I created a small web application with resteasy 2.3.4 Final, and I deployed it to Tomcat 7.0.30. I got the following error message when tomcat starts:

...
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)
...

My web.xml is as follows:

<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>
like image 848
Qian Chen Avatar asked Sep 11 '12 13:09

Qian Chen


1 Answers

Problem solved by removing the resteasy-cdi-2.3.4.Final.jar.

like image 124
Qian Chen Avatar answered Sep 17 '22 23:09

Qian Chen