Bug: -main function corrupts applet

Skip to first unread message

Andreas Wenger

Oct 16, 2009, 7:47:16 AM10/16/09
to Clojure
When writing an applet with Clojure I discovered the following bug:

Whenever a class with a -main function is loaded (e.g. by :use), the
applet is broken (Java 6 with new plugin technology):

at sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel
at sun.plugin2.applet.Plugin2Manager.createApplet
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run
at java.lang.Thread.run(Thread.java:619)

You can very easily reproduce the problem with the following
experiment I prepared:


First, look at the .clj files. There are three identical (minimal)
applets. Each uses another (minimal) file: One uses a class with a -
main method, one uses a class with no main method and the third one
uses a renamed main method.
Now, compile the files by calling the build.sh script. When finished,
open the HTML files in the browser. You will see that the two applets
without -main functions work, but the applet with the -main function

I guess, this is a bug in Clojure?

Andreas Wenger

Oct 18, 2009, 5:47:51 AM10/18/09
to Clojure
Can please anybody verify this bug? Should take only 3 minutes or so.

Rich Hickey

Oct 18, 2009, 10:26:20 AM10/18/09
to Clojure

On Oct 18, 5:47 am, Andreas Wenger <andi.xeno...@googlemail.com>
> *push*
> Can please anybody verify this bug? Should take only 3 minutes or so.

A NullPointerException in
sun.plugin2.applet.Plugin2Manager.findAppletJDKLevel isn't enough to
go on. This could be anyone's bug, just because you can change
something in your Clojure code to trigger it doesn't mean the problem
is on the Clojure side.

Does one need main functions in applets?

I found this via googling:


Reply all
Reply to author
0 new messages