0

I have an ear (Selene.ear) which contains a war (SeleneWar.war).

When I put primefaces-5.0.jar inside the Selene.war assembly (in WEB-INF/lib) I have no issues using the functionality. Anyway, I am a fan of thin deployments and I have been tried to setup primefaces as a WildFly module.

1) In wildfly/modules, I did create the folder org/primefaces/main. There I put primefaces-5.0.jar and the following module.xml

<module xmlns="urn:jboss:module:1.3" name="org.primefaces">
  <resources>
    <resource-root path="primefaces-5.0.jar"/>
  </resources>

  <dependencies>
    <module name="javaee.api"/>
    <module name="javax.faces.api"/>
  </dependencies>
</module>

2) In selene.ear, in META-INF, I have added the following jboss-deployment-structure.xml:

<jboss-deployment-structure>
  <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
  <sub-deployment name="SeleneWar.war">
    <dependencies>
      <module name="org.primefaces"/>
    </dependencies>
    <local-last value="true" />
  </sub-deployment>
</jboss-deployment-structure>

It seems that everything is ok (Wildfly starts with no errors; if I remove the module folder then it start complaining about the missing dependencies). Yet, if I remove the primefaces jar from the war assembly the primefaces tags are not being processed, so it looks like the classes are not available.

I am using WildFly 8.1 on Java 7 on Linux.

What am I missing?

SJuan76
  • 24,532
  • 6
  • 47
  • 87

1 Answers1

3

I had similar issue in WildFly 8.2.0.Final, and the way to make it work was just add this in the jboss-deployment-structure.xml: ( add slot and export attributes )

<dependencies>          
    <module name="org.primefaces" slot="main" export="true"/>  
</dependencies> 
SJuan76
  • 24,532
  • 6
  • 47
  • 87
Maikel Nait
  • 251
  • 3
  • 18
  • 1
    The `slot` is only to select a version of the module when you have several. `export`, though, did really work (I am editing your answer with the complete xml. Welcome to SO. – SJuan76 Feb 27 '15 at 08:57
  • My bad, it actually did not work that day (even with `slot` and `export`); the first test worked because I did remove the primefaces jar from the build process but it still got to the war as a dependency of primefaces-extensions. Once I tried with an application without the library, it could not find it as a module. Thanks anyway, and still welcome to SO. – SJuan76 Feb 27 '15 at 09:09
  • Actually I finally make it work in another way. I installed a new JSF library as a module, following this link: https://developer.jboss.org/wiki/StepsToAddAnyNewJSFImplementationOrVersionToWildFly , and then added the primefaces library to the generated [module.xml] by the cli installation script – Maikel Nait Feb 27 '15 at 09:37