On Dec 2, 12:12 pm, Chouser <[EMAIL PROTECTED]> wrote:
> On Tue, Dec 2, 2008 at 10:24 AM, Rich Hickey <[EMAIL PROTECTED]> wrote:
>
> >  Proxy generation was the last runtime code-gen/classloader
> > requirement. So the path is clear for building Clojure apps without
> > runtime codegen, for delivery in those environments that preclude it
> > (e.g. Android, unsigned applets). Looking forward to feedback from
> > people trying to reach those targets.
>
> You asked for it.  :-)
>
> Here's a minimal applet .clj:
>
> (ns net.n01se.Tree
>   (:gen-class
>    :extends java.applet.Applet))
>
> Since it's missing a main fn, I would expect an exception like the this:
> java.lang.UnsupportedOperationException: net.n01se.Tree/-main not
> defined (NO_SOURCE_FILE:0)

When and why?

The mappings are dynamic, you'll get an error if you try to call it,
and you could define that later somehow.

>
> Using svn 1136 I can compile and get the above exception from a normal
> Clojure REPL, but if I try to use it as an applet:
>
> $ appletviewer test.html
> java.lang.ExceptionInInitializerError
>         at clojure.lang.Namespace.<init>(Namespace.java:31)
>         at clojure.lang.Namespace.findOrCreate(Namespace.java:116)
>         at clojure.lang.Var.internPrivate(Var.java:95)
>         at net.n01se.Tree.<clinit>(Unknown Source)
>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
> Method)
>         at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
>         at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>         at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
>         at java.lang.Class.newInstance0(Class.java:372)
>         at java.lang.Class.newInstance(Class.java:325)
>         at sun.applet.AppletPanel.createApplet(AppletPanel.java:798)
>         at sun.applet.AppletPanel.runLoader(AppletPanel.java:727)
>         at sun.applet.AppletPanel.run(AppletPanel.java:380)
>         at java.lang.Thread.run(Thread.java:636)
> Caused by: java.security.AccessControlException: access denied
> (java.lang.RuntimePermission createClassLoader)

> You can see it found my class okay, but it looks like there may be
> some dynamic classloader stuff still going on?
>

Thanks, that's useful.

Yes, the dynamic loader is still there, just won't be used, but it
looks like the security check is on creation. Getting it completely
out is another project...

Rich

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to