Glassfish-resources.xml is not deployed from Server Resources folder in Netbeans

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

I am browsing the "build" directory of my project on my local hard drive and cannot see the glassfish-resources.xml file anywhere. (It should be there, right?)

I see this error http://netbeans.org/bugzilla/show_bug.cgi?id=200354 indicating that the netbeans devs are aware that some projects do not present packages from sea fish, m not clear what the resolution will be implemented.

I see this question How to create jms Topic and TopicConnectionFactory programmatically? , with a great answer saying that I should move glassfish-resrouces.xml to the Configuration Files folder of the project, but the IDE won'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 different purposes, but I don’t know Not sure how to migrate my glassfish- resources.xml from the Server Resources folder using Netbeans.

My question is, how can I determine the resources of my resource when deploying to a remote server? Is the information in the WAR somewhere and am I not deploying it correctly? I was planning to create a connection pool and jdbc resource using the Glassfish admin console, but I would prefer it to be part of the WAR.

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

thank

+3


source to share


1 answer


I often wondered how to automatically create database, connection pools, etc. by default, and although glassfish-resources.xml will do it for me, but I cannot find a specific answer. This makes me wonder what is the purpose of having an xml file if resources have to be created manually. However, I stumbled across this page and it seems that the XML file can be parsed using asadmin

to create resources without a long line of command line switches.



+2


source







All Articles