1 Reply Latest reply on Mar 17, 2005 1:22 PM by Francisco Gonzalez

    How to get jndi-name resource-ref be inserted in jboss-web.x

    Francisco Gonzalez Newbie

      Hi Everyone,

      I'm new to JBoss-IDE, but so far so good. I just have a question, I have a web application that I have created and it is using a resource-ref to a DataSource. And at the class level I have:

      @web.resource-ref name = "jdbc/TheDataSource"
       type = "javax.sql.DataSource"
       auth = "Container"
       jndi-name = "java:jdbc/datasource"
      


      Now, the web.xml DD gets the correct tags:

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


      But the tags that should go into the jboss-web.xml DD are not inserted. So, everytime I run XDoclet, I have to manually insert the tags:

       <resource-ref>
       <jndi-name>java:jdbc/datasource</jndi-name>
       <res-ref-name>jdbc/TheDataCollector</res-ref-name>
       </resource-ref>
      


      If I don't include those tags it won't deploy, of course.

      Does somebody know how to make XDoclet to populates correctly the resource-ref's in the jboss-web DD.

      Thanks for your time.

      Francisco.

        • 1. Re: [Fixed] How to get jndi-name resource-ref be inserted in
          Francisco Gonzalez Newbie


          I just fixed the "problem", actually I was assuming that the @web.resource-ref took care of the jboss-web DD to generate the resource-ref. But I need to use the @jboss.resource-ref to achieve that.

          The declaration is as follow

          @web.resource-ref name = "jdbc/TheDataSource"
           type = "javax.sql.DataSource"
           auth = "Container"
           jndi-name = "java:jdbc/datasource"
          
          @jboss.resource-ref jndi-name = "java:/jdbc/datasource"
           res-ref-name = "jdbc/TheDataSource"
          



          Regards,
          Francisco