title: How to bundle glassfish-resources.xml with distributed .jar file?
body: <p>The <a href="http://docs.oracle.com/cd/E26576_01/doc.312/e24929/deploying-applications.htm#giydj" rel="nofollow">glassfish docs</a> says:</p>
  
  <blockquote>
    <p>An application-scoped resource is defined in the
    glassfish-resources.xml deployment descriptor file. This file is
    placed in the META-INF directory of the module or application archive.</p>
  </blockquote>
  
  <p>However, it does not seem to be the case. When I do, and deploy the .jar file to my Glassfish 3.1.2 server, he throws a couple of exceptions, and says:</p>
  
  <blockquote>
    <p>Exception while preparing the app : Invalid resource : jdbc/malivechat-db-ds__pm</p>
  </blockquote>
  
  <p>The JNDI name of my resource is actually "jdbc/malivechat-db-ds". So I do not understand where the underscore "__pm" comes from (?). However, if I add my resources separately, say I do this through the admin console or let Netbeans deploy the package for me, all works just fine.</p>
  
  <p><strong>Is there no way to bundle the glassfish-resources.xml file with our distributed .jar file?</strong></p>
  
  <p>The way I see it, it just have to be. Although adding resources seems to be application server specific (why? I mean why "glassfish-resources.xml" and not just "resources.xml"?), surely there should be a way to add all vendor specific *-resources.xml file to our .jar file and thus "support" a set of different application servers?</p>
  
  <p>Either way, doing it the way glassfish docs says does not seem to work, or I've got something completely wrong.</p>