RESTEasy java.lang.LinkageError:定义类时出现 LinkageError:org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
我正在尝试在我的项目中实施 RESTEasy,该项目给出了
java.lang.LinkageError:定义时发生 LinkageError 类:org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
我正在使用 websphere 6.1 和 RESTEasy 2.1.0.GA
详细错误如下:
`由以下原因引起:java.lang.LinkageError:定义类时出现 LinkageError:org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher 无法定义,因为:(org/jboss/resteasy/plugins/server/servlet/HttpServletDispatcher)offset=6 处的主要版本错误 这通常是由于在多个位置定义了一个类而导致的 类加载器层次结构中的位置。其他潜在原因 包括针对该类的旧版本或新版本进行编译 具有不兼容的方法签名。 转储当前上下文类加载器层次结构: ==>表示定义类加载器 ==>[0] com.ibm.ws.classloader.CompoundClassLoader@46204620 本地类路径: 委派模式:PARENT_FIRST [1] com.ibm.ws.classloader.CompoundClassLoader@20ac20ac 本地类路径: 委派模式:PARENT_FIRST [2] com.ibm.ws.classloader.ProtectionClassLoader@49de49de [3] com.ibm.ws.bootstrap.ExtClassLoader@7b127b12 [4] org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@2db22db2 [5] sun.misc.Launcher$AppClassLoader@62e662e6 [6] sun.misc.Launcher$ExtClassLoader@7fee7fee ---原始异常--- java.lang.UnsupportedClassVersionError: (org/jboss/resteasy/plugins/server/servlet/HttpServletDispatcher) 偏移量 = 6 处的主要版本错误 在java.lang.ClassLoader.defineClassImpl(本机方法) 在 java.lang.ClassLoader.defineClass(ClassLoader.java:258) 在 java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151) 在 com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:555) 在 com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506) 在 com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:380) 在 java.lang.ClassLoader.loadClass(ClassLoader.java:597) 在 java.beans.Beans.instantiate(Beans.java:202) 在 java.beans.Beans.instantiate(Beans.java:63) 在 com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1334) 在 com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118) 在 com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1329) 在 com.ibm.ws.wswebcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:388) 在 com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:410) 在 com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) 在 com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440) 在 com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267) 在 com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815) 在 com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461) 在 com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119) 在 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458) 在 com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387) 在 com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102) 在 com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) 在 com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) 在 com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) 在 com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) 在 com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195) 在 com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743) 在 com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873) 在 com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
--- 结束原始异常----
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:602)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
at java.beans.Beans.instantiate(Beans.java:202)
at java.beans.Beans.instantiate(Beans.java:63)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1334)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1329)
... 19 more
`
I am trying to implement RESTEasy in my project, which is giving
java.lang.LinkageError: LinkageError while defining
class:org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
I am using websphere 6.1 and RESTEasy 2.1.0.GA
The detail error is as follows:
`Caused by: java.lang.LinkageError: LinkageError while defining class: org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
Could not be defined due to: (org/jboss/resteasy/plugins/server/servlet/HttpServletDispatcher) bad major version at offset=6
This is often caused by having a class defined at multiple
locations within the classloader hierarchy. Other potential causes
include compiling against an older or newer version of the class
that has an incompatible method signature.
Dumping the current context classloader hierarchy:
==> indicates defining classloader
==>[0]
com.ibm.ws.classloader.CompoundClassLoader@46204620
Local ClassPath:
Delegation Mode: PARENT_FIRST
[1]
com.ibm.ws.classloader.CompoundClassLoader@20ac20ac
Local ClassPath:
Delegation Mode: PARENT_FIRST
[2] com.ibm.ws.classloader.ProtectionClassLoader@49de49de
[3] com.ibm.ws.bootstrap.ExtClassLoader@7b127b12
[4] org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@2db22db2
[5] sun.misc.Launcher$AppClassLoader@62e662e6
[6] sun.misc.Launcher$ExtClassLoader@7fee7fee
---Original exception---
java.lang.UnsupportedClassVersionError: (org/jboss/resteasy/plugins/server/servlet/HttpServletDispatcher) bad major version at offset=6
at java.lang.ClassLoader.defineClassImpl(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:258)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:555)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
at java.beans.Beans.instantiate(Beans.java:202)
at java.beans.Beans.instantiate(Beans.java:63)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1334)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1329)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:388)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:410)
at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3440)
at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:267)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:815)
at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1461)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:119)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:458)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:387)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1473)
--- end Original exception----
at com.ibm.ws.classloader.CompoundClassLoader._defineClass(CompoundClassLoader.java:602)
at com.ibm.ws.classloader.CompoundClassLoader.findClass(CompoundClassLoader.java:506)
at com.ibm.ws.classloader.CompoundClassLoader.loadClass(CompoundClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:597)
at java.beans.Beans.instantiate(Beans.java:202)
at java.beans.Beans.instantiate(Beans.java:63)
at com.ibm.ws.webcontainer.servlet.ServletWrapper$1.run(ServletWrapper.java:1334)
at com.ibm.ws.security.util.AccessController.doPrivileged(AccessController.java:118)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.loadServlet(ServletWrapper.java:1329)
... 19 more
`
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您尝试使用的库是使用 Java 1.6 编译的。 WebSphere Application Server 6.1 仅支持 1.5。
The library you are attempting to use was compiled using Java 1.6. WebSphere Application Server 6.1 supports only 1.5.