From: Paul G. <pau...@so...> - 2001-10-11 08:40:26
|
Jython tries to read the system properties on startup, which will cause a security exception in an applet. Here is the offending code snippet, from PySytemState.java: private static boolean initialized = false; public static void initialize() { if (initialized) return; initialize(System.getProperties(), null, new String[] {""}); } public static synchronized void initialize(Properties preProperties, Properties postProperties, String[] argv) { initialize(preProperties, postProperties, argv, null); } You can pre-empt this by calling the static method PySystemState.initialize( preProperties, postProperties, argv, null ) using your own Properties objects as the first 2 patameters. If you do this before you create the interpreter, then the boolean "initialized" will be set to true, and the the call to System.getProperties() will not be executed when you do create the interpreter. The Properties objects in the first 2 arguments should contain values from the registry file. They can contain jython.home, but this will not be usefull, as your applet cannot read files anyway. Values in postProperties will overide values in preProperties. If I recall, the jython installer gives you the option to install source code, but this is not selected by default. You may need to rerun the installer to get it. -Paul -- Paul Giotta Software Architect pau...@so... Office: +41 1 445 2370 | Fax: +41 1 445 2372 | Mobile: +41 76 389 1180 Technoparkstr.1, 8005 Zurich, Switzerland | http://www.softwired-inc.com * e2e Java Messaging, Pure and Simple. * |