6 Replies Latest reply on Jun 23, 2006 3:06 AM by xjchen001

    JBOSS DataSource configuration for Oracle database

    xjchen001

      Hi, I am a newbie in JBoss. I have used BEA WebLogic 8.1 for a few months. Now I am trying to test my application in JBoss.
      I downloaded the JBoss-4.0.4-GA-Patch1-Installer and installed it with default settings.

      After that I tested a simple war file with a single jsp, and it works.

      Then I tried to deploy a bigger application into JBoss. This application is workable in WebLogic 8.1 SP2. It requires several connection pools and data sources. It is very easy to configure that in WebLogic 8.1. I read through http://docs.jboss.org/jbossas/jboss4guide/r5/html/ch7.chapt.html especially section 7.3 configuring JDBC datasources. Unfortunately, I don't quite understand. I then turned to the sample configuration. I copied %JBOSS_HOME%\docs\examples\jca\oracle-ds.xml to the %JBOSS_HOME%\server\default\deploy directory. And then modify the oracle-ds.xml to reflect my datasource configuration. One of the entry is as follows:

       <local-tx-datasource>
       <jndi-name>jdbc/evtDSLocal</jndi-name>
       <connection-url>jdbc:oracle:thin:@ddbssn01.asianconnect.com:1521:snd1</connection-url>
       <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
       <user-name>evt_username</user-name>
       <password>evt_password</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
       <metadata>
       <type-mapping>Oracle9i</type-mapping>
       </metadata>
       </local-tx-datasource>
      


      However, I still get the following exception when i start jboss after I deploy my ear file into %JBOSS_HOME%\server\default\deploy directory.

      deployer: org.jboss.deployment.EARDeployer@e2291
      status: Deployment FAILED reason: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: jdbc/evtDSLocal has no valid JNDI binding. Check the jboss-web/resource-ref.)


      What else I need to do to make it work?
      Where is the jboss-web/resource-ref? What's the path of the file?



      Regards,
      Xinjun

        • 1. Re: JBOSS DataSource configuration for Oracle database
          weston.price

          JBoss is telling you that in your web.xml file, you have an invalid JNDI binding to your datasource using a resource ref. Typically when moving from one application server (Weblogic/WAS). Could you post the portion of your web.xml file that has a reference to your datasource?

          • 2. Re: JBOSS DataSource configuration for Oracle database
            xjchen001

            Hi Weston,

            Thank you for your reply. I checked the web.xml in the war file. It reads the following:

            <resource-ref>
             <res-ref-name>jdbc/evtDSLocal</res-ref-name>
             <res-type>javax.sql.DataSource</res-type>
             <res-auth>Container</res-auth>
             </resource-ref>


            This configuration is workable in WebLogic Application Server. What may be the source of the error?


            Regards,
            Xinjun

            • 3. Re: JBOSS DataSource configuration for Oracle database
              weston.price

              You need a jboss-web.xml file that maps your resource ref name to the appropriate JNDI name of your datasource.

              • 4. Re: JBOSS DataSource configuration for Oracle database
                xjchen001

                Hi Weston,

                Thank you very much for your info.

                I realized that I am facing the problem of migrating application from WebLogic to JBoss. I googled and found that I need to modify the deployment descriptors for all the modules. This seems not a trivial process since WebLogic's and JBoss' deployment descriptors don't share the same schema.
                The following links may be helpful to developers who also want to do the migration.

                http://www.onjava.com/pub/a/onjava/2005/03/09/ejb-migration.html
                http://www.jboss.org/index.html?module=bb&op=viewtopic&t=71321



                Regards,
                Xinjun

                • 5. Re: JBOSS DataSource configuration for Oracle database
                  xjchen001

                  FollowUp questions: Failed to resolve ejb-link.

                  I have manually created jboss-web.xml and jboss.xml for war and ejb jars respectively. The previous errors are eliminated. However, I still cannot succeed in deploying the ear file.

                  The following is the error message. What else do I need to do?


                  --- MBeans waiting for other MBeans ---
                  ObjectName: jboss.j2ee:jndiName=local/WSGMSGEventSubscriberMDBean@11697208,service=EJB
                  State: FAILED
                  Reason: org.jboss.deployment.DeploymentException: Failed to resolve ejb-link:
                  WSGMSGEventSubscriberBean make by ejb-name: ejb/wsgmsg/WSGMSGEventSubscriberHome


                  ObjectName: jboss.web.deployment:id=-1959553856,war=wsgAdminRel1_0.war
                  State: FAILED
                  Reason: org.jboss.deployment.DeploymentException: URL file:/D:/software/jboss/
                  server/default/tmp/deploy/tmp31013wsgServerRel1_0.ear-contents/wsgAdminRel1_0-ex
                  p.war/ deployment failed

                  --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                  ObjectName: jboss.web.deployment:id=-1959553856,war=wsgAdminRel1_0.war
                  State: FAILED
                  Reason: org.jboss.deployment.DeploymentException: URL file:/D:/software/jboss/
                  server/default/tmp/deploy/tmp31013wsgServerRel1_0.ear-contents/wsgAdminRel1_0-ex
                  p.war/ deployment failed

                  ObjectName: jboss.j2ee:jndiName=local/WSGMSGEventSubscriberMDBean@11697208,service=EJB
                  State: FAILED
                  Reason: org.jboss.deployment.DeploymentException: Failed to resolve ejb-link:
                  WSGMSGEventSubscriberBean make by ejb-name: ejb/wsgmsg/WSGMSGEventSubscriberHome



                  Regards,
                  Xinjun

                  • 6. Re: JBOSS DataSource configuration for Oracle database
                    xjchen001

                    Hi,

                    I have eliminated the previous error by puting <ejb-ref>/<ejb-link> in the jboss.xml file.

                    However, I get the following error message.
                    This time, I really don't know what happened in JBoss.

                    --- MBeans waiting for other MBeans ---
                    ObjectName: jboss.web.deployment:id=134380030,war=wsgAdminRel1_0.war
                    State: FAILED
                    Reason: org.jboss.deployment.DeploymentException: URL file:/D:/software/jboss/
                    server/default/tmp/deploy/tmp1210wsgServerRel1_0.ear-contents/wsgAdminRel1_0-exp.war/ deployment failed

                    --- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
                    ObjectName: jboss.web.deployment:id=134380030,war=wsgAdminRel1_0.war
                    State: FAILED
                    Reason: org.jboss.deployment.DeploymentException: URL file:/D:/software/jboss/server/default/tmp/deploy/tmp1210wsgServerRel1_0.ear-contents/wsgAdminRel1_0-exp.war/ deployment failed



                    Regards,
                    Xinjun