2 Replies Latest reply on Jun 22, 2012 3:10 AM by mylos78

    Installing module in JBoss 7.1.1 - troubles !

    mylos78

      Hi all,

      I have several web applications which use iText library for generating PDF files. So I'd like to install it as a module. I have created this structure into the modules folder:

      modules

      └───org

                └───itext

                         └───main

                                  itext.jar

                                  module.xml

       

      Where module.xml contains:

      <module xmlns="urn:jboss:module:1.1" name="org.itext">

           

          <resources>

              <resource-root path="itext.jar"/>

              <!-- Insert resources here -->

          </resources>

       

          <dependencies>

              <module name="javax.api"/>

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

          </dependencies>

      </module>

       

      My MANIFEST.MF is

      Manifest-Version: 1.0

      Dependencies: org.itext

       

      However iText classes are not found by the Web application: javax.servlet.ServletException: com/lowagie/text/Phrase

      On the other hand, if I attach the itext.jar into the WEB-INF/lib there are no issues.

       

      One more thing: looking at the folder C:\jboss-as-7.1.1.Final\modules\org\itext\main I can see that the file itext.jar.index is not even created so it seems that the application server does not initialize properly this module.

      Am I missing something ?

      Thanks

      Mylos

        • 1. Re: Installing module in JBoss 7.1.1 - troubles !
          f_marchioni

          Umm why are you adding dependencies which are not required? I was able to install iText library flawlessy with the following module configuration:

           

          <module xmlns="urn:jboss:module:1.1" name="com.lowagie.itext">

              <properties>

                  <property name="jboss.api" value="private"/>

              </properties>

           

               <resources>

                  <resource-root path="itext-2.1.7.jar"/>

               

              </resources>

           

           

              <dependencies>

              </dependencies>

          </module>

           

          Of course you have to create the path com.lowagie.itext under "modules".

           

          >One more thing: looking at the folder C:\jboss-as-7.1.1.Final\modules\org\itext\main I can see that the file itext.jar.index is not even created so it seems that the application server does not initialize properly >this module.

           

           

          That won't happen when the server boots but just when the module is triggered by an application. Everything around AS 7 works with this concept.

          By the way check out MTB tomorrow as I'm going to add an article about iText + POI on AS7. :-)

          Cheers

          Francesco


          • 2. Re: Installing module in JBoss 7.1.1 - troubles !
            mylos78

            Thanks a lot ! it works with your setting and the library itext-2.1.7.jar.