3 Replies Latest reply on Aug 15, 2007 5:34 PM by wayne baylor

    datasource

    henry lu Newbie

      I got the following errors when I deploy my app with oracle datasource:

      8:05:32,718 WARN [ServiceController] Problem starting service jboss.web.deploy
      ent:war=aaa.war,id=-1582241627
      rg.jboss.deployment.DeploymentException: Error during deploy; - nested throwabl
      : (javax.naming.NamingException: resource-ref: java:mcv_test has no valid JNDI
      inding. Check the jboss-web/resource-ref.)
      at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:384)

      at org.jboss.web.WebModule.startModule(WebModule.java:83)
      at org.jboss.web.WebModule.startService(WebModule.java:61)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
      ...

      Here is my oracle-ds.xml file:

      <jndi-name>mcv_test</jndi-name>
      <connection-url>jdbc:oracle:thin:@123:1521:xxx</connection-url>
      <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
      <user-name>x</user-name>
      ......

      within the app, WEB-INF, I have jboss-web.xml:

      <jboss-web>
      <resource-ref>
      <res-ref-name>mcv_test</res-ref-name>
      <jndi-name>java:mcv_test</jndi-name>
      </resource-ref>
      </jboss-web>

      and app/WEB-INF/web.xml:

      <resource-ref>
      <res-ref-name>mcv_test</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      <res-sharing-scope>Shareable</res-sharing-scope>
      </resource-ref>

      Are there any idea how to fix the problem?

      -Henry

        • 1. Re: datasource
          wayne baylor Apprentice

          instead of "java:mcv_test" try "java:/mcv_test"

          • 2. Re: datasource
            henry lu Newbie

            it didn't work either.

            here is new app/WEB-INF/jboss-web.xml:

            <jboss-web>
            <resource-ref>
            <res-ref-name>mcv_test</res-ref-name>
            <jndi-name>java:/mcv_test</jndi-name>
            </resource-ref>
            </jboss-web>

            -Henry

            • 3. Re: datasource
              wayne baylor Apprentice

              on second thought, when you deploy the oracle-ds.xml JBoss will create the jndi entry for mcv_test. so you should be able to look it up without any resource-ref tags in your xml files.

              for example:
              my oracle-ds.xml

              <jndi-name>OracleDS</jndi-name>
               <connection-url>jdbc:oracle:thin:@localhost:1521:orcl</connection-url>
              


              and i can look it up with:
              DataSource ds = (DataSource)new InitialContext().lookup("java:/OracleDS");

              and i have no resource-ref tags in web.xml or jboss-web.xml.