My web app is getting a data source from JNDI with:
javax.naming.InitialContext ctx = new javax.naming.InitialContext();
javax.sql.DataSource ds = (javax.sql
In my case, the solution below works fine for me.
I created a "Generic project" in Eclipse called "Resources". Inside this project I created a file dataSource.xml
with following content:
And I drag and drop this file for server configuration in Eclipse or create the line in server.xml
:
The file server.xml
was like this:
jsp-2.3
adminCenter-1.0
jdbc-4.1
jndi-1.0
servlet-3.1
${server.config.dir}