7 Replies Latest reply on Jan 31, 2002 12:43 PM by David Jencks

    DataSource

    David Hickman Newbie

      I am trying to add an Oracle8 datasource, the services file I have put into the deploy directory is:
      <?xml version="1.0" encoding="UTF-8"?>



      <!-- put classes12.zip downloaded from OTN into the JBoss lib/ext directory !!! -->
      <!-- put this file into jboss_home/deploy -->




      ConnectionURL=jdbc:oracle:thin:@localhost:1521:brighton
      DriverClass=oracle.jdbc.driver.OracleDriver
      UserName=simteq
      Password=merlin

      Oracle_Simteq

      java:/TransactionManager

      <mbean-ref name="ResourceAdapterName">JCA:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter</mbean-ref>
      <mbean-ref name="ConnectionManagerFactoryLoaderName">JCA:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory</mbean-ref>

      #
      #Wed Aug 15 16:17:29 EDT 2001
      MinSize=0
      MaxSize=10
      BlockingTimeoutMillis=50000
      IdleTimeoutMinutes=30
      CleanupIntervalMinutes=10
      MaxIdleTimeoutPercent=1.0



      org.jboss.resource.security.ManyToOnePrincipalMapping


      userName="simteq" password="merlin"






      and the jaws.xml file in my WEB-INF directory starts with:

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

      Oracle_Simteq
      <type-mapping>Oracle8</type-mapping>
      false

      <default-entity>
      <create-table>false</create-table>
      <remove-table>false</remove-table>
      <tuned-updates>false</tuned-updates>
      <read-only>false</read-only>
      <time-out>300</time-out>
      <select-for-update>false</select-for-update>
      </default-entity>

      <type-mappings>
      <type-mapping>
      Oracle8

      <java-type>java.lang.Boolean</java-type>
      <jdbc-type>BIT</jdbc-type>
      <sql-type>NUMBER(1)</sql-type>


      however when I try to deploy an EJB using this datasource I get an error message Oracle_Simteq not bound, ANY IDEAS

        • 1. Re: DataSource
          David Jencks Master

          Are you using jboss 3?
          If you look at jndiview can you see your datasource bound?
          If you look at the server log, is the oracle service.xml deployed before your app?

          Are there any errors in the log?

          • 2. Re: DataSource
            Rob Parker Newbie

            I had a similar problem and I noticed in the startup messages that I was getting a class not found exception for the database driver.

            My work-around was to convert the classes.zip file to a classes.jar and drop it into the lib/ext dir...

            Still not sure why classes.zip isn't picked up...

            • 3. Re: DataSource
              David Hickman Newbie

              Thanks for tips, still a problem. I have reloaded the classes12.zip file as oracle.jar into the lib\ext directory. I am using JBoss 2.4.1, the server log shows oracle.jar being included in the classpath but nowhere else, no errors are displayed. When I try to run the monitor program in JBoss\admin to look at jndi I get a class not found error ie. javax.jms.MessageListener although the jar file containing this is in the classpath.

              Please help!!!

              • 4. Re: DataSource
                Klaus Thiele Newbie

                i had the same problem yesterday (with 2.4.3)...

                lib/ext/classes12 is ok.

                conf/jboss.jcml:
                add the oracle-driver to this entry:

                oracle.jdbc.driver.OracleDriver,org.hsqldb.jdbcDriver

                duplicate the sample for hypersonic and change the params for your needs:

                YourDS
                org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl

                jdbc:oracle:thin:@orahost:1521:SID
                1200000
                userid
                passwd
                10
                false
                false
                false
                true
                120000
                1800000
                false
                false
                1.0
                0


                hope that helps
                klaus

                • 5. Re: DataSource
                  David Hickman Newbie

                  Thanks for your help, this seems to do the trick.

                  • 6. Re: DataSource
                    Ping Ding Newbie

                    I am still confused here. If you modify the jboss.jcml and
                    add a mbean for a connection pool, it doesn't mean that you solved the data source problem. Here is my oracleds-service.xml and I placed it in jboss_home\deploy. I couldn't see any deploy info from the server.log when I start Jboss and no exception. Can anybody help?

                    <?xml version="1.0" encoding="UTF-8"?>
                    <!-- $Id: oracle-service.xml,v 1.2 2002/01/14 00:16:51 d_jencks Exp $ -->

                    <!-- =====================================================================-->
                    <!-- oracleds-service.xml -->
                    <!-- JBoss v3.0alpha (november 23, 2001) ORACLE thin driver Configuration -->
                    <!-- tested against ORACLE v8.x -->
                    <!-- ==================================================================== -->
                    <!-- -->
                    <!-- please put jdbc driver (in this case classes12.zip) in jboss_home/lib/ext -->
                    <!-- please put this file (oracleds-service.xml) under jboss_home/deploy -->
                    <!-- Contributed by Christian Biasuzzi bic@quinary.com-->
                    <!-- ===================================================================== -->







                    ConnectionURL=jdbc:oracle:thin:@qaserver:1521:ORACLE8
                    DriverClass=oracle.jdbc.driver.OracleDriver

                    OracleDB
                    java:/TransactionManager
                    <depends optional-attribute-name="ResourceAdapterName">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
                    <depends optional-attribute-name="ConnectionManagerFactoryLoaderName">jboss.jca:service=ConnectionManagerFactoryLoader,name=MinervaSharedLocalCMFactory
                    #
                    #Wed Aug 15 16:17:29 EDT 2001
                    BlockingTimeoutMillis=50000
                    IdleTimeoutMinutes=30
                    MaxSize=10
                    CleanupIntervalMinutes=10
                    MinSize=0
                    MaxIdleTimeoutPercent=1.0


                    org.jboss.resource.security.ManyToOnePrincipalMapping

                    userName=scott
                    password=tiger





                    • 7. Re: DataSource
                      David Jencks Master

                      oracle-service.xml is 3.0 ONLY. for 2.4 use the jboss.jcml suggestions. If you are using 3.0 check you have the correct tags for the version of jboss and that the object names in the depends/mbean-ref tags are EXACTLY the object names of the referred mbeans.