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.

Bug 144171 - sun-resources.xml generation? How do I generate one?
Summary: sun-resources.xml generation? How do I generate one?
Status: RESOLVED WONTFIX
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Code (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Nitya Doraisamy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-16 18:41 UTC by shche123
Modified: 2008-08-28 21:40 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description shche123 2008-08-16 18:41:46 UTC
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
Comment 1 David Konecny 2008-08-26 03:24:24 UTC
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?
Comment 2 shche123 2008-08-26 03:41:34 UTC
It is GlassFish integration...
Comment 3 _ ludo 2008-08-26 04:59:19 UTC
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
Comment 4 _ ludo 2008-08-26 18:55:12 UTC
reopen if you feel this does not address your questions.

Marking as fix as a response is provided.
Comment 5 shche123 2008-08-26 22:13:39 UTC
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
Comment 6 Nitya Doraisamy 2008-08-26 23:28:56 UTC
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


Comment 7 shche123 2008-08-27 00:08:04 UTC
If this is the correct behavior, we can close this issue.
Thanks!
Comment 8 Nitya Doraisamy 2008-08-27 00:53:26 UTC
Expected behaviour
Comment 9 shche123 2008-08-28 04:13:00 UTC
Some of my projects still have *.sun-resource icons under Server Resources.
Why are they still shown in NB 6.1?

Comment 10 Nitya Doraisamy 2008-08-28 04:24:16 UTC
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.
Comment 11 David Konecny 2008-08-28 21:40:26 UTC
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?