我採取其他簡單的網絡服務,我使用JBoss 4.0,但我得到以下異常......java.lang.NoClassDefFoundError:使用javax/WS/RS /核心/配置
java.lang.NoClassDefFoundError: javax/ws/rs/core/Configuration
我的網頁。 XML是
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<display-name>RestfulWebService</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<!-- <servlet>
<servlet-name>HelloServlet</servlet-name>
<load-on-startup>1</load-on-startup>
</servlet> -->
<!-- <servlet>
<servlet-name>HelloServlet</servlet-name>
<servlet-class>javax.ws.rs.core.Application</servlet-class>
</servlet> -->
<listener>
<listener-class>
org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap
</listener-class>
</listener>
<!-- <context-param>
<param-name>resteasy.scan</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>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.websevices.TestService</param-value>
</init-param>
</servlet>
<!-- <servlet-mapping>
<servlet-name>javax.ws.rs.core.Application</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping> -->
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/rest</param-value>
做你添加的jar文件javax.ws.rs-api.jar中的lib文件夾? – robin