ITeye博客

类加载的问题have different Class objects for the type used in the signature

Illy · 2014-07-15 12:20 · web应用开发 · 服务器 · 企业架构 · Markdown

如果项目启动时报类似以下的错误:

java.lang.LinkageError: loader constraint violation: when resolving interface method "org.hibernate.engine.SessionFactoryImplementor.getTransactionManager()Ljavax/transaction/TransactionManager;" the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) of the current class, org/springframework/orm/hibernate3/SessionFactoryUtils, and the class loader (instance of org/jboss/classloader/spi/base/BaseClassLoader) for resolved class, org/hibernate/engine/SessionFactoryImplementor, have different Class objects for the type javax/transaction/TransactionManager used in the signature

这个问题耗费了我很长一段时间,查阅了很多论坛和技术资料,也用了很多的解决办法,如把Jar包替换掉,查找配置文件……。最后在http://www.jboss.org/community/wiki/ClassLoadingConfiguration 中找到解决方法。

最终的方案就是在项目的WEB-INF下面添加了一个叫jboss-web.xml的文件,内容如下:

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。