[OpenMap Users] Re: OpenMap components for applet

From: yorgos strakosa <gstrak_at_gmail.com>
Date: Mon, 20 Mar 2006 16:48:56 +0200

It looks like this is a Java platform bug!
It`s described here:
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4912903
and it says that:
"The jar file gets downloaded for every ImageIcon(URL) constructor"

If you have a statement like this:

URLConnection.setDefaultUseCaches(false);

in your code than what`s decribed above will happen.

One of the workarounds is to simply say:

URLConnection.setDefaultUseCaches(true);

It worked for me, so I just put it here in case
this happens to anyone else.

Yorgos.

On 3/17/06, yorgos strakosa <gstrak_at_gmail.com> wrote:
> Hi!
> I have a question about using OpenMap components in an applet.
>
> First of all, I am using a digitally signed applet in order to have access
> to the local (user) machine. I use the local machine as a cache for the
> map (shape) files. To make this work the Environment is really an
> application.
> Allthough the applet is cached locally with all the needed classes,
> during applet initialization the OpenMap components cause (e.g.
> InformationDelegator, NavigatePanel e.t.c.) the download of the applet
> jar from the server, several times (40-50) before
> the whole thing is rendered on the screen.
> (It can be accessed from here: http://isl.cs.unipi.gr/seismoportal/)
>
> Do you have any idea, why is this happening?
>
> To be more specific here are some debugging messages:
>
> For InformationDelegator I get this:
>
> Java Plug-in console
> =====================
> ComponentFactory.create: com.bbn.openmap.InformationDelegator
> - got class for com.bbn.openmap.InformationDelegator
> - created class arguments [null]
> - got constructor
> InformationDelegator.initInfoWidgets
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with proxy=DIRECT
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with cookie "JSESSIONID=BCF60756511E360C65355829BC8BE0DE"
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with proxy=DIRECT
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with cookie "JSESSIONID=BCF60756511E360C65355829BC8BE0DE"
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with proxy=DIRECT
> network: Connecting http://127.0.0.1/seismoportal/sSeismoSurfer.jar
> with cookie "JSESSIONID=BCF60756511E360C65355829BC8BE0DE"
> - got object
> setting properties with prefix "informationDelegator"
> - set properties
> ComponentFactory: [com.bbn.openmap.InformationDelegator(3)] created
>
> Tomcat log
> ==========
> 127.0.0.1 - guest [17/Mar/2006:15:33:49 +0200] "GET
> /seismoportal/sSeismoSurfer.jar HTTP/1.1" 200 1509263
> 127.0.0.1 - guest [17/Mar/2006:15:33:49 +0200] "GET
> /seismoportal/sSeismoSurfer.jar HTTP/1.1" 200 1509263
> 127.0.0.1 - guest [17/Mar/2006:15:33:50 +0200] "GET
> /seismoportal/sSeismoSurfer.jar HTTP/1.1" 200 1509263
>
> I don`t understand why InformationDelegator.initInfoWidgets causes
> three consecutive applet downloads...
>
> Looking the source I noticed that it makes an instance of StatusLightPanel
> which uses code like this
>
> StatusLightPanel.class.getResource("grey.gif")
>
> to load the images. Could something like this cause an applet download?
> If this is so, how can I avoid it?
>
>
> Thanks a lot for your time,
> Yorgos
>

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Mar 20 2006 - 09:49:37 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:07 EDT