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.
Customer with enterprise pack reported seeing his modifications to sun-ejb-jar.xml deleted. He is not sure exactly what steps though it might be related to version control. He is using JavaEE5 and the contents of the file included security-role-mapping and web-service security settings. He says it has happened more than once and has also happened to a coworker. See http://www.netbeans.org/servlets/ReadMsg?list=nbentpack&msgNo=141 and http://www.netbeans.org/servlets/ReadMsg?list=nbentpack&msgNo=148
I think this is related to a autosave event somehow being triggered before sun-ejb-jar.xml has been fully loaded and/or annotation events not being sent or sent incorrectly. Today I wrote a patch that generalizes the fix for issue 78686 & issue 84549 to all named beans that we have DConfigBean children for. This should prevent the config editor from destroying data when an expected DConfigBean has not been created for any reason. I am still testing the fix and will check it into release55_dev as soon as I can, probably sometime tomorrow. I filed this as a P1 due to the seriousness of the issue and the fact that a customer has actually reported what previously had been suggested was a pathological edge condition. If this fix can be approved for inclusion in NetBeans 5.5 FCS it would be most helpful. Also, I will see what I can do to describe a scenario that will deliberately cause this behavior (so the effect of the patch can be tested).
Created attachment 35025 [details] Patch as described in above comments.
I think the patch is complete but I'd still need to do some more code reviews -- that diff may contain some extra stuff like extraneous println's because the internal cvs tunnel I normally use is down (nice timing, 24 hours and counting...) and I switched just that one dir over to the czech tunnel to get the diff.
Created attachment 35029 [details] Patch for this issue.
The change looks quite extensive, who would be the best to review it? Also, Can you get confirmation from the reporter that the fix solves the issue? Thanks.
Vince is reviewing the changes this afternoon.
Here is one way to artificially produce dataloss with NetBeans 5.5 RC1 (which would not have this patch of course): This will work best if this is the only project loaded, as it is a bit time sensitive. Create a web project. Add a web service. Open the configuration editor for sun-web.xml, locate the service and configure some security settings. Select "Edit As XML", save, and confirm that in sun-web.xml, a servlet entry with a webservice endpoint containing the aforementioned security settings was correctly saved. Exit the IDE and now delete your MDR cache [userdir/var/cache] folder. *** The following steps must be completed before the startup scan is finished (and hopefully it will have to scan all the JDK so you have a bit of time) *** 1. Restart the IDE 2. Open sun-web.xml in the config editor again. 3. Modify some field, for example, set an error-url value on the main customizer. 4. Save sun-web.xml 5. Select "Edit as XML" and you should see that your servlet w/ web service endpoint settings, there previously, are not gone. A misguided DDBean change event or remove event from the merged annotation-dd provider could also cause this problem, especially if the configuration UI is not open because the effects of such changes cause the model to save to disk. The reason it is designed this way is legacy related to the original NB 3.6 DDAPI and AS 8.0 beta one Deploytool. The reason the proposed fix resolves such dataloss issues is because it caches data for potential child DConfigBeans in such a way that the data written back out again if at the time of the save request, such children have not yet been created.
Vince has done an initial review of my changes and approved them for initial commit to release55_dev codeline.
Committed to release55_dev http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebServices.java?r1=1.1.4.2.2.4.12.1&r2=1.1.4.2.2.4.12.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbRef.java?r1=1.1.16.2.2.4.16.1&r2=1.1.16.2.2.4.16.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Base.java?r1=1.1.16.4.2.7.6.1&r2=1.1.16.4.2.7.6.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ServiceRef.java?r1=1.1.16.2.2.4.12.1&r2=1.1.16.2.2.4.12.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/AppRoot.java?r1=1.1.16.4.2.7.6.2&r2=1.1.16.4.2.7.6.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebAppRoot.java?r1=1.1.16.5.2.8.10.2&r2=1.1.16.5.2.8.10.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/BaseRoot.java?r1=1.1.16.4.2.4.16.2&r2=1.1.16.4.2.4.16.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/AppClientRoot.java?r1=1.1.4.8.10.1&r2=1.1.4.8.10.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/BaseEjb.java?r1=1.1.16.2.2.6.16.1&r2=1.1.16.2.2.6.16.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/SecurityRoleMapping.java?r1=1.1.16.1.2.4.10.2&r2=1.1.16.1.2.4.10.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ServletRef.java?r1=1.1.16.2.2.3.16.1&r2=1.1.16.2.2.3.16.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbJarRoot.java?r1=1.1.16.6.2.11.6.3&r2=1.1.16.6.2.11.6.4 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/MessageDestination.java?r1=1.1.2.2.16.1&r2=1.1.2.2.16.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebServiceDescriptor.java?r1=1.4.2.2.2.12.6.2&r2=1.4.2.2.2.12.6.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/MessageDestinationRef.java?r1=1.1.2.2.16.1&r2=1.1.2.2.16.2
Also... http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ResourceEnvRef.java?r1=1.1.16.1.2.3.16.1&r2=1.1.16.1.2.3.16.2 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ResourceRef.java?r1=1.1.16.2.2.5.16.1&r2=1.1.16.2.2.5.16.2
Oops, in step 5 of the steps described, a few comments, above, it should read: 5. Select "Edit as XML" and you should see that your servlet w/ web service endpoint settings, there previously, are now gone.
Additional info: The Configuration Editor has child DConfigBeans for the following descriptor entries: servlet, ejb [session, message-driven, entity], ejb-ref, resource-ref, resource-env-ref, service-ref, security-role-mapping, message-destination-ref, webservice-description (from webservices.xml) So extrapolate the "instructions to reproduce", above, to an example that has any combination of the above items (e.g. a Servlet or EJB using resource injection, for example).
verified in release55_dev cont. build 20061010-0819 One observation: webservice node in sun-web.xml is missing until classpath scanning is finished. Is this correct behavior?
Unfortunately, yes. The merged annotation-dd provider is dependent on the class scan for the annotation information so it cannot notify the plugin about the annotation related webservice information until the scan is finished (or any other descriptor entries driven by annotations, e.g. annotated EJB's, resource injection, and web service clients.)
Vince found a minor naming bug, which I fixed - committed to release55_dev. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebServiceDescriptor.java?r1=1.4.2.2.2.12.6.3&r2=1.4.2.2.2.12.6.4
Committed to release55 branch.
http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/AppClientRoot.java?r1=1.1.4.8&r2=1.1.4.9 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/AppRoot.java?r1=1.1.16.4.2.8&r2=1.1.16.4.2.9 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Base.java?r1=1.1.16.4.2.7&r2=1.1.16.4.2.8 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/BaseEjb.java?r1=1.1.16.2.2.6&r2=1.1.16.2.2.7 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/BaseRoot.java?r1=1.1.16.4.2.5&r2=1.1.16.4.2.6 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbJarRoot.java?r1=1.1.16.6.2.12&r2=1.1.16.6.2.13 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbRef.java?r1=1.1.16.2.2.4&r2=1.1.16.2.2.5 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/MessageDestination.java?r1=1.1.2.2&r2=1.1.2.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Attic/MessageDestinationRef.java?r1=1.1.2.2&r2=1.1.2.3 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ResourceEnvRef.java?r1=1.1.16.1.2.3&r2=1.1.16.1.2.4 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ResourceRef.java?r1=1.1.16.2.2.5&r2=1.1.16.2.2.6 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/SecurityRoleMapping.java?r1=1.1.16.1.2.5&r2=1.1.16.1.2.6 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ServiceRef.java?r1=1.1.16.2.2.4&r2=1.1.16.2.2.5 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/ServletRef.java?r1=1.1.16.2.2.3&r2=1.1.16.2.2.4 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebAppRoot.java?r1=1.1.16.5.2.9&r2=1.1.16.5.2.10 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebServiceDescriptor.java?r1=1.4.2.2.2.13&r2=1.4.2.2.2.14 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/WebServices.java?r1=1.1.4.2.2.5&r2=1.1.4.2.2.6
Commit to release55 branch reverted. While contructing projects as test data for a functional test for this patch, I uncovered a number of regressions in the merged annotation-dd provider (to be filed). The effect of this patch on those regressions rendered a number of common scenarios undeployable, which Vince and I deemed worse than the problem this fix patches. Until those regressions are fixed, this patch should not be released.
please could you be more specific about this regressions? I was testing it in release55_dev build 200610120300 and didn't found any errors
I reverted this patch due to observations now detailed in issue 87042. I have been able to determine that the deployment errors that can be caused by side effects of 87042 are not the fault of this patch and have recommitted this patch to release55 codebase. This issue is fixed now in both release55_dev and release55.
One more little change required. There was an incorrect property name being used to put cached (not loaded) ejb's back into the tree for saving. This caused a logged exception and prevents the file from being saved. The effect is that if you an ejb entry that has not been loaded yet(ie scan still running), you cannot save changes to sun-ejb-jar.xml and if you have a bogus entry (one that will never be loaded, for whatever reason), then you can _never_ save sun-ejb-jar.xml. The fix is trivial and is a must fix for NB 5.5. I already patched it in release55_dev, asking permission to patch release55 over the weekend. Here's the diff: http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbJarRoot.java?r1=1.1.16.6.2.11.6.4&r2=1.1.16.6.2.11.6.5 Why didn't I catch this before? When I started testing these changes in Ejb, I got sucked into the mess we eventually resolved via issue 87042.
change approved.
See also, this diff which will prevent further damage to the save process in cases like above. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Base.java?r1=1.1.16.4.2.7.6.2&r2=1.1.16.4.2.7.6.3
additional changes appears to be safe and prudent. approved.
changes verified by QE in release55_dev
Committed to release55 branch. http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/Base.java?r1=1.1.16.4.2.10&r2=1.1.16.4.2.11 http://serverplugins.netbeans.org/source/browse/serverplugins/sun/sunddui/src/org/netbeans/modules/j2ee/sun/share/configbean/EjbJarRoot.java?r1=1.1.16.6.2.15&r2=1.1.16.6.2.16