4 Replies Latest reply on Jan 8, 2016 2:29 PM by zavier.rodriguez

    Oracle JDBC Driver Issue

    zavier.rodriguez

      Hello All, I'm hoping I can get some ideas with this issue.

       

      I have an oracle driver installed on my JBoss instance as a deployment.  This is the normal method I use for all projects.  This new project is having an issue with this install type although I tried to install it as a module and still having an issue using that method as well so I fear I may be overlooking something else.  JBoss starts without a problem and deploys the oracle driver jar.  Once I try to deploy my project, I get the error below.  I've tried different driver files and same error.  Other developers are able to deploy this project with this same setup.  Is there some other configuration that I am missing?

       

       

      11:47:40,488 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-10) MSC000001: Failed to start service jboss.module.service."deployment.project.war".main: org.jboss.msc.service.StartException in service jboss.module.service."deployment.project.war".main: JBAS018759: Failed to load module: deployment.cdsanalysis.war:main

        at org.jboss.as.server.moduleservice.ModuleLoadService.start(ModuleLoadService.java:94) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

      Caused by: org.jboss.modules.ModuleNotFoundException: com.oracle:main


      I am using the following driver:

       

      <dependency>

        <groupId>com.oracle</groupId>

        <artifactId>ojdbc6</artifactId>

        <version>11.2.0.3</version>

      </dependency>

        • 1. Re: Oracle JDBC Driver Issue
          jaysensharma

          For Error:  Caused by: org.jboss.modules.ModuleNotFoundException: com.oracle:main

          1. Try placing the ojdbc6.jar file in the following location:    "$JBOSS_HOME/modules/com/oracle/main/ojdbc6.jar"

          2. And then add the following kind of "$JBOSS_HOME/modules/com/oracle/main/module.xml"

           

          <?xml version="1.0" ?>
          <module xmlns="urn:jboss:module:1.1" name="com.oracle">
              <resources>
                  <resource-root path="ojdbc6.jar"/>
              </resources>
              <dependencies>
                  <module name="javax.api"/>
                  <module name="javax.transaction.api"/>
              </dependencies>
          </module>
          
          
          

          3. The restart your JBoss EAP.

           

           

           

          There is another error  "jboss.module.service."deployment.project.war".main: JBAS018759: Failed to load module: deployment.cdsanalysis.war:main"  that seems to be related to the above error.  So first try fixing the ModuleNotFoundException: com.oracle:main to see if it resolves the deployment failure issue.    As it looks like some your WAR "cdsanalysis.war" or "project.war" has a Dependencies declaration for the module "com.oracle" using either  $WAR/META-INF/MANIFEST.MF approach or using $WAR/WEB-INF/jboss-deployment-structure.xml  approach.       And as the module is not created properly hence it is causing the deployment failure.

           

          Regards

          Jay SenSharma

          • 2. Re: Oracle JDBC Driver Issue
            zavier.rodriguez

            Thank you very much Jay!  This solved the problem but I guess my follow up question is, why is this needed? 

             

            In the past, in other projects, I have been able to simply deploy the driver and specify the jar name in the datasource and JBoss put them together during application deployment.  Why is it necessary to add the driver and the module.xml to this location?

            • 3. Re: Oracle JDBC Driver Issue
              jaysensharma

              JBoss Enterprise Application Platform 6 uses a new modular class loading system for controlling the class paths of deployed applications. This system provides more flexibility and control than the traditional system of hierarchical class loaders. Developers have fine-grained control of the classes available to their applications, and can configure a deployment to ignore classes provided by the application server in favour of their own.

               

              The modular class loader separates all Java classes into logical groups called modules. Each module can define dependencies on other modules in order to have the classes from that module added to its own class path. Every deployment itself is considered as a module (Dynamic modulke)

               

               

              Even the JDBC drivers also can be deployed normally (like other WAR/EAR..etc)  JBoss EAP 6 allows you to deploy these drivers like any other deployment. This means that you can deploy them across multiple servers in a server group, if you use a managed domain.

               

              https://access.redhat.com/documentation/en-US/JBoss_Enterprise_Application_Platform/6.2/html-single/Administration_and_Configuration_Guide/index.html#sect-JDBC_Drivers

              • 4. Re: Oracle JDBC Driver Issue
                zavier.rodriguez

                Thanks very much!