2 Replies Latest reply on Sep 15, 2014 3:43 PM by ricardo.jr

    Exporting META-INF to other modules

    iref

      Hi everyone,

       

      I wrote my custom logging handler and add it as new module to Wildfly 8.0.0.Final. My handler store some configuration settings for 3rd party library in META-INF/ folder inside my JAR package. So far so good, problem is that after I add handler to logging subsystem, my META-INF folder is no longer on classpath and it can't be accessed. I tried to export it by using export attribute and exports element in my module definition, but this didn't help.

       

      Here is my module.xml

       

      <module xmlns="urn:jboss:module:1.1" name="com.mycompany.handlers">
          <resources>
              <resource-root path="handler.jar"/>
          </resources>
          <dependencies>
              <module name="javax.api"/>
              <module name="org.jboss.logging" export="true">
                  <exports>
                      <include path="META-INF/" />
                  </exports>
              </module>
      
              <!-- some other dependencies -->
          </dependencies>
      </module>
      

       

      If I understand JBoss Module schema correctly, exports always rejects META-INF. Is there any other way how to add my META-INF to classpath, so it can be accessed outside of my package in runtime?

       

      Thanks for help.

        • 1. Re: Exporting META-INF to other modules
          jaikiran

          You need services=import on the module dependency:


          <dependencies> 

            ....

            <module name="org.jboss.logging" services="import"/> 

            ....

          • 2. Re: Exporting META-INF to other modules
            ricardo.jr

            Jan Ferko, I've got the muduled jar's META-INF visible by app.war this way

             

            <?xml version="1.0" encoding="UTF-8"?>

            <jboss-deployment-structure>

                <deployment>

                    <dependencies>

                        <module name="javax.faces.api" slot="mojarra-1.2_15_full_dep">

                            <imports>

                              <include path="META-INF**"/>

                            </imports>

                        </module>

                    </dependencies>

                </deployment>

            </jboss-deployment-structure>

             

            this access the META-INF of all jars in resource area.

             

             

            <?xml version="1.0" ?>

            <module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="mojarra-1.2_15_full_dep">

             

                <resources>

                    <resource-root path="richfaces-ui-3.3.3.Final.jar"/>

                    <resource-root path="richfaces-impl-3.3.3.Final.jar"/>

                    <resource-root path="richfaces-api-3.3.3.Final.jar"/>

                    <resource-root path="tomahawk12-1.1.10.jar"/>

                    <resource-root path="jsf-facelets-1.1.14.jar"/>

                </resources>

             

                <!--

                 I didn't get access the META-INF on module dependencies

                -->

                <dependencies>

                    <module name="com.sun.jsf-impl" slot="mojarra-1.2_15"/>

                    <module name="javax.api"/>

                    <module name="javax.servlet.api"/>

                    <module name="javax.servlet.jsp.api"/>

                    <module name="javax.faces.api" slot="mojarra-1.2_15"/>

                    <module name="org.apache.commons.collections"/>

                    <module name="org.apache.commons.digester"/>

                    <module name="org.apache.commons.el"/>

                    <module name="org.apache.commons.logging"/>

                    <module name="org.apache.commons.fileupload"/>

                </dependencies>

            </module>

            1 of 1 people found this helpful