Jboss Wildfly EJB3和Mybatis部署错误:NoSuchMethodError javax.persistence.Table.indexes()[Ljavax/persistence/Index; [英] Jboss Wildfly EJB3 and Mybatis Deployment Error: NoSuchMethodError javax.persistence.Table.indexes()[Ljavax/persistence/Index;

查看:259
本文介绍了Jboss Wildfly EJB3和Mybatis部署错误:NoSuchMethodError javax.persistence.Table.indexes()[Ljavax/persistence/Index;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将EAR文件部署到Jboss Wildfly(8.1.0),但是我收到以下异常:

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;


我的EAR文件包含一个EJB jar,其中包含mybatis(版本3.2.7)持久性单元,这些持久性单元对cglib(版本:3.1)具有依赖性.
在JBoss 7(7.1.1版)中,该耳朵文件的部署和工作完全相同,没有问题.
基于错误消息,该方法未找到,但我知道类和方法是否存在,在新版本的jboss中一定存在类冲突.


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.

推荐答案

在对耳朵文件进行了调查和解剖后,我设法找到了答案.问题出在我的EJB jar中,asm.jar是cglib的子依赖项. jboss包含的jar和EAR jar之间存在类冲突.要解决此问题,只需在asm子依赖项的cglib依赖项上添加一个maven排除项.

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>

这篇关于Jboss Wildfly EJB3和Mybatis部署错误:NoSuchMethodError javax.persistence.Table.indexes()[Ljavax/persistence/Index;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆