[jboss-user] [JNDI/Naming/Network] - Sharing a global jndi data source with a local one for jstl
do-not-reply at jboss.com
Thu Oct 9 19:00:00 EDT 2008
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.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4181347#4181347
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4181347
More information about the jboss-user