title: How do I setup a jndi datasource in glassfish 3.1?
body: <p>I need to setup jndi datasource in my web application deployed on the glassfish server. I don't want to use glassfish admin console for creating connection pool and jndi datasource. (This works though.)</p>
  
  <p>I would want to use some xml files like context.xml (used in tomcat) to specify the jndi datasource details which will be bundled with the application war file. </p>
  
  <p>This way if I deploy my app war file I would not have to do any changes in the glassfish from the admin console. </p>
  
  <p>Please help.</p>
  
  <p>PS. I tried putting context.xml in war META-INF, but its not working. When I deploy my war on glassfish it says jndi name not found.</p>