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.
Issue #17815 has a full discussion. Relevant pieces: jglick: Making beaninfo into a module may be hard because of the way Introspector finds classes. I think it needs to be in the same classloader as the beans. jtulach: Introspector uses (amoung others) also Thread.getContextClassLoader. It seems possible to convince the system to load beaninfos using SystemClassLoader (together with ThreadGroup.enumerate)... jglick: I've thought about contextClassLoader, but it's tricky. systemClassLoader changes dynamically, so you would need to reset the contextClassLoader periodically. ThreadGroup.enumerate will give you all *current* threads but you cannot listen for newly created ones. If it can be made to work reliably, setting contextClassLoader to systemClassLoader would probably be useful for a number of libraries; people sort of expect it to "just work", I think. jtulach: Re: contextClassLoader. Each new thread reuses the contextClassLoader from its parent. So it seems necessary to set the system classloader for the main thread, all others will inherit it. Plus reset for all threads in the ThreadGroup when systemCL changes.
Should also check if this permits lib/ext/rmi-ext.jar to finally be deleted.
Created attachment 4936 [details] Experimental test that changes in ContextClassLoader are not propagated to child threads - well I could check the sources...
Bummer. Well then I could enumerate all threads, I suppose. Note that the Java API has an apparent design defect: you have to decide in advance what size array to make: http://developer.java.sun.com/developer/bugParade/bugs/4097747.html
Probably needed for proper JAXP configuration.
Implemented. committed * Up-To-Date 1.26 core/src/org/netbeans/core/modules/ModuleManager.java committed * Up-To-Date 1.16 core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java committed * Up-To-Date 1.45 openide/src/org/openide/TopManager.java
Libor, please try it out and either verify or reopen as appropriate. The unit test passes, and a simple manual test (trying to load from various modules using Thread.currentThread().getContextClassLoader() from within a Java class run via internal execution) also passes.
Verified. I have tried to move JAXP/transform API to lib/ext and it correctly found Xalan's TransformFactory. Thanks.
Thanks, marking VERIFIED then.
*** Issue 23312 has been marked as a duplicate of this issue. ***
Created attachment 6904 [details] Complete patch for sierra branch
Committing to sierra as per diff above: Checking in core/src/org/netbeans/core/modules/ModuleManager.java; /cvs/core/src/org/netbeans/core/modules/ModuleManager.java,v <-- ModuleManager.java new revision: 1.17.20.1; previous revision: 1.17 done Checking in core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java; /cvs/core/test/unit/src/org/netbeans/core/modules/ModuleManagerTest.java,v <-- ModuleManagerTest.java new revision: 1.10.32.1; previous revision: 1.10 done Checking in openide/openide-spec-vers.properties; /cvs/openide/openide-spec-vers.properties,v <-- openide-spec-vers.properties new revision: 1.38.8.2.4.1.6.1; previous revision: 1.38.8.2.4.1 done Details: Pretty much straight merge from trunk (3.4 dev) version, with trivial syntax corrections to merge from ModuleManagerTest.java, and updating API spec version so Sierra modules needing this patch can be sure to depend on IDE/1 > 1.43.3.1 ensuring they will load in Sierra or 3.4 but be rejected in Orion (1.43.3). The unit test passes with the ModuleManager.java patch (and fails without it, as expected). An ad-hoc test also passes: System.out.println(Thread.currentThread().getContextClassLoader().loadClass("org.netbeans.modules.java.JavaDataObject")); (internal execution) prints the Class object, rather than throwing ClassNotFoundException. I did not file an integration request for this, sorry - not on SWAN and apparently not able to log into INF over Sun.Net. Someone else (Trung, Petr Hr., Cliff, etc.) is welcome to file a pre-closed INF for this.
Resolved for 3.4.x or earlier, no new info since then -> closing.
This issue had *2 votes* before move to platform component