I'm a little confused on how I can get a datasource hooked up via JNDI for my web application. I'm used to working on Tomcat and to configure the JNDI, it was a matter of dropping an xml file into the server's conf directory but I'm having a difficult time getting my app to work inside JBoss.
I have my web.xml that refers to the JNDI resource name as such:
Resource reference to a factory for java.sql.Connection
instances that may be used for talking to a particular
database that is configured in the server.xml file.
I also have a jboss-web.xml which contains:
However, when Jboss starts up and loads my war file, it tells me that:
org.jboss.deployment.DeploymentException: Error during deploy; - nested throwable: (javax.naming.NamingException: resource-ref: jdbc/myDatabase has no valid JNDI binding. Check the jboss-web/resource-ref.)
Is there some other file I need to configure?Can someone tell me what needs to be done to associate my datasource via JNDI?
In JBoss, the datasource configuration file should be reside within the deploy directory of particular configuration with the extension as "*-ds.xml". For more information, look at this wiki page . http://wiki.jboss.org/wiki/Wiki.jsp?page=ConfigDataSources