3 Replies Latest reply on Dec 10, 2014 3:47 AM by valsaraj007

    How to add jars in JBoss AS 7

    valsaraj007

      We have been using some jar files that contains classes required on startup.

      Eg:

      <subsystem xmlns="urn:jboss:domain:security:1.1">

            <security-domains>

        <security-domain name="AppSecurityDomain" cache-type="default"> 

      <jsse keystore-type="jks" keystore-password="{CLASS}org.app.security.auth.PasswordStoreEntry:Please Enter AppServer Password:app"  keystore-url="${jboss-server.config.dir}/appdev-app.jks" truststore-url="${jboss-server.config.dir}/appdev-jboss-cacerts.jks"/>    

       

      org.app.security.auth.PasswordStoreEntry class contianed in a jar file and it was added in the common lib folder of JBoss 6. For Jboss 7, I created a module and added these jars in that module directory. But JBoss is showing class not found error. Any suggestions?

        • 1. Re: How to add jars in JBoss AS 7
          valsaraj007

          Above issue fixed when I copied the jar from my custom module to built in module jboss:domain:security. Is this the right way to fix it?

           

          The class org.app.security.auth.PasswordStoreEntry is using apache log4j and now the app server reporting log4j not found error.

          Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger from [Module "org.jboss.as.security:main" from local module loader @1d140071


          Do we need to add log4j jar also?

          1 of 1 people found this helpful
          • 2. Re: How to add jars in JBoss AS 7
            ksreen

            You can try to add a module dependency to you module in the security module's module.xml                   ...                                    Make sure you define your module and add its dependencies appropriately in the module.xml.

            1 of 1 people found this helpful
            • 3. Re: How to add jars in JBoss AS 7
              valsaraj007

              Fixed issues by adding a module and added jars in that module as <resource-root path="common.jar"/>. Earlier I used <resource-root path="."/> and this caused class not found.

               

              Then added explicit dependency in  security module to this static module because our security domain configuration used the class in the common.jar which was added in new module. There is no need to copy jar into security module, just need to set dependncy