Jboss-deployment-structure.xml不读取EAR文件

时间:2014-12-18 16:12:44

标签: hibernate maven jpa ear jboss-eap-6

我创建了一个名为jboss-deployment-structure.xml的文件,并将该文件放在EAR项目的META-INF目录中。 我的耳朵有以下结构:

MyEar.ear
-> META-INF
------> Application.xml
------> Jboss-deployment-structure.xml
-> MyWar.war

如何在JBoss EAP 6.2中进行部署我读过这个问题:

javax.persistence.Table.indexes()[Ljavax / persistence / Index;

当我使用Hibernate JPA 2.1时,这个问题与JPA 2.0版本的JBOSS有关。

如果我在WAR项目的WEB-INF目录中输入文件jboss-deployment-structure.xml并仅安装WAR文件,则基于Web的软件可以正常运行。

有什么问题? 谢谢, 蒙特拉

这是Jboss-deployment-structure.xml的内容

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
    <exclude-subsystems>
        <subsystem name="jpa" />
    </exclude-subsystems>
    <exclusions>
        <module name="javaee.api" />
    </exclusions>
</deployment>

2 个答案:

答案 0 :(得分:4)

您还需要排除sub-deployments

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
    <exclude-subsystems>
        <subsystem name="jpa" />
    </exclude-subsystems>
    <exclusions>
        <module name="javaee.api" />
    </exclusions>    
</deployment>
<sub-deployment name="your.war">
    <exclude-subsystems>
        <subsystem name="jpa" />
    </exclude-subsystems>
    <exclusions>
        <module name="javaee.api" />
    </exclusions>
</sub-deployment>

这需要针对您希望这些排除的每个子部署进行。

答案 1 :(得分:0)

太棒了......它没有问题,但我必须纠正你的例子......

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
    <exclude-subsystems>
        <subsystem name="jpa" />
    </exclude-subsystems>
    <exclusions>
        <module name="javaee.api" />
    </exclusions>
</deployment>
<sub-deployment name="MyWar.war">
    <exclude-subsystems>
            <subsystem name="jpa" />
        </exclude-subsystems>
        <exclusions>
            <module name="javaee.api" />
        </exclusions>
</sub-deployment>
</jboss-deployment-structure>