-
1. Re: IllegalAccessError
chiba Sep 9, 2003 10:56 AM (in response to jeanlazarou)Can you try an unmodified JPopupMenu?
> CtClass cc = pool.get(name);
> byte[] b = cc.toBytecode();
> Class c = defineClass(name, b, 0, b.length);
> return c;
This simply loads JPopupMenu as is. If an exception
is still thrown, the problem is because JPopupMenu
is loaded by a class loader different from one loading
javax.swing.SwingUtilities.appContextGet. This
prohibits JPopupMenu from accessing package
methods in SwingUtilities.
Please read Section 4 of the tutorial.
Chiba -
2. Re: IllegalAccessError
jeanlazarou Sep 10, 2003 2:45 AM (in response to jeanlazarou)As is stated in javassist.Loader:
/* The swing components must be loaded by a system
* class loader.
* javax.swing.UIManager loads a (concrete) subclass
* of LookAndFeel by a system class loader and cast
* an instance of the class to LookAndFeel for
* (maybe) a security reason. To avoid failure of
* type conversion, LookAndFeel must not be loaded
* by this class loader.
*/
I cannot do what I want...
The only think I could do is instrument the compiled
class and then use : java -Xbootclasspath
Jean