3

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

Community
  • 1
  • 1
BrianC
  • 31
  • 1
  • 4
  • Possible duplicate of [NetBeans - "sun-resources.xml" vs. "glassfish-resources.xml"](http://stackoverflow.com/questions/28256428/netbeans-sun-resources-xml-vs-glassfish-resources-xml) – kolossus May 18 '16 at 21:00

1 Answers1

2

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.

D-Dᴙum
  • 7,689
  • 8
  • 58
  • 97
  • 1
    However I package my `glassfish-resources.xml` file, GF won't pick up the resources. I used the command `asadmin add-resources glassfish-resources.xml` to add them. – Martin Andersson Jan 07 '14 at 18:16