On Monday, November 26, 2001, at 05:17 AM, alexander sokolov wrote:
> Hi Don,
>
> Yes, I have tried to use AppletDataNudgets. What I did is
>
> - Created gismaps.class using
> java com.bbn.openmap.io.AppletDataNugget gismaps
>
> - Put gismaps.class in the jar with data
>
> - set Properties
> openmap.appletDataNuggets gismaps
>
> Sign the jar.
>
> But it did not help. I think it is because the Environment.isApplet is
> false and
> BinaryFile checks this variable several times. I suspect the
> javaWebStart treats
> the application and applet in the same way.Might be this is the reason.
It's strange that the Environment.isApplet is false, and that's probably
causing the problems.
> Funny thing is that there are several other files in the same jar and
> the application can read it using
>
> ClassLoader cl = this.getClass().getClassLoader();
> InputStream csvInp =
> cl.getResourceAsStream((String)props.getProperty("country.csvFile"));
> InputStreamReader csvReader = new InputStreamReader(csvInp);
> BufferedReader in = new BufferedReader(csvReader);
>
> with no problem in both cases (using java -cp and javaWebStart)
I've found that it depends on the location of the file in the jar and
where the requesting class is. Is your requesting class file at the
root of the jar, next to the country.csvFile?
I'm surprised the problem even exists - that the class loader can't find
the data files as resources when being run as an applet - and that the
AppletDataNugget had to be written.
So I guess we need to figure out why Environment.isApplet is false.
- Don
>> Did you try using AppletDataNuggets? See
>> com.bbn.openmap.io.AppletDataNugget. It's the only way I could get an
>> applet to use data files stored in a jar file.
>>
>> - Don
>>
>> On Sunday, November 25, 2001, at 06:14 PM, alexander sokolov wrote:
>>
>>> Hi,
>>>
>>> It is a great news that the new 4.4.2 can read shape files from a jar
>>> file.
>>> It works perfectly. Thanks. But when I tried to use this to run
>>> an application using javaWebStart I got an error. Openmap can't read
>>> a shape file from the jar in case of using javaWebStart.
>>> Yes, the data files are separated from the code in special file,
>>> but the same application runs perfectly using these jars in a
>>> classpath.
>>>
>>>
>>> Why? Any ideas?
>>>
>>> Thanks
>>>
>>> as
>>>
>>>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Donald Dietrick, dietrick@bbn.com
BBN Technologies, Cambridge, MA
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Mon Nov 26 08:21:38 2001
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT