10 Replies Latest reply on Oct 23, 2012 7:20 AM by larito

    Installing JDBC drivers ojdbc14.jar

    larito

      Hello,

       

      I've been at this the whole moring and I just down know where I`m failing at. I'm trying to install a datasource with a ojdbc14.jar oracle driver. The deployment did not seem to work so now I'm trying to install it as a module

       

      module.xml

       

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

      <module xmlns="urn:jboss:module:1.1" name="oracle.jdbc">

          <resources>

              <resource-root path = ojdbc14.jar />

          </resources>

       

          <dependencies>

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

                      <!-- This one always goes last. -->

              <module name="javax.api" export="true"/>

          </dependencies>

      </module>

       


      The driver in the standalone.xml

       

      <driver name="OracleDriver" module="oracle.jdbc">

           <driver-class>oracle.jdbc.OracleDriver</driver-class>

           <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource

           </xa-datasource-class>

      </driver>

       

      The driver does not appear anywhere when I try to create the datasource through the admin console. I've even tried to code it in the standalone.xml like this:

       

      <datasource jndi-name="java:jboss/datasources/OracleDS" pool-name="OracleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:oracle:thin:@ip:port:sid</connection-url>

                          <driver>OracleDriver</driver>

                          <security>

                              <user-name>user</user-name>

                              <password>pass</password>

                          </security>

                      </datasource>


      But it gives me this error

       

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.OracleDriver (missing) dependents: [service jboss.data-source.java:jboss/datasources/OracleDS]

       

       

      Any ideas? thanks in advance

        • 1. Re: Installing JDBC drivers ojdbc14.jar
          wdfink

          How does your module path look like? Should be modules/oracle/jdbc/main/ and here module.xml and ojdbc.jar.

          Also I recommend ojdbc6.jar as '14' is for Java 1.4 and you should use Java6 as minumum for AS7.

           

          Also you might have a look to https://community.jboss.org/wiki/DataSourceConfigurationinAS7#Installing_a_JDBC_driver_as_a_module

          1 of 1 people found this helpful
          • 2. Re: Installing JDBC drivers ojdbc14.jar
            larito

            Thanks Wolf-Dieter Fink! My modules directory looks exactly as you described, and yes I have the module.xml and ojdbc14.jar

             

            I've read a lot of tutorials, and I've seen your suggestion about doing it with ojdbc6. The thing is, the app I'm about to deploy uses ojdbc14.jar so I don't know if this will produce any incompatibilities, and my oracle client has this .jar too so I don't know if this will be a problem (my senior would solve this pretty quiclky but he is on holidays and I have to solve this on my own)

            I have followed this tutorial too but it's not working: http://middlewaremagic.com/jboss/?p=350

             

            So If anyone can throws some light about different drivers in jboss and the app will be much appreciated

             

             

            I

            • 3. Re: Installing JDBC drivers ojdbc14.jar
              wdfink

              If you add ONLY the module.... and the <driver .... element in the standalone.xml (no datasource)

              you should see a similar message like this:

                INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

              that will be the confirmation of the successful driver installation.

              After that the datasource should be added without problems.

               

              You might try ojdbc6.jar without issues, does the app include ojdbc14.jar inside the ear/war?

              • 4. Re: Installing JDBC drivers ojdbc14.jar
                larito

                I'm trying with ojdbc6.jar right now, the driver has installed succesfully at least and now I was just about to configure the datasource.

                 

                Yes my application war has the ojdbc14.jar inside, can this generate any known problems?

                • 5. Re: Installing JDBC drivers ojdbc14.jar
                  wdfink

                  It depends on the class loading and may have issues.

                  If you use the datasource without a necessity to have special oracle features I would drop all dependencies from the application and install the driver and DS with the server installation.

                  • 6. Re: Installing JDBC drivers ojdbc14.jar
                    larito

                    The database is huge and the application dependes completely on it. I'm trying to configure the datasource (the driver is not giving any problems with 6) but I'm getting this error, although I supose I should start a differnt thread for it.


                    ERROR [org.jboss.jca.core.connectionmanager.pool.strategy.PoolBySubject] (HttpManagementService-threads - 3) IJ000614: Exception during createSubject() PB00024: Access Denied:Unauthenticated caller:null: java.lang.SecurityException: PB00024: Access Denied:Unauthenticated caller:null

                    • 7. Re: Installing JDBC drivers ojdbc14.jar
                      nickarls

                      PoolBySubject? Are we talking the same datasource config as shown in the original post? Does that come from an EJB invocation or is there any more stack traces to show?

                      • 8. Re: Installing JDBC drivers ojdbc14.jar
                        larito

                        Sorry Nicklas, yes there was a mistake in the configuration, the datasource has been now configured through the admin console instead of hardcoded in the standalone.xm with a ojdbc6 driver instead of ojdbc14

                         

                        Datasource:

                        <datasource jta="false" jndi-name="java:jboss/datasource/OracleDS" pool-name="OracleDS" enabled="true" use-ccm="false">

                                            <connection-url>jdbc:oracle:thin:@//host:port/sid</connection-url>

                                            <driver-class>oracle.jdbc.OracleDriver</driver-class>

                                            <driver>OracleDriver</driver>

                                            <security>

                                                <user-name>user</user-name>

                                                <password>pass</password>

                                                <security-domain>dom</security-domain>

                                            </security>

                                            <validation>

                                                <validate-on-match>false</validate-on-match>

                                                <background-validation>false</background-validation>

                                            </validation>

                                            <statement>

                                                <share-prepared-statements>false</share-prepared-statements>

                                            </statement>

                                        </datasource>

                         

                         

                        And this is the real error I've been gettin all morning

                         

                        12:54:13,775 ERROR [org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer] (MSC

                        service thread 1-8) Exception during createSubject()PB00024: Access Denied:Unauthenticated caller:null: java.lang.Securi

                        tyException: PB00024: Access Denied:Unauthenticated caller:null

                                at org.jboss.security.plugins.JBossSecuritySubjectFactory.createSubject(JBossSecuritySubjectFactory.java:89) [pi

                        cketbox-4.0.7.Final.jar:4.0.7.Final]

                                at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1019) [ironjacamar-deployers-

                        common-1.0.9.Final.jar:1.0.9.Final]

                                at org.jboss.jca.deployers.common.AbstractDsDeployer$1.run(AbstractDsDeployer.java:1014) [ironjacamar-deployers-

                        common-1.0.9.Final.jar:1.0.9.Final]

                                at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.6.0_31]

                                at org.jboss.jca.deployers.common.AbstractDsDeployer.createSubject(AbstractDsDeployer.java:1013) [ironjacamar-de

                        ployers-common-1.0.9.Final.jar:1.0.9.Final]

                                at org.jboss.jca.deployers.common.AbstractDsDeployer.deployDataSource(AbstractDsDeployer.java:562) [ironjacamar-

                        deployers-common-1.0.9.Final.jar:1.0.9.Final]

                                at org.jboss.jca.deployers.common.AbstractDsDeployer.createObjectsAndInjectValue(AbstractDsDeployer.java:282) [i

                        ronjacamar-deployers-common-1.0.9.Final.jar:1.0.9.Final]

                                at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService$AS7DataSourceDeployer.deploy(Abstract

                        DataSourceService.java:271) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]

                                at org.jboss.as.connector.subsystems.datasources.AbstractDataSourceService.start(AbstractDataSourceService.java:

                        111) [jboss-as-connector-7.1.1.Final.jar:7.1.1.Final]

                                at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-ms

                        c-1.0.2.GA.jar:1.0.2.GA]

                                at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.G

                        A.jar:1.0.2.GA]

                                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_31]

                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_31]

                                at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_31]

                        • 9. Re: Installing JDBC drivers ojdbc14.jar
                          nickarls

                          Are you sure the jdbc url should be /sid and not :sid (or is is the same thing)? And the security-domain is there for a reason?

                          1 of 1 people found this helpful
                          • 10. Re: Installing JDBC drivers ojdbc14.jar
                            larito

                            I took out the security domain, and now it works, I confused it with something in the configuration of my db and I was putting there a parameter good for nothing... I think I might cry, thank you very much both of you.

                             

                            Nicklas as I was desperate trying configurations I saw another option of configuring the url and I changed it. I haven't modified it and works with it written that way. Source: http://www.herongyang.com/JDBC/Oracle-JDBC-Driver-Connection-URL.html