BrianC
BrianC

Reputation: 31

glassfish-resources.xml does not deploy from Server Resources folder in Netbeans

I built a Java EE project in Netbeans much like their AffableBean tutorial, and when I try to deploy my WAR on a remote glassfish server, my db resources defined in glassfish-resources.xml are not created (connection pool and jdbc resource).

I look into the "build" directory of my project on my local hard drive and don't see the glassfish-resources.xml file anywhere. (It should be there, right?)

I see this bug http://netbeans.org/bugzilla/show_bug.cgi?id=200354 indicating that netbeans developers are aware of glassfish-resources not being packaged in some projects, but I'm not clear on what the resolution is/will be.

I see this question How to create a jms Topic and TopicConnectionFactory programatically?, with a great answer saying I should move glassfish-resrouces.xml into the Configuration Files folder of the project - but the IDE doesn't let me do that.

I see this excellent blog post https://blogs.oracle.com/JagadishPrasath/entry/application_scoped_resources_in_glassfish describing where the glassfish-resources.xml files should be for various purposes, but I don't know how to move my glassfish-resources.xml from the Server Resources folder using Netbeans.

My question is how do I get my db resources defined when I deploy to a remote server? Is the information in the WAR somewhere and I'm not deploying correctly? I was planning to create the connection pool and jdbc resource using the glassfish admin console, but I'd rather it be part of the WAR.

EDIT: I ended up building the connection pool and jdbc resource using the Glassfish admin console, and everything seems to be working well. I got no explanation from a similar post on a netbeans forum.

thanks

Upvotes: 3

Views: 5794

Answers (1)

D-Dᴙum
D-Dᴙum

Reputation: 7890

I've often wondered how to automatically create a database, connection pools etc. upon deplyoment and though glassfish-resources.xml would do this for me but I can't seem to find a concrete answer. It makes me wonder just exactly what is the purpose if the xml file if the resources have to be created by hand. However I came across this page and it appears the XML file can be parse by asadmin to create the resources without a long string of command line switches.

Upvotes: 2

Related Questions