This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When I create a DataResource for a project, sun-resources.xml gets generated. When I use the same resource in another project, I would like to see the same sun-resources.xml in the new project, just in case this resource needs to be regenerated on the server on deployment. How does one accomplish this? Thanks Leonid
What's DataResource? Is it a JPA/persitence stuff? sun-resources.xml is (I believe) generated by application server you are using with your project. In your case it is GlassFish, right?
It is GlassFish integration...
using the Files tab view, get this sun-resources.xml copy it and paste it in a same directory name on the other project. . Or do create one from scratch, use the File--->New...Template category, select GlassFish category and from there you can create all type or sun resources in a project
reopen if you feel this does not address your questions. Marking as fix as a response is provided.
The problem is that the sun-resources.xml gets updated when I do: "File--->New...Template category, select GlassFish category and from there you can create all type or sun resources in a project", But the additional icons for each resource which I create do not appear under the "Server Resources" category. I have seen them being created before. Not sure why it does not happen again. Thanks Leonid
The sun-resources.xml contains all the resources created for the project. There will be only one sun-resources.xml under 'Server Resources'. That is the expected behavior. The plugin does not create separate files for each resource anymore, hence there is only icon for the sun-resources.xml This changed quite some time ago during the 6.0 release. All the GlassFish resources that you created should be within the sun-resources.xml
If this is the correct behavior, we can close this issue. Thanks!
Expected behaviour
Some of my projects still have *.sun-resource icons under Server Resources. Why are they still shown in NB 6.1?
The *.sun-resource data would have been imported into the sun-resources.xml and when you deploy the project only the resources defined in the sun-resources.xml is registered. The *.sun-resource files are not deleted after importing the data. The import takes place when the projects are opened and not a good point to pop up any informational message to the user. So in order to prevent confusion if the *.sun-resource files are deleted, they were left in place. You should be able to delete the files. Since the data has been imported into the sun-resources.xml, it now contains the resources defined for the project.
Re. "The import takes place when the projects are opened and not a good point to pop up any informational message to the user." - my two cents: I would just delete old files. They were migrated to a new file and so there is no reason to keep them, no?