7 Replies Latest reply on Jun 30, 2002 12:54 AM by davidjencks

    step by step Oracle Datasource setup

    gzhong

      Hi,
      Is that an FAQ or some other source of instruction where I can setup Oracle as the datasource for CMPs? I rummaged through this forum and I got as close as seeing Oracle DS registered on jboss but still my beans kick in an exception saying that OracleDS is not bound. So is there some step-by-step instruction with complete examples of what files need to be created?

      This is for JBoss 3.0. I got it working with JOnAs, no problem, but I want to give JBoss another try.

      Thanks,
      G

        • 1. Re: step by step Oracle Datasource setup
          bforeman

          Hi - I too have the same issue as you do. I've followed the threads and I get the same exception as you described. I even purchased the manual, but it's for an earlier version of JBoss. If anyone has a step by step example, of how to configure JBoss 3.0 to use an Oracle DB, I'd greatly appreciate it.

          • 2. Re: step by step Oracle Datasource setup
            agaona

            I had the same problem too. If you wanna give JBoss a chance please have a look into $JBOSS_DIST/server/default/conf/standardjbosscmp-jdbc.xml. You'll find the database-mapping name you're looking for (Oracle8, in my case).

            You'll need to modify $JBOSS_DIST/server/default/deploy/hsqldb-service.xml to add your DataSource. I couldn't find any doc on how to change this file so what I did was to copy the large mbean definition, changed the name of the LocalTxConnection and changed the url,driver, user and password settings.

            Don't forget to include your Oracle driver on the classpath or copy it to $JBOSS_DIST/server/default/lib

            I've come to the point where JBoss 'swallows' my JAR with no errors. I still have to test the bean in order to claim for victory. I'll give you an update on this matter anyway

            Enjoy

            • 3. Re: step by step Oracle Datasource setup
              agaona

              [Sorry if this message appears twice. I couldn't see it the first time I replied to it]

              If you want to give jboss-3.0.0 one more change please do the following:

              1) Read JBOSS_DIST/server/default/conf/standardjbosscmp-jdbc.xml and look for the database-mapping that works for you. Oracle8 works good for me. Use this mapping on your own jbosscmp-jdbc.xml
              2) Be sure that the oracle driver is in classpath or copied to JBOSS_DIST/server/default/lib
              3) Add a datasource to JBOSS_DIST/server/default/deploy/hsqldb-service.xml. Since I couldn't find documentation for this file I copied the large mbean element and changed the 'name on name' property on the mbean.

              Notice that the datasource is automatically deployed when you save it. You would like to see the deployment log to know that everything went well.

              Redeploy your JAR and see what happens. I've come to the point on wich JBoss swallows my JAR with no errors. I'll let you know if the bean works as intended.

              Enjoy

              • 4. Re: step by step Oracle Datasource setup
                prashantpatel

                Include a login module configuration named OracleDbRealm.
                Update your login-conf.xml, here is an example for a
                ConfiguredIdentityLoginModule:

                <application-policy name = "OracleDbRealm">
                <authentication>
                <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
                <module-option name = "principal">yourprincipal</module-option>
                <module-option name = "userName">yourusername</module-option>
                <module-option name = "password">yourpassword</module-option>
                <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</module-option>
                </login-module>
                </authentication>
                </application-policy>

                NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
                module-option name = "managedConnectionFactoryName"
                must match the object name of the ConnectionManager you are configuring here.
                I this necessary i guess yes.

                • 5. Re: step by step Oracle Datasource setup
                  prashantpatel

                  Include a login module configuration named OracleDbRealm.
                  Update your login-conf.xml, here is an example for a
                  ConfiguredIdentityLoginModule:

                  <application-policy name = "OracleDbRealm">

                  <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
                  <module-option name = "principal">yourprincipal</module-option>
                  <module-option name = "userName">yourusername</module-option>
                  <module-option name = "password">yourpassword</module-option>
                  <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=OracleDS</module-option>
                  </login-module>

                  </application-policy>

                  NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
                  module-option name = "managedConnectionFactoryName"
                  must match the object name of the ConnectionManager you are configuring here.
                  I this necessary i guess yes.

                  • 6. Re: step by step Oracle Datasource setup
                    larsinge

                    &lt;module-option name = "principal"&gt;yourprincipal&lt;/module-option&gt;


                    What is "principal"?

                    I did not write anything here, but it (Oracle 9i) still works with JBoss 3.1. What should I write here?

                    You also need to set up JAWS to use Oracle. If not, you are still using the Hypersonic DB (...I think).

                    • 7. Re: step by step Oracle Datasource setup
                      davidjencks

                      Read the quickstart guide from the sourceforge download page, and take a look at the examples in doc/examples/jca or if you have the source tree connector/src/etc/example-config.

                      I can't think of a good reason to require "principal", it isn't really used anywhere, but it is part of the spec, so you get to specify a value;-)