[kaffe] Newbie : SecurityException problems

Michael Koch konqueror at gmx.de
Sun Mar 27 11:50:16 PST 2005


On Sun, Mar 27, 2005 at 09:43:58PM +0200, Archaiesteron wrote:
> Hi, I use kaffe for the very first time ; I can run some "hello world"
> programs with no problem, but if I want to run a huge project, I get
> a security exception. I have to tell that my CLASSPATH is (for the moment)
> set to the Sun rt.jar etc. This is because I use Swing, and other features.
> The program (a jar archive) is known to work with the Sun JDK / JRE. But
> with kaffe, I get :
> 
> $ kaffe -jar Hemicycle.jar
> 
> java.lang.SecurityException: Prohibited package: java/awt/DefaultKeyboardFocusManager
>    at javax.swing.UIManager.maybeInitialize (UIManager.java:1164)
>    at javax.swing.UIManager.getUI (UIManager.java:775)
>    at javax.swing.JPanel.updateUI (JPanel.java:104)
>    at javax.swing.JPanel.<init> (JPanel.java:64)
>    at javax.swing.JPanel.<init> (JPanel.java:87)
>    at javax.swing.JPanel.<init> (JPanel.java:95)
>    at javax.swing.JRootPane.createGlassPane (JRootPane.java:480)
>    at javax.swing.JRootPane.<init> (JRootPane.java:311)
>    at javax.swing.JWindow.createRootPane (JWindow.java:233)
>    at javax.swing.JWindow.windowInit (JWindow.java:224)
>    at javax.swing.JWindow.<init> (JWindow.java:161)
>    at javax.swing.JWindow.<init> (JWindow.java:112)
>    at baruchel.hemicycle.Hemicycle.main (Hemicycle.java:631)
>    at java.lang.reflect.Method.invoke0 (Method.java)
>    at java.lang.reflect.Method.invoke (Method.java:255)
>    at kaffe.jar.ExecJarName.main (ExecJarName.java:67)
>    at kaffe.jar.ExecJar.main (ExecJar.java:75)
> 
> What can I do ? I can mention that if I have to allow everything to do everything
> on my system, there is no problem for that ; I don't use java as a "user" with my
> browser, etc. I only have to write some code, and test it before sending it to
> the final user ; I would like to use Kaffe, but how can I run my program ?

Looks like your application installs a SecurityManager and triggers a
bug in  javax.swing.UIManager.maybeInitialize. I guess there is some
call to java.security.AccessController.doPrivileged() missing as
java.awt is surely no prohibited package. It should be loaded by the
system classloader. If thats not the case, its another bug.


Michael
-- 
Escape the Java Trap with GNU Classpath!
http://www.gnu.org/philosophy/java-trap.html

Join the community at http://planet.classpath.org/




More information about the kaffe mailing list