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.
After installation of the module (editor) the xml entities are registered via XML Layer to Default System/xml/entities/NetBeans After uninstallation of the module the DTDs are removed from that folder, and of course after re-installation they are registered again. But the problem is that they are registered with the old instance. Like if they are cached somewhere. You can reproduce this problem by following: 1. Start IDE (dev 05.10) and expand Editing/Annotation Types node in Options window. 2. You should get the Annotations subnodes. 3. Then uninstall and re-install editor module. 4. There is no Annotation node in Editing/Annotation Types node. 5. See the ide.log where is the exception: Could not connect to URL nbrescurr:/org/netbeans/modules/editor/resources/AnnotationTypes/annotation-type-1_0.dtd. No such resource was found. I am attaching this exception as attachement.
Created attachment 2858 [details] Exception
org.netbeans.core.xml.FileEntityResolver might be at fault, but I am not sure; it looks like it is getting an invalid file object, which might mean a problem in org.openide.filesystems. I don't see any caching in FER.
I'll take a look, but I do not think that unistall/install troubles are beta stopers -> P2.
Created attachment 2890 [details] While trying to reproduce I have found a deadlock in editor module
Please fix the deadlock, then return back, if the old behaviour remains reproducible.
Moving issue back to the OpenIDE. I was not able to reproduce the deadlock, however I know the cause from stack trace (thanx!), so I fixed it (locally) and tried to reproduce this bug and was successful, so the problem is still there and most probably in openide. Jarda, you get the deadlock each time you try to reproduce this bug? Or was you able to reproduce the problem Mato described here? I will commit the fix later afternoon, but it is not related to this problem.
Let me know when you integrate the fix. I am not able to get rid of the deadlock.
The fix was commited a few minutes ago into Editor. Please test it and let me know. Thanx.
Another bug in editor. I have just followed the steps described in the bug and after enabling the module I have got this exception: java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:380) at sun.awt.AppContext.put(AppContext.java:469) at org.netbeans.modules.editor.EditorModule.uninstalled(EditorModule.java:177) at org.netbeans.core.modules.NbInstaller.loadCode(NbInstaller.java:317) at org.netbeans.core.modules.NbInstaller.unload(NbInstaller.java:243) at org.netbeans.core.modules.ModuleManager.disable(ModuleManager.java:576) at org.netbeans.core.ui.ModuleBean$AllModulesBean.doDisable(ModuleBean.java:571) at org.netbeans.core.ui.ModuleBean$AllModulesBean.access$900(ModuleBean.java:230) at org.netbeans.core.ui.ModuleBean$AllModulesBean$Updater.run(ModuleBean.java:472) at org.openide.util.Mutex.writeAccess(Mutex.java:330) at org.netbeans.core.ui.ModuleBean$AllModulesBean$Updater.run(ModuleBean.java:412) at org.openide.util.Task.run(Task.java:152) at org.openide.util.RequestProcessor$ProcessorThread.run(RequestProcessor.java:611)
This problem is filed as 16212, so I'm returning this issue back to the openide and I set dependency on 16212 (although I doubt that there is some relation). Hope you agree. Once the 16212 is fixed we can continue the work on this one.
I was able to find the cause of the bug in spite of the issue 16212. Thus they probably do not depend. The bug seems to be in ClassLoader system. After following all of the described steps I tried: r = org.openide.TopManager.getDefault ().systemClassLoader ().getResource ( "org/netbeans/modules/editor/resources/DTDs/Options/EditorMacros-1_0.dtd" ); after which r != null and r = org.openide.TopManager.getDefault ().currentClassLoader ().getResource ( "org/netbeans/modules/editor/resources/DTDs/Options/EditorMacros-1_0.dtd" ); after which r == null Because currentClassLoader should include everything from systemClassLoader, the bug is in ClassLoaderSupport I guess.
Hmm, that is pretty bad, I will look at it. Perhaps the classloader change is not taking effect quickly enough (maybe in the future it will be possible to turn off validation on XMLDataObject, in which case I suspect this would not be a problem because the DTD would not be required normally anyway). For a short-term workaround, please see issue #16342 in the editor.
BTW please make sure QA Contact is updated when changing components on bugs.
I have a patch which seems to work, will upload it shortly and then being testing this (changes in classloader timing are potentially dangerous).
Created attachment 2936 [details] Proposed patch
Linking to editor bugs that would serve as workarounds or would make the fix not solve the complete problem.
The patch below is broken, back to work...
Created attachment 2940 [details] Hopefully better patch
The second patch seems to work fine. Ran EE and enabled/disabled many modules at once. Adding minor patch to ClassLoaderSupport for occasional timing-related NPE. 1.21 core/src/org/netbeans/core/ClassLoaderSupport.java 1.123 core/src/org/netbeans/core/NbTopManager.java 1.15 core/src/org/netbeans/core/modules/ModuleManager.java 1.11 core/src/org/netbeans/core/modules/ModuleSystem.java Thanks to Yarda for correctly diagnosing the problem.
That was not as hard.
Resolved for 3.4.x or earlier, no new info since then -> closing.