1 Reply Latest reply on Sep 8, 2002 10:34 AM by Mikael Eriksson

    datasource not bound

    Mike Holdsworth Newbie

      I know there have been a lot of posts on this topic, and I have tried to follow them. Have purchased the documentation, but I seem to be none the wiser.

      I have an MSSQL-SERVICE JNDI entry defined as "pfm_dev".

      Using jmx-console, "pfm_dev" is surely resisted and it reports as being bound as JBOSS starts.

      I am trying to obtain this resource from a servlet running on the same VM as JBOSS via ctx.lookup ("pfm_dev") where I get a "pfm_dev" not bound error reported.

      After much hunting, my 3.0.2 server is configured with:
      WEB-INF/jboss-web.xml

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

      WEB-INF/web.xml
      <resource-ref>
      <res-ref-name>pfm_dev</res-ref-name>
      <res-type>javax.sql.DataSource</res-type>
      <res-auth>Container</res-auth>
      </resource-ref>

      I have also tried omitting the above resource entries, but to no avail.

      Sure I'm missing something obvious, but I can't see it.

      Any clues?
      m

        • 1. Re: datasource not bound
          Mikael Eriksson Novice



          > I am trying to obtain this resource from a servlet
          > running on the same VM as JBOSS via ctx.lookup
          > ("pfm_dev") where I get a "pfm_dev" not bound error
          > reported.

          Entries defined in the web.xml is always prefixed
          with java:/comp/env. So a lookup of
          ctx.lookup("java:/comp/env/pfm_dev")
          should succeed

          Regards

          > WEB-INF/web.xml
          > <resource-ref>
          > <res-ref-name>pfm_dev</res-ref-name>
          > <res-type>javax.sql.DataSource</res-type>
          > <res-auth>Container</res-auth>
          > </resource-ref>
          >