13 Replies Latest reply on Jul 4, 2013 4:02 AM by kalidas

    Custom module not loading libraries

    kalidas Newbie

      More than 30 application porting from tomcat to Jboss as 7.1.2 , want to use common library feature of jboss as 7 .

      In our applications we are not using Datasource interface, getting connection from my main class.


      To achive same we have created one module in the modules directory of Jboss as 7 and accessing that

      module in our application(all WAR structure) by adding jboss-deployment-structure.xml into META-INF folder of application.






      <module name="com.test"/>







      but the problem we are facing is that at a time only one application is able to access ojdbc14.jar to make connection with oracle database.

      for second application we are getting " java.sql.SQLException: ORA-00942: table or view does not exist".


      If we adding all jars into application lib (WEB-INF/lib) then we are not getting above exception , able to access both the application.


      Pleas, advised on the common library feature of Jboss 7 to achieve same.

        • 1. Re: Custom module not loading libraries
          Stephen Coy Master

          Is that really your jboss-deployment-structure.xml? It is not well formed XML. Also, you need to get rid of the indicated jars from the module:

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

                  <resource-root path="ajaxtags-1.5.jar"/>

                  <resource-root path="ajaxtags-resources-1.5.jar"/>

                  <resource-root path="itextpdf-5.0.5.jar"/>

                  <!-- Insert resources here -->

                  <resource-root path="annotations-api.jar"/>

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

                  <resource-root path="cas-client-core-3.1.3.jar"/>

                  <resource-root path="commons-beanutils.jar"/>

                  <resource-root path="commons-collections-3.2.jar"/>

                  <resource-root path="commons-dbcp-1.2.1.jar"/>

                  <resource-root path="commons-digester.jar"/>

                  <resource-root path="commons-el.jar"/>

                  <resource-root path="commons-fileupload-1.2.jar"/>

                  <resource-root path="commons-fileupload.jar"/>

                  <resource-root path="commons-io-1.3.2.jar"/>

                  <resource-root path="commons-io.jar"/>

                  <resource-root path="commons-lang-2.4.jar"/>

                  <resource-root path="commons-logging-1.1.jar"/>

                  <resource-root path="commons-logging.jar"/>

                  <resource-root path="commons-pool-1.3.jar"/>

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

                  <resource-root path="ecj-3.3.1.jar"/>

                  <resource-root path="ecj-3.7.jar"/>

                  <resource-root path="el-api.jar"/>

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

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

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

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

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

                  <resource-root path="jasper-el.jar"/>

                  <resource-root path="jaxb-xjc.jar"/>

                  <resource-root path="jaxb-impl.jar"/>

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

                  <resource-root path="jasper-jdt.jar"/>

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

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

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

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

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

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

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

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

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

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

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

               <resource-root path="log4j-1.2.14.jar"/>

               <resource-root path="log4j-1.2.15.jar"/>

               <resource-root path="log4j-1.2.5.jar"/>

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

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

               <resource-root path="opensaml-1.1.jar"/>

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

               <resource-root path="pager-taglib.jar"/>

               <resource-root path="quartz-1.8.6.jar"/>

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

          <!--     <resource-root path="struts-el.jar"/>-->

               <resource-root path="struts-legacy.jar"/>

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

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

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

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

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

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

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

               <resource-root path="xmlsec-1.3.0.jar"/>

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

               <resource-root path="commons-validator-1.1.4.jar" />

               <resource-root path="jaxws-api.jar"/>


          Those jars contain classes that are provided by JBossAS and it's not normally a good idea to try and overide them. There's also duplicates which I have italicised.

          • 2. Re: Custom module not loading libraries
            kalidas Newbie

            Hi stephen,


            I have removed all the indicated jars from my module.xml, but still the "ORA-00942: table or view does not exist" exception is occuring

            If i am adding the jars in my application lib then oracle connection is happening and able to access application.


            I think Jboss 7 container is not providing the multiconnection to the DB drivers for multiple application from common module.


            My correct Jboss-deployment-structure.xml file:





                  <module name="com.test"  />





            • 3. Re: Custom module not loading libraries
              Wolf-Dieter Fink Master

              For me it looks more like a application problem.

              As the ORA error indicate that the connection to the database is correct established.


              I would test where exact the error happen, what happen if you use invalid connection credentials ...

              • 4. Re: Custom module not loading libraries
                Stephen Coy Master

                Do you use the oracle "thin" driver or the "oci" driver?


                If it's the latter then you need to setup the shared native libraries correctly in your module.

                • 5. Re: Custom module not loading libraries
                  kalidas Newbie

                  When i deploy only one application and passing invalid connection credenital then getting following exception "java.sql.SQLException: ORA-01017: invalid username/password; logon denied"

                  which is correct.


                  But when i have two application deployed on the server and in which one application have invalid connection credential then getting "java.sql.SQLException: ORA-00942: table or view does not exist" for that application.

                  • 6. Re: Custom module not loading libraries
                    kalidas Newbie

                    Stephen, we are using the oracle "thin" driver and  my connection URL is "jdbc:oracle:thin:@"

                    • 7. Re: Custom module not loading libraries
                      Scott Marlow Master

                      What is the tablename that you are trying to access?  Does the table already exist or are you expecting it to be created during application deployment?  How are you accessing the table?  Via JDBC code that you have written?  Hibernate native API code perhaps?  Or JPA?

                      • 8. Re: Custom module not loading libraries
                        kalidas Newbie

                        Scott, Table is already exist , accessing the table by using the JDBC code .


                        As i earlier said that if i am putting the all jars in my application lib including DB driver jars, then application working properly not getting any ORA exception.

                        • 9. Re: Custom module not loading libraries
                          Scott Marlow Master

                          Sounds like an easy problem to track down then.  Just add debug prints to your JDBC code that uses DatabaseMetaData.getTables() and work backwards from the information printed (with and without "all the jars" in the application). 

                          • 10. Re: Custom module not loading libraries
                            Stephen Coy Master

                            Where does your application get it's connection URL from? Is it possible it has loaded a different  value from somewhere?

                            • 11. Re: Custom module not loading libraries
                              kalidas Newbie

                              Stephen, Its getting connection URL from ${example}.ini file and we initialising this file from web.xml of our application,



















                              Its not loading different value from anywhere , this is the file from where its picking connection URL.

                              • 12. Re: Custom module not loading libraries
                                Stephen Coy Master

                                Please show the full stack trace and the java code fragment around the location that the exception is being thrown.

                                • 13. Re: Custom module not loading libraries
                                  kalidas Newbie

                                  Hi Stephen,


                                  The problem is with my application specific custom jar, in my custom jar i have written some static varibales which initialize at the time of application deployment .

                                  After putting my custom jar(Application specific) into WEB-INF/lib and referring all other jars from custom module("com.test") , now the earliar issue is got resolved and now not getting any ORA exception as well.


                                  Thanks for all your prompt reply.