The Java EE 7 Tutorial
3.3 Creating Resources Administratively
Before you deploy or run many applications, you may need to create resources for them. An application can include a
glassfish-resources.xml file that can be used to define resources for that application and others. You can then use use the
asadmin command, specifying as the argument a file named
glassfish-resources.xml, to create the resources administratively, as shown.
asadmin create-resources glassfish-resources.xml
glassfish-resources.xml file can be created in any project using NetBeans IDE, or by hand. Some of the JMS examples use this approach to resource creation. A file for creating the resources needed for the JMS simple producer example can be found in the
You could also use the
asadmin create-jms-resource command to create the resources for this example. When you are done using the resources, you would use the
asadmin list-jms-resources command to display their names, and the
asadmin delete-jms-resource command to remove them, regardless of the way you created the resources.