8 Replies Latest reply on Oct 29, 2002 7:21 PM by Gayathri Vidyasankar

    Oracle DataSource

    Mary Ann Wayer Newbie

      I'm sorry if this is a stupid question. I am trying to evaluate JBoss for our companies application server. I have purchased the new JBoss book but the chapter on data sources just is not clear.

      In my evaluation I am using EJB's built using JBuilder and the JBoss plug-in. When I run the application it is connecting to the default DS not the datasource that I defined in JBuilder. I know that I need to define the datasource in one of the JBoss configuration files but I really do not know how to set up the configuration.

      I will be most grateful for any help and I promise that if JBoss passes my evaluation we will pay for support.

        • 1. Re: Oracle DataSource
          David Jencks Master

          You don't say which jboss version you are using, nor what your evaluation is based on.

          The quick easy way to get your ejbs to work with a datasource is to remove the DefaultDS configuration and replace it with the config for your datasource, making sure your ds's jndiName is DefaultDS. Then you don't have to mess with any other config files and your ejbs may well deploy without any jboss specific deployment descriptors. The DefaultDS configuration is in conf/default/jboss.jcml in 2.4.x and server/[config]/deploy/hsqldb-service.xml in 3.0.1 (.../hsqldb-ds.xml in 3.2 and 4)

          If you want to use a different jndi name, you will have to traverse the jndi indirection maze with the entries in ejb-jar.xml and jboss.xml. If you are using cmp you need to set the ds in jaws.xml (cmp1.1 beans) or jbosscmp-jdbc.xml (cmp2 beans). I find consulting the jndiview mbean most helpful when I forget how to do this: point your browser at port 8082 (2.4.x) or 8080/jmx-console (3.x, 4), find and click on the jndiview mbean, and press list. There are instructions on how to do this in the book and (obsolete) free online manual.

          • 2. Re: Oracle DataSource
            Mary Ann Wayer Newbie

            I am using JBoss 3.0

            I am evaluating Sun's, Oracle and IBM's application server. The test that I am doing is creating a CMP Entity bean that maps to an existing table in an oracle database.

            I am looking for overall performance, ease of use and how well JBuilder works with the application server.

            I have change DefaultDS to my oracle datasource but I am getting an item not found from the find by primary key. I am sure that I am sure that I have a mistake somewhere in my configuration.

            • 3. Re: Oracle DataSource
              Mary Ann Wayer Newbie

              Thank you for your help I have successfully reconfigured the default DS to point to oracle. I am very impressed with the speed of the JBoss application server

              • 4. Re: Oracle DataSource
                David Jencks Master


                Just to give you more unsolicited advice, many jboss users and developers like to use xdoclet to generate all the ejb debris from one source file rather than using wizards in ides such as jbuilder. My (limited) experience is that the wizards are fine for one or 2 beans but that the xdoclet code generation procedure is easier to maintain and fits into large scale build processes better. xdoclet also generates far more than ejb stuff, we use it extensively in the jboss build for such things as mbeans.

                • 5. Re: Oracle DataSource
                  Praveen Newbie


                  Thanks for your input.

                  I did just like you mentioned. It failed at deployment stage. it is saying
                  ' Trying to install an already registered mbean: jboss.jca:service=LocalTxCM,name=hsqldbDS'

                  can you please tell me why ?


                  • 6. Oracle DataSource
                    Gayathri Vidyasankar Newbie

                    Could someone help me out.
                    I am using jboss 3.0.1 and Oracle 9i.
                    I am getting this error when I try to deploy the ejbs.
                    I see so many of you have data sources configured successfully.
                    The error is
                    org.jboss.deployment.DeploymentException: Error: can't find data source: java:OracleDS; - nested thr
                    owable: (javax.naming.NameNotFoundException: OracleDS not bound).

                    • 7. Re: Oracle DataSource
                      Johann Schipfer Newbie

                      I guess you did not deploy the datasource (or at least you didn't assign the proper JndiName).
                      In directory /usr/jboss-3.0.3/docs/examples/jca you find an example how to configure your datasource (oracle-service.xml). For JndiName you may want to choose 'OracleDS' (your EJBs seem to expect it that way), adapt the ConnectionURL, UserName and Password (maybe you also want to configure the connection pool) and deploy it by copying it in your $JBOSS_HOME/server/.../deploy directory.

                      • 8. Re: Oracle DataSource
                        Gayathri Vidyasankar Newbie

                        Thanks. There was not any problem with the configuration.
                        The problem was with the database URL.