Tim*_*uck 3 java servlets exception classloader
我正在开发一个使用Java servlet的WebSphere 6.1应用程序.在我的servlet中,我定义了一个1L的序列版本ID.在部署并运行我的应用程序时,我收到以下类型的LinkageError(来自服务器日志):
[5/9/11 15:14:26:868 EDT] 0000001c WebApp
E [Servlet Error]-[ManageRecordsConsumerServlet]: java.lang.Exception:
java.lang.LinkageError: LinkageError while defining class:
<redacted>.docindexupdate.batch.servlet.ManageRecordsConsumerServlet
Could not be defined due to: (<redacted>/docindexupdate/batch/servlet
/ManageRecordsConsumerServlet) class name must be a string at offset=2074
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.
Run Code Online (Sandbox Code Playgroud)
我不确定是什么问题.我之前在定义串行版本uid时看到了这一点,并认为通过定义并保持一致,类文件的未来更新将成功运行.在编译或部署到服务器期间没有错误.是否有可能在WebSphere实例的某个地方缓存旧版本的servlet(我目前只在我的开发机器上部署)?
该
class name must be a string at offset=2074
Run Code Online (Sandbox Code Playgroud)
线路也令人困惑.
我怀疑你有一个装在两个不同的类加载器中的jar.我的意思是,你的websphere服务器在启动时加载了jar或者有一个带有该jar的endorsed目录.您正在部署的EAR也在其lib中具有该jar.这两者可能在运行时发生冲突
我建议的是找出ManageRecordsConsumerServlet属于哪个jar,并将其从您的EAR库或您的Websphere认可的lib中删除(最好是您的EAR库).
| 归档时间: |
|
| 查看次数: |
7996 次 |
| 最近记录: |