AlexSC
AlexSC

Reputation: 1933

How to configure a new module in JBoss AS 7.1.3?

This question is a spinoff of this one!

I now can configure my project to use a different version of Hibernate and my JBoss installation has a second slot named "5.1.1.Final" (located at ...\jboss-as-7.1.3.Final\modules\org\hibernate\5.1.10.Final) that has the following module.xml file:

<module xmlns="urn:jboss:module:1.1" name="org.hibernate:5.1.10.Final">
    <resources>
        <resource-root path="hibernate-core-5.1.10.Final.jar"/>
        <resource-root path="hibernate-entitymanager-5.1.10.Final.jar"/>
        <resource-root path="hibernate-infinispan-5.1.10.Final.jar"/>
        <!-- Insert resources here -->
    </resources>

    <dependencies>
        <module name="asm.asm"/>
        <module name="javax.api"/>
        <module name="javax.persistence.api"/>
        <module name="javax.transaction.api"/>
        <module name="javax.validation.api"/>
        <module name="org.antlr"/>
        <module name="org.apache.commons.collections"/>
        <module name="org.dom4j"/>
        <module name="org.infinispan" optional="true"/>
        <module name="org.javassist"/>
        <module name="org.jboss.as.jpa.hibernate" slot="4" optional="true"/>
        <module name="org.jboss.logging"/>
        <module name="org.hibernate.envers" services="import" optional="true"/>
        <module name="org.hibernate.commons-annotations"/>
    </dependencies>
</module>

However, when JBoss starts I receive the following error message: ParseError at [row,col]:[26,72] Message: Invalid/mismatched module name (expected org.hibernate:5.1.10.Final).

I can't understand why this message, since the required module name (org.hibernate:5.1.10.Final) is the exact name I specified at the file (name="org.hibernate:5.1.10.Final");

What am i missing?

Upvotes: 0

Views: 1615

Answers (1)

James R. Perkins
James R. Perkins

Reputation: 17815

The slot is a separate attribute. It should look like the following.

<module xmlns="urn:jboss:module:1.1" name="org.hibernate" slot="5.1.10.Final">

On a side note you may want to consider trying to upgrade to WildFly 11, current release is WildFly 11.0.0.Beta1. I'm not sure if Hibernate 5.1.x will work with JBoss AS 7.x. WildFly 10.1.0.Final uses Hibernate 5.0.10.Final.

Upvotes: 1

Related Questions