我只是增加了JAX-RS Web服務到我的項目在MyEclipse中,做我的出口/部署到JBoss 6/JDK 1.6,但我不斷收到這個錯誤,我不知道爲什麼會出現。以下是此堆棧軌跡的前幾行:的JBoss的RESTEasy無法掃描WEB-INF的JAX-RS註釋
2011-05-03 21:33:46,716 INFO [org.jboss.resteasy.integration.deployers.ResteasyIntegrationDeployer] (HDScanner) *** Adding JAX-RS resource classes: com.mycompany.CategoriesResource
2011-05-03 21:33:47,180 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/mypath
2011-05-03 21:33:47,330 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/mypath]] (HDScanner) Exception sending context initialized event to listener instance of class org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap: java.lang.RuntimeException: Unable to scan WEB-INF for JAX-RS annotations, you must manually register your classes/resources
有沒有人有過這種麻煩?如果有幫助,該項目在MyEclipse中使用Struts和Web服務功能創建。我真的不知道還有什麼可以嘗試考慮我剛剛部署了一個類似的配置沒有任何問題。
謝謝!
這裏是我的web.xml
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd「> 行動 org.apache.struts.action。的ActionServlet 配置 /WEB-INF/struts-config.xml 調試 詳細
<listener>
<listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
</listener>
<servlet>
<display-name>API</display-name>
<servlet-name>API</servlet-name>
<servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>API</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/api</param-value>
</context-param>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<jsp-config>
<taglib>
<taglib-uri>http://struts.apache.org/tags-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-tiles</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>http://struts.apache.org/tags-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</jsp-config>
你在你的web.xml中有正確的配置嗎? – fmucar 2011-05-03 22:32:23
我很確定web.xml是好的,但這裏只是爲了防止發現錯誤。 – 2011-05-04 18:29:22
我有同樣的問題,你是否設法解決這個問題? – Yashar 2014-11-05 15:23:58