Jboss Wildfly EJB3 and Mybatis Deployment Error: NoSuchMethodError javax.persistence.Table.indexes()[Ljavax/persistence/Index;

非 Y 不嫁゛ 提交于 2019-12-13 06:59:47

问题


I'm trying to deploy a EAR file to Jboss Wildfly (8.1.0) but im getting the following exception:

Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;


My EAR file contains an EJB jar which contains mybatis (version 3.2.7) persistnence Units which have a Dependency on the cglib (version: 3.1).
This very same ear file deploy's and works without issues in JBoss 7 (version 7.1.1)
Based on the error saying the method isnt found but i know the class and method are there it must be some class conflict in the new version of jboss.


回答1:


I managed to find the answer after some investigation and dissecting of the ear file. The problem was the asm.jar included in my EJB jar as a sub dependency of cglib. There is a class conflict between the jboss included jar and the EAR jar. To fix it simply add a maven exclusion on the cglib dependency for the asm sub dependency.

<exclusions>
        <exclusion>
            <groupId>org.ow2.asm</groupId>
            <artifactId>asm</artifactId>
        </exclusion>
</exclusions>


来源:https://stackoverflow.com/questions/26687423/jboss-wildfly-ejb3-and-mybatis-deployment-error-nosuchmethoderror-javax-persist

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!