上一次在JBOSS上进行Hibernate Arquillian测试的父级 [英] Parent last for Hibernate Arquillian test on JBOSS

查看:159
本文介绍了上一次在JBOSS上进行Hibernate Arquillian测试的父级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在接受Arquillian测试.主题是使用Hibernate 3的EJB,我将其与所有其他Maven依赖项一起添加到了收缩包装的档案中.它将EJB作为包裹在EAR中的JAR部署到板上的具有Hibernate 4的嵌入式JBOSS 7.它与以下异常发生冲突:

I'm having an Arquillian test. The subject is an EJB that uses Hibernate 3, which I add to the shrinkwrapped archives along with all other Maven dependencies. It deploys the EJB as a JAR wrapped in an EAR, to an embedded JBOSS 7 which has Hibernate 4 on board. It clashes with the following exception:

java.lang.AbstractMethodError: org/hibernate/usertype/UserType.nullSafeSet(
    Ljava/sql/PreparedStatement;Ljava/lang/Object;
    ILorg/hibernate/engine/spi/SessionImplementor;)V

我坚信我的代码(针对Hibernate 3编译)针对Hibernate 4执行,因此出现错误.我的理解是,默认情况下,JBOSS会先执行父操作,这将解释该错误.我将存档内容打印出来,作为收缩包装的一部分,所以我相信Hibernate 3位于EAR中.

I strongly believe that my code (compiled against Hibernate 3) is executed against Hibernate 4, hence the error. JBOSS does parent first by default is my understanding, that would explain the error. I print out the archive contents as part of shrinkwrapping, so I believe I know Hibernate 3 is in the EAR.

我尝试过将JBOSS更改为最后一个父级,但是没有成功.其中一些可能是愚蠢的,但无论如何我还是尝试过:

I've tried changing JBOSS to parent last, but had no success at that. Some of these may be stupid, but I tried them anyway:

  1. 添加了META-INF/jboss-classloading.xml(到JAR EAR)

  1. Added a META-INF/jboss-classloading.xml (to the JAR and the EAR)

和 EAR中添加了META-INF/jboss-deployment-structure.xml,试图排除父Hibernate:

Added a META-INF/jboss-deployment-structure.xml (to the JAR and the EAR) in attempt to exclude the parent Hibernate:

从JBOSS删除Hibernate JAR,这完全破坏了服务器

Delete the Hibernate JARs from JBOSS - that broke the server altogether

以下是我的设置的一些配置方面:

Following are a few configuration aspects of my setup:

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