From: Alessio S. <ale...@gm...> - 2009-02-19 23:57:12
|
Hello, between yesterday and today, out of sheer masochism, I tried running ABCL as a Java Web Start application. It turned out that ABCL makes some assumptions about its compiled code being stored in files (rather than arbitrary url resources). I fixed that where it gave me problems, then I encountered a weird crash due to security exceptions, which I fixed copying what to me is nothing but an arcane incantation from an old Kawa mailing list post. Now it seems to work more or less (launching swank crashes because it can't determine the platform to compile it for & because Java Web Start does not provide console input so interactive restarts fail miserably). Of course I'm keeping these "fixes" locally because they're basically hacks with possible unexpected consequences, and because it's questionable whether someone actually needs running abcl in such a scenario, but I'm sharing this should it be of interest for someone. Alessio PS stay tuned for a quickly hacked - ehm, I mean super duper killer - GUI framework based on ABCL by yours truly ;) |
From: Reinhard O. <old...@ma...> - 2009-02-20 08:38:30
|
Hi Alessio, from my perspective there certainly is an interest in having the possibility to produce Java web start applications. I'm mainly interested in programs for mathematics education based on Maxima and this brings up a related problem: Is it possible to deliver Maxima as a java web start? The problem is that Maxima consists of so many files and ABCL has no facility to produce a single image file, so that even if it is possible to habe Maxima as a web start applications, it may not be a fast web starting application. Reinhard Alessio Stalla schrieb: > Hello, > > between yesterday and today, out of sheer masochism, I tried running > ABCL as a Java Web Start application. It turned out that ABCL makes > some assumptions about its compiled code being stored in files (rather > than arbitrary url resources). I fixed that where it gave me problems, > then I encountered a weird crash due to security exceptions, which I > fixed copying what to me is nothing but an arcane incantation from an > old Kawa mailing list post. Now it seems to work more or less > (launching swank crashes because it can't determine the platform to > compile it for & because Java Web Start does not provide console input > so interactive restarts fail miserably). > > Of course I'm keeping these "fixes" locally because they're basically > hacks with possible unexpected consequences, and because it's > questionable whether someone actually needs running abcl in such a > scenario, but I'm sharing this should it be of interest for someone. > > Alessio > > PS stay tuned for a quickly hacked - ehm, I mean super duper killer - > GUI framework based on ABCL by yours truly ;) > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > armedbear-j-devel mailing list > arm...@li... > https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel > > |
From: Alessio S. <ale...@gm...> - 2009-02-20 09:15:40
|
Hi Reinhard, Java Web Start requires that all resources used by the application are referenced by URLs and are declared in a descriptor file, the JNLP file you download when you start the application. In contrast, AFAIK, most Lisp systems and related tools (including Maxima, I guess, as well as ASDF, DEFSYSTEM and the like) assume that code (source or compiled) and resources reside in files. So, certainly out of the box no serious Lisp system can be run as a JWS application. But, not all is lost: for Java has the built-in ability to load resources from URLs transparently (including resources stored in JAR archives published by a webserver on a http:// url), and ABCL can use this ability (and already does sometimes behind the hood). What is probably lacking (I haven't checked in detail) is a Lisp interface to such Java facility, interface which should be integrated with the files & pathnames support in Lisp (so that any Lisp system could seamlessly use such a facility without even knowing it). That way you could package Maxima as a big jar, publish it by http, and use that URL facility to load all resources, using the jar as some kind of "base directory". I'll investigate into that as soon as I have time. Please let me stress however that my changes to ABCL in order to run it as JWS have been driven by experimentation only and thus are a just a collection of little fixes, not a well-thought change. Besides the known problems (no console input!), some unforeseen problems might show up, I may find out that these "fixes" break something else, etc. Please also note that the sandbox facility provided by Java Web Start is useless with ABCL, because it needs full permissions (since it tampers with the classloader, among other things). Alessio On Fri, Feb 20, 2009 at 9:10 AM, Reinhard Oldenburg <old...@ma...> wrote: > Hi Alessio, > > from my perspective there certainly is an interest in having the > possibility to produce Java web start applications. I'm mainly interested in > programs for mathematics education based on Maxima and this brings up a > related problem: Is it possible to deliver Maxima as a java web start? The > problem is that Maxima consists of so many files and ABCL has no facility to > produce a single image file, so that even if it is possible to habe Maxima > as a web start applications, it may not be a fast web starting application. > > Reinhard > > Alessio Stalla schrieb: >> >> Hello, >> >> between yesterday and today, out of sheer masochism, I tried running >> ABCL as a Java Web Start application. It turned out that ABCL makes >> some assumptions about its compiled code being stored in files (rather >> than arbitrary url resources). I fixed that where it gave me problems, >> then I encountered a weird crash due to security exceptions, which I >> fixed copying what to me is nothing but an arcane incantation from an >> old Kawa mailing list post. Now it seems to work more or less >> (launching swank crashes because it can't determine the platform to >> compile it for & because Java Web Start does not provide console input >> so interactive restarts fail miserably). >> >> Of course I'm keeping these "fixes" locally because they're basically >> hacks with possible unexpected consequences, and because it's >> questionable whether someone actually needs running abcl in such a >> scenario, but I'm sharing this should it be of interest for someone. >> >> Alessio >> >> PS stay tuned for a quickly hacked - ehm, I mean super duper killer - >> GUI framework based on ABCL by yours truly ;) >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, >> CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source code: >> SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> armedbear-j-devel mailing list >> arm...@li... >> https://lists.sourceforge.net/lists/listinfo/armedbear-j-devel >> >> > |
From: <don...@is...> - 2009-02-20 18:31:49
|
Alessio Stalla writes: > So, certainly out of the box no serious Lisp system can be run as a > JWS application. The difference between files and web resources, in my view, is minor. The saved image problem seems to me much more important for another reason. I don't know about Maxima, but other systems (inc. AP5) require a significant amount of effort in loading, not so much because they're adding code to the running process but rather because they're running code to create data in the running process. Without a saved image it might take an unreasonably long time to start such an application. Has anyone given serious thought to saving all of the data in a jvm (into a jar) and then restoring it? Or even all of the lisp data? It occurs to me that this is almost doable in lisp using *print-circle*. What's missing is the ability to print arbitrary things readably. I'd expect that something analogous to print (even sharing most of the code) could be written that applies to all lisp data. There might be additional problems if you want to save state of threads, and you probably can't save state of things like streams, but these seem less necessary. (It seems pretty clear that you can't and don't want to save the state of the thread that's dumping the image!) Given that saving images seems not to be a normal thing in java, I guess that lisp applications that want to use java UI facilities could be expected to recreate those at startup. > Please also note that the sandbox facility provided by Java Web Start > is useless with ABCL, because it needs full permissions (since it > tampers with the classloader, among other things). I suppose the same is true for an applet. Meaning it would have to be signed. I wonder whether there is some way to regain some use of the security that the inventors of java worked so hard on. I guess that's another topic for another day. |
From: Alessio S. <ale...@gm...> - 2009-02-21 02:23:54
|
On Fri, Feb 20, 2009 at 7:31 PM, Don Cohen <don...@is...> wrote: > Alessio Stalla writes: > > So, certainly out of the box no serious Lisp system can be run as a > > JWS application. > The difference between files and web resources, in my view, is minor. > The saved image problem seems to me much more important for another > reason. > I don't know about Maxima, but other systems (inc. AP5) require a > significant amount of effort in loading, not so much because they're > adding code to the running process but rather because they're running > code to create data in the running process. > Without a saved image it might take an unreasonably long time to start > such an application. Has anyone given serious thought to saving all > of the data in a jvm (into a jar) and then restoring it? Or even all > of the lisp data? It occurs to me that this is almost doable in lisp > using *print-circle*. What's missing is the ability to print arbitrary > things readably. I'd expect that something analogous to print (even > sharing most of the code) could be written that applies to all lisp > data. There might be additional problems if you want to save state of > threads, and you probably can't save state of things like streams, but > these seem less necessary. (It seems pretty clear that you can't and > don't want to save the state of the thread that's dumping the image!) > Given that saving images seems not to be a normal thing in java, I > guess that lisp applications that want to use java UI facilities could > be expected to recreate those at startup. Sure, saving an image is another very important feature ABCL is lacking, a feature that's essential for any big system. As I said some time ago about the same topic, I think that using Java serialization you could accomplish most of the task (leaving out the points you mentioned, i.e. saving & restoring the state of "transient" entities like threads and streams). That's another thing I'd like to try if I had the time... > > Please also note that the sandbox facility provided by Java Web Start > > is useless with ABCL, because it needs full permissions (since it > > tampers with the classloader, among other things). > I suppose the same is true for an applet. > Meaning it would have to be signed. Actually, the meaning is stronger than having it just signed. Java Web Start's security model is pretty much the same as applets, as far as I know. If a JWS application is not signed, it can only run in a very strict sandbox (no disk access, no sockets other than to the host where the app was downloaded from, ...). If it's signed, you can specify one of two sets of privileges to use, all-privileges or j2ee-privileges. Even with all-privileges, I had to tweak the privilege system to prevent ABCL from crashing when it attempted to instantiate and use its own classloader during the boot process. > I wonder whether there is some way to regain some use of the security > that the inventors of java worked so hard on. I guess that's another > topic for another day. I don't know. It may be that editing policy files in the local java installation you could still enforce some security restrictions on ABCL while making it not crash for the classloader. I don't know much about java security though... hth, Alessio |