3 Replies Latest reply on Oct 12, 2008 10:12 AM by dave potts

    Sharing a global jndi data source with a local one for jstl

    dave potts Newbie

      I have a postgres database define in default deploy directory as jdbc/foobar using the postgres-ds.xml file. This data source shows up when jboss boots.

      I have tried to access this from jsp using the jstl library by saying
      <sql:query var="foo" dataSource="jdbc/foobar">

      I get an error saying that no sutiable driver can be found, from the existing documentation it seems that the jstl library expects to find data sources in the local context and not the global context as defined by the postgres-ds.xml file.

      Its been sugested that I use the context.xml file in the META-INF directory of my war file, using the syntax

      <Resource name="jdbc/foobar" auth="Container" type="javax.sql.DataSource" username="xx" password="" driver blah blah />

      I would have expected jdbc/foobar to have show up in the java:comp/env context, but nothing was listed when jboss started up.

      I known from a strace log that jboss access tile file META-INF/context.xml from my web file, but nothing actual gets defined in the local jndi space.

      Have I over looked something vitial ? :( Is there any generic documentation or examples on this subject? it seems to be a rather common problem, but none of the suggested solutions worked in my case.