Registering and Deleting a Resource from the GlassFish Application Server
See Also
Once you have created a resource object, the resource needs to be registered with the server.
Once registered, the object is available to all the applications and resources.
Resources are automatically registered with the server when the project is deployed.
When you create a resource object for a project with the New File wizard,
the resource name and properties are added to the file sun-resources.xml.
You can edit sun-resources.xml in the Source Editor to modify resource properties.
To open the sun-resource.xml in the Source Editor,
double-click the file in one of the following places:
- In the Projects window, under the Server Resources node
- In the Files window, in the setup directory
Note.
- Alternatively, you can create resources in the Admin Console of the server.
After you create a resource on the server, the resource will appear in the Services window.
After the object is registered with the server it is visible in the Services window under the Servers node
under the node corresponding to the type of resource. You can modify some of the properties of the resource
object by opening the properties window for the object.
To delete a resource from the server:
- Locate the object you wish to delete in the Services window.
- Right-click on the object and select Delete Resource.
When you delete a resource from the server it is no longer visible in the Services window.
Notes:
- If you create a resource in your project, removing the resource from the server does not delete it from your project.
The resource is still defined in sun-resources.xml until you modify the file and remove it.
If you do not remove the resource definition in sun-resources.xml, the resource will be created again when you deploy your project.
- The JNDI name for a resource must be unique. To change the JNDI name,
open sun-resources.xml in the Source Editor and modify the name.
- See Also
- Working with the GlassFish Application Server
Legal Notices