JBoss Community

Re: Why datasource JNDI name has to start with 'java:/' or 'java:jboss/ in AS 7.1

created by blake ong in JNDI and Naming - View the full discussion

Our development team uses maven jetty plugin for our local environment, and our production uses JBoss EAP 6.1

 

All you need to do is to create a jboss-web.xml in your WEB-INF with something like below:

 

<resource-ref>

        <res-ref-name>jdbc/MyDS</res-ref-name>

        <jndi-name>java:jboss/jdbc/MyDS</jndi-name>

</resource-ref>

 

In our web.xml we have something like this:

 

<resource-ref>

        <res-ref-name>jdbc/MyDS</res-ref-name>

        <res-type>javax.sql.DataSource</res-type>

        <res-auth>Container</res-auth>

</resource-ref>

Reply to this message by going to Community

Start a new discussion in JNDI and Naming at Community