我只是想在websphere 8.0上部署一个示例restful web服务示例,但我得到以下内容:
错误
[12.02.2013 05:13:07:728 VET] 00000c74 E UOW = source = com.ibm.ws.webcontainer.servlet class = com.ibm.ws.webcontainer.servlet.ServletWrapper method = init org = prod = component = thread = [WebContainer:370] Uncaught.init.exception.thrown.by.servlet [12.02.2013 05:13:07:728 VET] 00000c74 E UOW = source = com.ibm.ws.webcontainer.webapp class = com.ibm.ws.webcontainer.webapp.WebApp method = logServletError org = prod = component = thread = [WebContainer:370] SRVE0293E:[Servlet Error] - [jersey-serlvet]:java.lang.IncompatibleClassChangeError:org.objectweb.asm.ClassVisitor at java.lang.ClassLoader.defineClassImpl(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:262) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:69) 在com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:852) 在com.ibm.ws.classloader.CompoundClassLoader.localFindClass(CompoundClassLoader.java:762) 在com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:585) at java.lang.ClassLoader.loadClass(ClassLoader.java:627) at java.lang.J9VMInternals.verifyImpl(Native Method) at java.lang.J9VMInternals.verify(J9VMInternals.java:85) at java.lang.J9VMInternals.verify(J9VMInternals.java:83) 在java.lang.J9VMInternals.initialize(J9VMInternals.java:162) 在com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:79) 在com.sun.jersey.api.core.PackagesResourceConfig.init(PackagesResourceConfig.java:104) 在com.sun.jersey.api.core.PackagesResourceConfig。(PackagesResourceConfig.java:78) 在com.sun.jersey.api.core.PackagesResourceConfig。(PackagesResourceConfig.java:89) 在com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:700) at com.sun.jersey.spi.container.servlet.WebComponent.createResourceConfig(WebComponent.java:678) 在com.sun.jersey.spi.container.servlet.WebComponent.init(WebComponent.java:203) 在com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:373) 在com.sun.jersey.spi.container.servlet.ServletContainer.init(ServletContainer.java:556) 在javax.servlet.GenericServlet.init(GenericServlet.java:161) 在com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:336) 在com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.init(ServletWrapperImpl.java:168) 在com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:629) 在com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:456) 在com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) 在com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1027) 在com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87) 在com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:895) 在com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662) 在com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195) 在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458) 在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:522) 在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:311) 在com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:282) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) 在com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 在com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 在com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) 在com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) 在com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) 在com.ibm.io.async.ResultHandler $ 2.run(ResultHandler.java:905) 在com.ibm.ws.util.ThreadPool $ Worker.run(ThreadPool.java:1783)
的web.xml
<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>Restful Web Application</display-name>
<servlet>
<servlet-name>jersey-serlvet</servlet-name>
<servlet-class>
com.sun.jersey.spi.container.servlet.ServletContainer
</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>com.mkyong.rest.JSONService</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.api.json.POJOMappingFeature</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>jersey-serlvet</servlet-name>
<url-pattern>/rest/*</url-pattern>
</servlet-mapping>
</web-app>