Hi Ken,
On Monday, March 4, 2002, at 11:15 AM, Ken Anderson wrote:
> I don't think this is the right fix, because it will force people to
> call setContextClassLoader on threads they create.
If they don't, then the default is (according to the JavaDoc) "the
ClassLoader context of the parent Thread. The context ClassLoader of the
primordial thread is typically set to the class loader used to load the
application."
I think it's OK - default ClassLoaders get set.
> I don't do that because i never say this method before i read your
> email.
Me neither, until Alexander Sokolov wrote in with it.
>
> Instead do something like
>
> url = this.getClass().getResource(name);
>
> This will use the same classloader as the class that wants the resource.
I'm pretty sure this doesn't work unless the data file is in the same
place (classpath wise) as the resource. That's the problem we're trying
to avoid.
The problem seems to be that the classloader never checks the classpath,
when working within an applet and looking for resource files. The
AppletDataNugget was a hack to try to give the ClassLoader a hint on
where to look for them, but it's my understanding that the new code line
makes the AppletDataNuggets unnecessary, and things work as expected.
- Don
>
> At 09:18 AM 3/4/2002, Don Dietrick wrote:
>> Hi David,
>>
>> There is a problem with the way that the ClassLoader is used in 4.4.2,
>> that is updated for 4.5 when it comes out. In
>> com.bbn.openmap.io.BinaryFile, you want to change:
>>
>> url = ClassLoader.getSystemResource(name);
>> to
>> url =
>> Thread.currentThread().getContextClassLoader().getResource(name);
>>
>> in both places it occurs.
>>
>> Otherwise, you have to deal with the AppletDataNugget class, and there
>> is documentation on using it in the Javadocs and FAQ.
>>
>> Hope this helps,
>>
>> Don
>>
>> On Monday, March 4, 2002, at 02:41 AM, Marklund David wrote:
>>
>>> Hi all,
>>> I finally have a dted layer running in my application, with a fairly
>>> amount
>>> of data.
>>> Now my problem is:
>>>
>>> I deploy my app. by using java webstart
>>> (java.sun.com/products/javawebstart), using jws all resources must be
>>> packed
>>> in
>>> a jar file, and when I do so the dted layer hangs, no error messages.
>>> (It hangs without java web start also, if the dted files is in a jar)
>>>
>>> Last line in log is "DTEDLayer: Creating cache! (This is a one-time
>>> operation!)" Then it hangs with 99 % CPU.
>>>
>>> Any ideas ? I have none.
>>>
>>> Cheers
>>>
>>> David
>>>
>>> --
>>> [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"]
>>>
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Don 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 Mar 4 13:50:45 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:32 EDT