The glassfish docs says:
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.
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:
Exception while preparing the app : Invalid resource : jdbc/malivechat-db-ds__pm
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.
Is there no way to bundle the glassfish-resources.xml file with our distributed .jar file?
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?
Either way, doing it the way glassfish docs says does not seem to work, or I've got something completely wrong.