Matthew Laurenson wrote:
> Greetings all,
>
> I have a small visad application which I am running as an applet, either
> from Netscape with the Java plug-in or using the AppletViewer. The
> applet sits on a web server with visad.jar. When run, it communicates
> via RMI to a server program running on another machine (which in turn
> talks to some weather databases via JDBC).
>
> The applet uses DisplayImplJ3D to show a map of weather stations, with
> their period of operation in the z-axis.
>
> I've included the code below in case it is relevant.
Thanks, that really helped with debugging!
> The thing basically works, but with one annoying aspect. I have to grant
> the codebase http:...visad.jar AllPermission to avoid getting the
> following message when I rotate the 3D display:
The following patch to visad/util/ThreadPool.java should fix your problem.
(P.S. thanks for the excellent bug report!)
Index: visad/util/ThreadPool.java
==================================================================
RCS file: /source-control/visad/util/ThreadPool.java,v
retrieving revision 1.3
diff -u -r1.3 ThreadPool.java
--- ThreadPool.java 1999/07/14 21:57:38 1.3
+++ ThreadPool.java 1999/07/16 18:40:41
@@ -164,9 +164,14 @@
if (threads != null && threads.size() < maxThreads) {
// ...spawn a new thread and tell it to deal with this
- Thread t = new ThreadMinnow(this);
- threads.addElement(t);
- threadLock.notify();
+ try {
+ Thread t = new ThreadMinnow(this);
+ threads.addElement(t);
+ threadLock.notify();
+ } catch (SecurityException e) {
+ // can't spawn a thread from this ThreadGroup...
+ // wait until something's queued from the main thread
+ }
} else {
// try to wake up all waiting threads to deal with the backlog