3 Replies Latest reply on Jan 30, 2008 1:27 AM by jaikiran pai

    Datasource name binding is behind Web deploy

    Jashua Ni Newbie

      Hi, I am try to deploy an application that was in Weblogic before for testing. I could not make it to work. There is problem I am facing. I tried to add jboss-web.xml to reference the datasources that are defined in *-ds.xml files. and aslo referenced in web.xml too. I did with several tries and binding is OK.

      But the name space is not available during war file deploy. From the start up directory console, I can see that those datasource name binding happen after my war file get deployed. And inside my web application during servlet start up, the code will need to access database to load values for caching.

      Is there a way to force binding happen first before deploy war file.

      thank you very much for expertise.

      Jashua

        • 1. Re: Datasource name binding is behind Web deploy
          jaikiran pai Master

          Which version of JBoss and Java are you using? Where have you placed the -ds.xml and your web application? And also post the relevant logs and the relevant content from web.xml and jboss-web.xml.

          • 2. Re: Datasource name binding is behind Web deploy
            Jashua Ni Newbie

            Thank you so much for your reply. I did not receive a email as I thought when somebody reply I will get email.

            I put the -ds.xml file inside the server\default\deploy dir.
            resource reference entry in web.xml:
            <resource-ref>
            <res-ref-name>TradeRTUDB</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>

            resource reference entry in jboss-web.xml:

            <resource-ref>
            <res-ref-name>TradeRTUDB</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <jndi-name>java:/TradeRTUDB</jndi-name>
            </resource-ref>

            Now, I take of the access datasource during servlet start up, it is OK for my application. But that is not ideal.

            Look forward to hearing from you soon.

            • 3. Re: Datasource name binding is behind Web deploy
              jaikiran pai Master

              Couple of questions:

              1) Whcih version of JBoss are you using?

              2) Where have you placed your war file? Is it in the deploy folder or some other folder? What's the name of your -ds.xml file and the WAR file?

              Some days back a similar question was answered at http://www.jboss.com/index.html?module=bb&op=viewtopic&t=128388.
              See the replies from Vicky and Adrian.

              However, if you still continue to have the same issue, do post back with the details.


              I did not receive a email as I thought when somebody reply I will get email.


              Had you selected the "Notify me when a reply is posted" check-box, available just below the message editor window, while posting?