JBoss eap 6: sub deployment in jboss-structure.xml was not found - jboss

I managed to run my ( seam 2.2.2 / jsf 1.2 / hibernate 3.5.6) application on JBoss eap 6.3 (which is compatible with AS 7.[something I don't know]), now to update to JBoss 6.4.4 I'm having such problems:
09:27:23,363 INFO [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Escutando no 127.0.0.1:4447
09:27:23,363 INFO [org.jboss.as.remoting] (MSC service thread 1-7) JBAS017100: Escutando no 127.0.0.1:9999
09:27:23,680 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."Sinapse.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Sinapse.ear".STRUCTURE:
JBAS018733: Failed to process phase STRUCTURE of deployment "Sinapse.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.4.Final-redhat-4.jar:7.5.4.Final-redhat-4]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.7.0_71]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018746: Sub deployment Sinapse-ejb.jar in jboss-structure.xml was not found. Available sub deployments:
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:275) [jboss-as-server-7.5.4.Final-redhat-4.jar:7.5.4.Final-redhat-4]
at org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:184) [jboss-as-server-7.5.4.Final-redhat-4.jar:7.5.4.Final-redhat-4]
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.4.Final-redhat-4.jar:7.5.4.Final-redhat-4]
... 5 more
09:27:24,157 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014612: Falha na operação ("deploy") - endereço ([("deployment" => "Sinapse.ear")]) - falha na descrição: {"JBAS014671: Falha de serviços" => {"jboss.deployment.unit.\"Sinapse.ear\".STRUCTURE" =>
"org.jboss.msc.service.StartException in service jboss.deployment.unit.\"Sinapse.ear\".STRUCTURE: JBAS018733: Falha ao proceder com a fase STRUCTURE do deployment \"Sinapse.ear\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018746: A sub-implantação Sinapse-ejb.jar no jboss-deployment-structure.xml não foi encontrada. Sub-implantações disponíveis: "}}
09:27:27,029 INFO [org.jboss.as.server] (ServerService Thread Pool -- 25) JBAS015859: Implantado "Sinapse.ear" (runtime-name: "Sinapse.ear")
09:27:27,031 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Relatório
de status de serviço JBAS014777: Serviços que falham na inicialização: service jboss.deployment.unit."Sinapse.ear".STRUCTURE: org.jboss.msc.service.StartException in service jboss.deployment.unit."Sinapse.ear".STRUCTURE:
JBAS018733: Falha ao proceder com a fase STRUCTURE do deployment "Sinapse.ear"
09:27:27,216 INFO [org.jboss.as] (Controller Boot Thread) JBAS015961: A interface do gerenciamento ouvindo no http://x.x.x.x/management
09:27:27,216 INFO [org.jboss.as] (Controller Boot Thread) JBAS015951: O console de administração ouvindo no http://x.x.x.x
09:27:27,217 ERROR [org.jboss.as] (Controller Boot Thread) JBAS015875: JBoss EAP 6.4.4.GA (AS 7.5.4.Final-redhat-4) iniciado (com erros) em 14241ms - Iniciado 158 de serviços 188 (1 serviços falharam ou faltam dependência, os serviços 48 são lazy, passivos ou em demanda)
09:27:27,264 INFO [org.jboss.as.server.deployment] (MSC service thread 1-2) JBAS015877: Implantação encerrada Sinapse.ear (runtime-name: Sinapse.ear) em 2ms
09:27:27,584 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS015858: Desimplantado "Sinapse.ear" (runtime-name: "Sinapse.ear")
09:27:27,584 INFO [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Relatório
de status de serviço JBAS014777: Serviços que falham na inicialização: service jboss.deployment.unit."Sinapse.ear".STRUCTURE
Sorry, some parts of the log are badly translated to portuguese.
The config files that work with EAP 6.3:
Application.xml:
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
<display-name>Sinapse-ear</display-name>
<module>
<ejb>Sinapse-ejb.jar</ejb>
</module>
<module>
<java>jboss-seam.jar</java>
</module>
<module>
<java>jboss-seam-remoting.jar</java>
</module>
<module>
<java>jboss-el.jar</java>
</module>
<module>
<java>jbpm-jpdl.jar</java>
</module>
<module>
<java>antlr-runtime.jar</java>
</module>
<module>
<java>mvel2.jar</java>
</module>
<module>
<java>richfaces-api.jar</java>
</module>
<module>
<java>richfaces-ui.jar</java>
</module>
<module>
<java>richfaces-impl.jar</java>
</module>
<module>
<java>resteasy-jaxrs.jar</java>
</module>
<module>
<java>jboss-seam-resteasy.jar</java>
</module>
<module>
<java>commons-digester.jar</java>
</module>
<module>
<java>commons-beanutils.jar</java>
</module>
<module>
<ejb>quartz.jar</ejb>
</module>
<module>
<ejb>JoSQL-1.9.jar</ejb>
</module>
<module>
<java>gentlyWEB-utils-1.1.jar</java>
</module>
<module>
<java>jai_codec.jar</java>
</module>
<module>
<java>jai_core.jar</java>
</module>
<module>
<web>
<web-uri>Sinapse.war</web-uri>
<context-root>/sinapse</context-root>
</web>
</module>
</application>
jboss-deployment-structure.xml:
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<dependencies>
<module name="org.apache.log4j" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.apache.commons.collections" export="true"/>
<module name="org.slf4j" export="true"/>
<module name="org.javassist" slot="main" export="true"/>
<module name="javax.transaction" slot="main" export="true"/>
<module name="org.hibernate" slot="3" export="true" />
<module name="org.hibernate.validator" slot="3" export="true" />
<module name="org.hibernate.commons-annotations" slot="3" export="true" />
<module name="org.apache.lucene" slot="main" export="false"/>
<module name="org.hibernate.search" slot="3" export="true" />
<module name="javax.faces.api" slot="1.2" export="true"/>
<module name="com.sun.jsf-impl" slot="1.2" export="true"/>
<module name="org.bouncycastle" slot="main" export="true" />
<module name="org.quartz" slot="main" export="true"/>
<module name="br.sinapse.conf" slot="main" export="true"/>
</dependencies>
<exclusions>
<module name="org.hibernate" slot="main" />
<module name="org.hibernate.validator" slot="main" />
<module name="org.hibernate.commons-annotations" slot="main" />
<module name="org.hibernate.commons-annotations" slot="3" />
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
<module name="org.jboss.as.jsf" slot="main"/>
<module name="org.jboss.as.jsf-injection" slot="main"/>
<module name="org.jboss.as.weld" slot="main"/>
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" slot="main" />
</exclusions>
</deployment>
<sub-deployment name="Sinapse-ejb.jar">
<dependencies>
<module name="org.apache.log4j" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.apache.commons.collections" export="true"/>
<module name="org.slf4j" export="true"/>
<module name="org.javassist" slot="main" export="true"/>
<module name="javax.transaction" slot="main" export="true"/>
<module name="org.hibernate" slot="3" export="true" />
<module name="org.hibernate.validator" slot="3" export="true" />
<module name="org.hibernate.commons-annotations" slot="3" export="true" />
<module name="org.apache.lucene" slot="main" export="true"/>
<module name="org.hibernate.search" slot="3" export="true" />
<module name="javax.faces.api" slot="1.2" export="true"/>
<module name="com.sun.jsf-impl" slot="1.2" export="true"/>
<module name="org.quartz" slot="main" export="true"/>
<module name="br.sinapse.conf" slot="main" export="true"/>
<module name="org.infinispan" slot="main" export="true"/>
<module name="org.jboss.msc" slot="main" export="true"/>
<module name="org.jboss.as.clustering.infinispan" slot="main" export="true"/>
<module name="org.jboss.as.clustering.jgroups" slot="main" export="true"/>
<module name="org.jboss.as.clustering.api" slot="main" export="true"/>
<module name="org.jboss.as.clustering.common" slot="main" export="true"/>
<module name="org.jboss.as.clustering.impl" slot="main" export="true"/>
<module name="org.jboss.as.clustering.jgroups" slot="main" export="true"/>
<module name="org.jboss.as.clustering.service" slot="main" export="true"/>
<module name="org.jboss.as.jpa.hibernate" slot="3" export="true" />
</dependencies>
<exclusions>
<module name="org.hibernate" slot="main" />
<module name="org.hibernate.validator" slot="main" />
<module name="org.hibernate.commons-annotations" slot="main" />
<module name="org.hibernate.commons-annotations" slot="3" />
<module name="javax.faces.api" slot="main" />
<module name="com.sun.jsf-impl" slot="main" />
<module name="org.jboss.as.jsf" slot="main"/>
<module name="org.jboss.as.jsf-injection" slot="main"/>
<module name="org.jboss.as.weld" slot="main"/>
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" slot="main" />
</exclusions>
</sub-deployment>
<sub-deployment name="Sinapse.war">
<dependencies>
<module name="org.apache.log4j" export="true"/>
<module name="org.dom4j" export="true"/>
<module name="org.apache.commons.logging" export="true"/>
<module name="org.apache.commons.collections" export="true"/>
<module name="javax.faces.api" slot="1.2" export="true"/>
<module name="com.sun.jsf-impl" slot="1.2" export="true"/>
<module name="org.hibernate" slot="3" export="true" />
<module name="org.hibernate.validator" slot="3" export="true" />
<module name="org.apache.lucene" slot="main" export="true"/>
<module name="org.hibernate.search" slot="3" export="true" />
</dependencies>
<exclusions>
<module name="org.hibernate" slot="main" />
<module name="org.hibernate.validator" slot="main" />
<module name="org.hibernate.commons-annotations" slot="main" />
<module name="org.hibernate.commons-annotations" slot="3" />
<module name="org.jboss.resteasy.resteasy-hibernatevalidator-provider" slot="main" />
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
<module name="org.jboss.as.jsf" slot="main"/>
<module name="org.jboss.as.jsf-injection" slot="main"/>
<module name="org.jboss.as.weld" slot="main"/>
</exclusions>
</sub-deployment>
</jboss-deployment-structure>
Ear structure:
META-INF/
META-INF/MANIFEST.MF
lib/
JoSQL-1.9.jar
META-INF/application.xml
META-INF/jboss-deployment-structure.xml
antlr-runtime.jar
commons-beanutils.jar
commons-digester.jar
gentlyWEB-utils-1.1.jar
jai_codec.jar
jai_core.jar
jaxrs-api.jar
jboss-el.jar
jboss-seam-remoting.jar
jboss-seam-resteasy.jar
jboss-seam.jar
jbpm-jpdl.jar
lib/hibernate-entitymanager.jar
lib/infinispan-core-5.2.10.Final-redhat-1.jar
lib/itext-rtf.jar
lib/itext.jar
lib/jasperreports-3.7.5.jar
lib/jasperreports-chart-themes-3.7.4.jar
lib/jsf-facelets.jar
resteasy-jaxrs.jar
richfaces-api.jar
richfaces-impl.jar
richfaces-ui.jar
Sinapse-ejb.jar
Sinapse.war
I have tried many different changes but couldn't make it.

Check the location and content of you jboss-deployment-structure. It should be placed in the top level deployment, in META-INF (or WEB-INF for web deployments)

Related

How to excude exports in deployment module (Wildfly)?

I have two war-files: core.war and service.war
Archive core.war includes jboss-deployment-structure.xml:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclude-subsystems>
<subsystem name="logging"/>
<subsystem name="pojo"/>
</exclude-subsystems>
<exclusions>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
<module name="org.slf4j.ext"/>
<module name="org.slf4j.jcl-over-slf4j"/>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.logging.jul-to-slf4j-stub"/>
<module name="org.jboss.logmanager"/>
<module name="org.jboss.log4j.logmanager"/>
<module name="org.jboss.as.logging"/>
<!-- exclude wildfly logging modules, use slf4j + logback -->
<module name="org.jboss.logmanager.log4j"/>
</exclusions>
<dependencies>
<module name="deployment.some-dep-1.ear" meta-inf="import"/>
<module name="deployment.some-dep-2.ear" meta-inf="import" services="import" optional="true"/>
<module name="deployment.some-dep-3.ear" meta-inf="import"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
service.war includes jboss-deployment-structure.xml:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclude-subsystems>
<subsystem name="logging"/>
<subsystem name="pojo"/>
</exclude-subsystems>
<exclusions>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
<module name="org.slf4j.ext"/>
<module name="org.slf4j.jcl-over-slf4j"/>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.logging.jul-to-slf4j-stub"/>
<module name="org.jboss.logmanager"/>
<module name="org.jboss.log4j.logmanager"/>
<module name="org.jboss.as.logging"/>
<!-- exclude wildfly logging modules, use slf4j + logback -->
<module name="org.jboss.logmanager.log4j"/>
</exclusions>
<dependencies>
<module name="deployment.core.war" services="import" meta-inf="import"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
and I have overlays:
standalone.xml:
...
<deployment-overlays>
<deployment-overlay name="dep-lib">
<!-- ... -->
<content path="/WEB-INF/lib/org-springframework-spring-aop-3.2.10.RELEASE.jar" content="77d0b86238df32cb15e469eaa2f7f32c4893dc54"/>
<content path="/WEB-INF/lib/org-springframework-spring-aspects-3.2.10.RELEASE.jar" content="d5327b3d4a74f224d32c338e83789ae877feb790"/>
<!-- ... -->
<deployment name="core.war"/>
</deployment-overlay>
</deployment-overlays>
...
In this case classLoader in service.war module could not load classes declared in some-dep-1.ear/some-dep-2.ear/some-dep-3.ear becouse
attribute export="false" by default in the tag <module/>
Now I want to exclude some overlay dependensies for service.war.
I try to use tage <export/> something like this:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclude-subsystems>
<subsystem name="logging"/>
<subsystem name="pojo"/>
</exclude-subsystems>
<exclusions>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
<module name="org.slf4j.ext"/>
<module name="org.slf4j.jcl-over-slf4j"/>
<module name="org.apache.log4j"/>
<module name="org.apache.commons.logging"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.logging.jul-to-slf4j-stub"/>
<module name="org.jboss.logmanager"/>
<module name="org.jboss.log4j.logmanager"/>
<module name="org.jboss.as.logging"/>
<!-- exclude wildfly logging modules, use slf4j + logback -->
<module name="org.jboss.logmanager.log4j"/>
</exclusions>
<exports>
<exclude-set>
<path name="**"/>
</exclude-set>
<include-set>
<path name="org/slf4j"/>
</include-set>
</exports>
<dependencies>
<module name="deployment.some-dep-1.ear" meta-inf="import"/>
<module name="deployment.some-dep-2.ear" meta-inf="import" services="import" optional="true"/>
<module name="deployment.some-dep-1.ear" meta-inf="import"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
but this not works.
How can I exclude overlay dependences for export?
If you are using master-slave configuration and your slave configuration is EAP 6.3. or older than it is not possible, you need to downgrade your configuration.
[https://issues.jboss.org/browse/WFCORE-2899?_sscc=t][1]

log4j2 2.10.0 will not deploy on jboss EAP 7

Needed to update our log4j2 from 2.7 to 2.10.0 to get JMS retries working.
When I try to deploy the ear with the 2.10.0 files, jboss is complaining with the following error:
Caused by: java.util.ServiceConfigurationError:
org.apache.logging.log4j.util.PropertySource: Provider
org.apache.logging.log4j.util.EnvironmentPropertySource not a subtype"},
We are also excluding the default jboss logger from our app
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<exclusions>
<module name="org.apache.log4j" />
<module name="org.apache.commons.logging"/>
<module name="org.apache.commons.logging" />
<module name="org.jboss.logging" />
<module name="org.jboss.logging.jul-to-slf4j-stub" />
<module name="org.jboss.logmanager" />
<module name="org.jboss.logmanager.log4j" />
<module name="org.slf4j" />
<module name="org.slf4j.impl" />
</exclusions>
</deployment>
These are the jars in my ear's lib folder for logging:
lib/log4j-api.jar
lib/log4j-core.jar
lib/log4j-slf4j-impl.jar
lib/log4j-web.jar
lib/slf4j-api.jar
lib/slf4j-ext.jar
Any suggestions? Maybe there is another new file I have to exclude?

wildfly did not find jar inside war

After changing ear to war, wildfly 10 cant find the jar file from jboss-deployment-structure.xml from sub-deployment section. There is no gui.ejb.jar in war after project buildin and I copy it to war manually. I try to root folder and to WEB-INF lib. Help please how to fix it.
Caused by:
org.jboss.as.server.deployment.DeploymentUnitProcessingException:
WFLYSRV0166: Sub deployment gui.ejb.jar in
jboss-deployment-structure.xml was not found. Available sub
deployments: at
org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.subDeploymentNotFound(DeploymentStructureDescriptorParser.java:288)
at
org.jboss.as.server.deployment.module.descriptor.DeploymentStructureDescriptorParser.deploy(DeploymentStructureDescriptorParser.java:190)
at
org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:147)
... 5 more
<jboss-deployment-structure>
<deployment>
<exclude-subsystems>
<subsystem name="webservices"/>
<subsystem name="jaxrs"/>
</exclude-subsystems>
<exclusions>
<module name="org.apache.commons.logging"/>
<module name="org.apache.log4j"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.logging.jul-to-slf4j-stub"/>
<module name="org.jboss.logmanager"/>
<module name="org.jboss.logmanager.log4j"/>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
<module name="org.apache.cxf.impl"/>
<module name="org.apache.cxf"/>
<module name="org.apache.cxf.services-sts"/>
<module name="org.apache.cxf.ws-security"/>
<module name="org.apache.cxf.ws-policy"/>
<module name="org.apache.xerces"/>
<module name="org.apache.xalan"/>
</exclusions>
<dependencies>
<module name="com.sun.xml.bind" export="true"services="export"/>
<module name="javax.xml.ws.api" export="true"/>
<module name="javax.jws.api" export="true"/>
<module name="org.slf4j" export="true"/>
</dependencies>
</deployment>
<sub-deployment name="gui.ejb.jar">
<exclusions>
<module name="org.apache.xerces"/>
<module name="org.apache.xalan"/>
<module name="org.slf4j"/>
<module name="org.slf4j.impl"/>
</exclusions>
<dependencies>
<module name="com.sun.xml.bind" export="true"services="export"/>
<module name="javax.xml.ws.api" export="true" />
<module name="javax.jws.api" export="true" />
<module name="org.slf4j" export="true"/>
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
A WAR deployment does not have a sub-deployment. You can remove the <sub-deployment/> element and it will be inherited from the main deployment element.
As a side note it looks a bit weird to both include and exclude the org.slf4j module. If you're attempting to use you're own slf4j binding you'd need to keep it excluded and include an slf4j-api and binding library.

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?
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.

Cannot access Seam Components within JAR from WAR in [JBOSS 7.1.1.FINAL and SEAM 2.2.1.CR2]

Problem: I have an ejb-jar-1.jar which defines EJBs and Entities. The project structure is listed below. During deployment all EJBs are successfully bootstraped > started and their JNDI locations are printed in a log file. There's a class in my WAR file which needs to access a NAMED QUERY defined on an Entity which resides inside ejb-jar-1.jar. When this piece of code is run it throws an illegalArgumentException saying NAMED QUERY cannot be found. On a different note I also cannot get reference to SEAM components that were started when ejb-jar1.jar was deployed. I printed the JNDI tree from app-war.war file and it does not have any JNDI resources from ejb-jar-1.jar. So, I believe this is a context issue where JNDI resources available in ejb-jar-1.jar cannot be seen from app-war.war.
Any suggestions on how to access JNDI resources available in ejb-jar-1.jar from app-war.war?
Deployement Info
* JBOSS 7.1.1.FINAL
* Uses seam framework: jboss-seam-2.2.1.CR2.jar
* Uses Hibernate 3.4.0.GA
main-ear.ear
|__META-INF
| |____jboss-deployment-structure.xml
| |____application.xml
| |____jboss-app.xml
| |____MANIFEST.MF
|__lib
| |____somejar.jar
| |____somejar.jar
|__ejb-jar-1.jar
|__ejb-jar-2.jar
|__jboss-seam-2.2.1.CR2.jar
|__commons-lang-2.4.jar
|__commons-codec-1.1.jar
|__jasypt-1.6.jar
|__app-war.war
jboss-deployment-structure.xml
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<deployment>
<exclusions>
<module name="javax.faces.api" slot="1.2"/>
<module name="com.sun.jsf-impl" slot="1.2"/>
<module name="org.hibernate" slot="main"/>
<module name="org.hibernate.validator" slot="main"/>
<module name="org.apache.commons.lang"/>
<module name="org.apache.commons.collections"/>
<module name="org.apache.commons.codec"/>
<module name="org.picketlink" slot="main"/>
<module name="org.picketbox" slot="main"/>
<module name="org.javassist" slot="main"/>
<module name="org.dom4j" slot="main"/>
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="1.2" export="true"/>
<module name="com.sun.jsf-impl" slot="1.2" export="true"/>
<module name="org.javassist" slot="1" export="true"/>
<module name="org.apache.commons.logging" export="true"/>
</dependencies>
</deployment>
<sub-deployment name="app-war.war">
<exclusions>
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="1.2"/>
<module name="com.sun.jsf-impl" slot="1.2"/>
<module name="deployment.main-ear.ear.ejb-jar-1.jar" />
<module name="deployment.main-ear.ear.ejb-jar-2.jar" />
<module name="deployment.main-ear.ear.jboss-seam-2.2.1.CR2.jar"/>
</dependencies>
</sub-deployment>
<module name="deployment.main-ear.ear.jasypt-1.6.jar" />
<module name="deployment.main-ear.ear.commons-codec-1.1.jar" />
<module name="deployment.main-ear.ear.commons-lang-2.4.jar" />
</jboss-deployment-structure>
application.xml
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/javaee/application_6.xsd"
version="6">
<description>myapp</description>
<display-name>myapp</display-name>
<initialize-in-order>true</initialize-in-order>
<library-directory>lib</library-directory>
<module>
<ejb>ejb-jar-1.jar</ejb>
</module>
<module>
<ejb>ejb-jar-2.jar</ejb>
</module>
<module>
<ejb>jboss-seam-2.2.1.CR2.jar</ejb>
</module>
<module>
<web>
<web-uri>app-war.war</web-uri>
<context-root>/app</context-root>
</web>
</module>
</application>
Bit late but oh well...for EE6 you need to use JNDI portable syntax, eg. add following annotations to all beans in the secondary module
#JndiName("java:app/NameOfModule/NameOfBean")
Think you need seam.properties in your jar in META-INF