users@glassfish.java.net

JDBC resource via JNDI

From: <glassfish_at_javadesktop.org>
Date: Thu, 08 Feb 2007 12:35:47 PST

Hi,

I have an application packed as an EAR file with two web modules and an EJB module,

One of my application is Eclipse's Birt Report viewer, which works just fine!
one of its features is to make all databases operations by retrieving a JDBC object via JNDI, thus eliminating the needs to put credentials in the report.

In the JNDO url I tried to specify something like:
java:comp/env/jdbc/edm where 'edm' is my jdbc defined resource, but it doesnt work,


I tried to add in 'sun-web.xml' a resource reference as follows:
<resource-ref>
<res-ref-name>jdbc/edm</res-ref-name>
<jndi-name>jdbc/edm</jndi-name>
</resource-ref>


but in deployment time, I get the following error:
---------------
        at com.sun.enterprise.management.deploy.DeployThread.run(DeployThread.java:210)
Caused by: java.lang.IllegalArgumentException: This web app [Eclipse BIRT Report Viewer]
has no resource reference by the name of [jdbc/edm]
        atcom.sun.enterprise.deployment.WebBundleDescriptor.getResourceReferenceByName(WebBundleDescriptor.java:622)
 ----------


Any suggestions?

Thanks,


Asaf.
[Message sent by forum member 'trouby' (trouby)]

http://forums.java.net/jive/thread.jspa?messageID=202713