如果项目启动时报类似以下的错误:
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的文件,内容如下:
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 5.0//EN"
"http://www.jboss.org/j2ee/dtd/jboss-web_5_0.dtd">
<jboss-web>
<class-loading java2ClassLoadingCompliance='true'>
<loader-repository>
com.example:archive=unique-archive-name
<loader-repository-config>
java2ParentDelegaton=true
</loader-repository-config>
</loader-repository>
</class-loading>
</jboss-web>
分享到:
相关推荐
maven项目编写的一个elasticsearch rest方式进行增删改查的api工具类含测试代码,rest方式仅需10多个jar即可实现,比elasticsearch client可以少引用数十个jar,有兴趣的可以看看
执行SQL报错:The used SELECT statements have a different number of columns 以上翻译:使用的SELECT语句具有不同数量的列 原因:我们在 SQL 语句中使用了 UNION 连接两张表时,查询字段数量不一致导致 # 效果...
- FIX: The TFlexPanel.FPaintCache field moved in the protected class section. Added rcPaint field in FPaintCache that represents drawing rectangle. - ADD: In the text prcise mode (TFlexText.Precise=...
✦ Icons: Look for the icons used in each chapter to draw your attention to information needed for the exam or in the real world. For more details on the icons I use, check out the later section, ...
Because some committers work on different parts, the total number in the committers section of the triangle is higher than in the above triangle. The kernel is the main building block of FreeBSD. ...
For example, if your header file uses the File class in ways that do not require access to the declaration of the File class, your header file can just forward declare class File; instead of having ...
主要介绍了关于weblogic部署Java项目的包冲突问题的解决,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
Hence, it becomes possible for the attacker to issue a command to all the nodes, that target a single node (for example, all nodes in the botnet might be commanded by the attacker to send a TCP SYN ...
In this paper, we address the issue of tracking moving objects in an environment covered by multiple uncalibrated cameras with overlapping fields of view, typical of most surveillance setups. In such ...
the JavaMail API, if you want this type of information, you have to calculate it yourself. IMAP IMAP is a more advanced protocol for receiving messages. Defined in RFC 2060 , IMAP stands for ...
The subject of turbulence, the most forbidding in fluid dynamics, has usually proved treacherous to the beginner, caught in the whirls and eddies of its nonlinearities and statistical imponderables....
In this book, the application of the compensation technique and circuits to three different systems is proposed: a highprecision digital-to-analog converter, a SOI (silicon on insulator) 1T DRAM...
"Learning Three.js: The JavaScript 3D Library for WebGL" starts by going over the basic concepts and building blocks used in Three.js. From there on, it will expand on these subjects using extensive ...
If you encounter bugs or have suggestions, please do not hesitate to report them in the forum, bugtracker or by e-mail. And if you have questions, don't hesitate to ask them in the forum Fixes: Fixed...
Most chapters also have sections focusing on the use of the style in systems design as well as sections describing the historical context in which the programming style emerged. Cristina Videira ...
The classes themself are thread safe and multiple objects of the class can be used from different threads (see below for restrictions on solvers that are not thread safe within the GamsModelInstance ...
1.1.3 Using the Singleton Pattern in Unity...........................5 1.1.4 Inheritance.................................................6 1.1.5 Where to Now?.............................................
1)The template should be used for all kinds of data type, such as: integer, real, double, etc., in the program; 2)Programs should be made by Object-Oriented Programming (OOP) method; 3)Use the ...