5 Replies Latest reply on May 8, 2007 4:16 PM by Bill Burke

    Problem deploying Oracle datasource

    Dirk Estievenart Newbie

      Can anybody explain how to create a datasource in Embedded JBoss?

      I copy an oracle-ds.xml into the deploy folder (which works fine in JBoss4 and 5), but in the embedded JBoss I get following error:

       [junit] WARN 20-04 12:46:45,270 (JDBCPersistenceManager.java:start:143) -
       [junit]
       [junit] JBoss Messaging Warning: DataSource connection transaction isolation should be READ_COMMITTED, but it is currently NONE.
       [junit] Using an isolation level less strict than READ_COMMITTED may lead to data consistency problems.
       [junit] Using an isolation level more strict than READ_COMMITTED may lead to deadlock.
       [junit]
       [junit]
       [junit] *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
       [junit]
       [junit] jboss.jdbc:datasource=ApsysDS,service=metadata
       [junit] -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}
       [junit] -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
       [junit]
       [junit] jboss.jdbc:datasource=GP3DS,service=metadata
       [junit] -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
       [junit] -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}
       [junit]
       [junit]
       [junit] *** CONTEXTS IN ERROR: Name -> Error
       [junit]
       [junit] jboss.jdbc:service=metadata -> ** NOT FOUND **
       [junit]
       [junit] )
       [junit] Tests run: 0, Failures: 0, Errors: 1, Time elapsed: 7.969 sec


      Looks like I'm missing an MBean, but I can't figure out which one or how to fix it.

        • 1. Re: Problem deploying Oracle datasource
          Dirk Estievenart Newbie

          Solution:

          I moved the configuration to a jboss-ds.xml in the META-INF folder of the project (and the Oracle driver).

          The jboss-ds.xml format is as usual:

          <?xml version="1.0" encoding="UTF-8"?>
          
          <datasources>
           <local-tx-datasource>
           <jndi-name>MyDS</jndi-name>
           <connection-url>jdbc:oracle:thin:@server:1521:db</connection-url>
           <driver-class>oracle.jdbc.OracleDriver</driver-class>
           <user-name>myuser</user-name>
           <password>myPass</password>
           <min-pool-size>0</min-pool-size>
           <max-pool-size>20</max-pool-size>
           <idle-timeout-minutes>0</idle-timeout-minutes>
           <prepared-statement-cache-size>32</prepared-statement-cache-size>
           </local-tx-datasource>
          </datasources>
          


          Note that if you use the same datasource in different modules/applications, you should take care to not define them twice!



          • 2. Re: Problem deploying Oracle datasource
            Rustam Bogubaev Newbie

            move your jboss-ds.xml file to <embedded-jboss-home>/bootstrap/deploy directory and be sure that you have Oracle's JDBC drivers in your classpath or <embedded-jboss-home>/lib directory

            --
            rustam bogubaev

            • 3. Re: Problem deploying Oracle datasource
              Rustam Bogubaev Newbie

              your error already explained in your output :-)

               [junit] *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State}
               [junit]
               [junit] jboss.jdbc:datasource=ApsysDS,service=metadata
               [junit] -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}
               [junit] -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
               [junit]
               [junit] jboss.jdbc:datasource=GP3DS,service=metadata
               [junit] -> jboss.jdbc:service=metadata{Create:** NOT FOUND **}
               [junit] -> jboss.jdbc:service=metadata{Start:** NOT FOUND **}
              


              so you have to add these missing data sources into you jboss-ds.xml

              <?xml version="1.0" encoding="UTF-8"?>
              
              <datasources>
               <local-tx-datasource>
               <jndi-name>MyDS</jndi-name>
               <connection-url>jdbc:oracle:thin:@server:1521:db</connection-url>
               <driver-class>oracle.jdbc.OracleDriver</driver-class>
               <user-name>myuser</user-name>
               <password>myPass</password>
               <min-pool-size>0</min-pool-size>
               <max-pool-size>20</max-pool-size>
               <idle-timeout-minutes>0</idle-timeout-minutes>
               <prepared-statement-cache-size>32</prepared-statement-cache-size>
               </local-tx-datasource>
              
               <local-tx-datasource>
               <jndi-name>
               ApsysDS
               </jndi-name>
               <connection-url>jdbc:oracle:thin:@server:1521:db</connection-url>
               <driver-class>oracle.jdbc.OracleDriver</driver-class>
               <user-name>myuser</user-name>
               <password>myPass</password>
               <min-pool-size>0</min-pool-size>
               <max-pool-size>20</max-pool-size>
               <idle-timeout-minutes>0</idle-timeout-minutes>
               <prepared-statement-cache-size>32</prepared-statement-cache-size>
               </local-tx-datasource>
               <local-tx-datasource>
               <jndi-name>
               GP3DS
               </jndi-name>
               <connection-url>jdbc:oracle:thin:@server:1521:db</connection-url>
               <driver-class>oracle.jdbc.OracleDriver</driver-class>
               <user-name>myuser</user-name>
               <password>myPass</password>
               <min-pool-size>0</min-pool-size>
               <max-pool-size>20</max-pool-size>
               <idle-timeout-minutes>0</idle-timeout-minutes>
               <prepared-statement-cache-size>32</prepared-statement-cache-size>
               </local-tx-datasource>
              
              </datasources>
              


              --
              rustam bogubaev

              • 4. Re: Problem deploying Oracle datasource
                Dirk Estievenart Newbie

                Hi Rustam,

                Maybe I have explained the problem badly. It's exactly the way like you describe that doesn't work for me ("global deployment").

                I'm close to a deadline, so I don't have time to look into to it further right now, but I will and come back to this post later on.

                Thanks for your help, Rustam.

                • 5. Re: Problem deploying Oracle datasource
                  Bill Burke Master

                  thanks pyctam, whoever you are !