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.
Summary: | Problems with Beans.isDesignTime() when running custom components on NetBeans IDE | ||
---|---|---|---|
Product: | guibuilder | Reporter: | Michel Graciano <hmichel> |
Component: | Code | Assignee: | issues@guibuilder <issues> |
Status: | VERIFIED WONTFIX | ||
Severity: | blocker | CC: | mbien, misterm |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
URL: | http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6669869 | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Michel Graciano
2008-02-20 18:37:20 UTC
I am the person who mentioned the issue with the plug-in components thinking they are still in design time. This could be probably solved if the Beans class would be loaded in the GUI builder's classloader instead of its parent. Interesting, I will try to investigate whether the proposed solution is possible. Unfortunately, the proposed solution cannot be implemented. Attempts to define a new copy of java.beans.Beans class in another classloader ends with java.lang.SecurityException: Prohibited package name: java.beans at java.lang.ClassLoader.preDefineClass(ClassLoader.java:479) at java.lang.ClassLoader.defineClass(ClassLoader.java:614) at java.lang.ClassLoader.defineClass(ClassLoader.java:465) ... According to documentation of ClassLoader.defineClass() all classes in the java.* packages can only be defined by the bootstrap class loader. There's no associated permission to overcome this check. See ClassLoader.preDefineClass(), it performs the mentioned check unconditionally. Closing this issue as 'will not fix' because I don't see any possibility to fix it. no new information in discussion -> verified as WONTFIX fyi, this bug is fixed in jdk7, Beans.* works now AppContext sensitive fix: http://hg.openjdk.java.net/jdk7/swing/jdk/rev/27dabbdfdcac bug report: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6669869 This fix won't help us I'm afraid, we don't have separate AppContext for the GUI builder in the IDE, and can't have since the GUI builder UI is part of the NetBeans IDE - i.e. the same hieararchy, event queue, etc. Note there is also java.beans.DesignMode interface which works correctly, except during the bean initialization (after the bean instance is created, the GUI builder calls setDesignTime on it, but code running in constructor does not have it set yet). |