From: Samuele P. <pe...@in...> - 2001-10-15 14:55:05
|
Sorry if I was not clear but what I was saying is that if you try to execute jython code using an the interpreter and not going the way of freezing it with jythonc, the intepreter (not you) will try/need to creates classloaders and in order to do that it will need the corresponding permission. So the point is that in any case you will have to deal with the problem of granting permissions to your applet. regards. ----- Original Message ----- From: Sells, Fred <fr...@ad...> To: 'Samuele Pedroni' <pe...@in...>; Paul Giotta <pau...@so...>; <jyt...@li...>; Sells, Fred <fr...@ad...> Sent: Monday, October 15, 2001 4:27 PM Subject: RE: [Jython-users] error imbedding Jython into java applet > I'm confused on the need to define my own class loader :( > > I'm willing to accept that I must, but what class loader do I create. I'm > kind of lost here, any example would be most helpful. > > tia. > > -----Original Message----- > From: Samuele Pedroni [mailto:pe...@in...] > Sent: Thursday, October 11, 2001 5:05 AM > To: Paul Giotta; jyt...@li...; Sells, Fred > Subject: Re: [Jython-users] error imbedding Jython into java applet > > > Hi, > after that you will discover that jython need to create a > classloader in order to dynamically execute some code, > > a thing that cannot be done with the vanilla applet > permissions :( ! > > regards. > > ----- Original Message ----- > From: Paul Giotta <pau...@so...> > To: <jyt...@li...>; Sells, Fred > <fr...@ad...> > Sent: Thursday, October 11, 2001 10:40 AM > Subject: Re: [Jython-users] error imbedding Jython into java applet > > > > 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. * > > > > > > > > > > _______________________________________________ > > Jython-users mailing list > > Jyt...@li... > > https://lists.sourceforge.net/lists/listinfo/jython-users > > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |