-----Ursprungligt meddelande-----
Från: Marklund David
Skickat: den 17 april 2002 14:09
Till: 'Don Dietrick'
Ämne: SV: dted-layer
Hi Don and list,
I have now taken some time looking at the dted problems that I still have.
Reminder : I am running an application via Java Web Start and when packing
the dted in a jar it hangs when trying to show the dted layer. I have
isolated the hanging to
StremInputReader.java, method 'skipbytes'. The inputStream.skip method
returns zero for some reason.
public long skipBytes(long n) throws IOException {
System.out.println("skipBytes("+n+")");
long count = 0;
long gotsofar = 0;
while (count < n) {
gotsofar = inputStream.skip(n - count);
if(gotsofar==0) //added these two rows
break;
count += gotsofar;
}
count((int) count);
return count;
}
Now the dted layer shows as the appended image, but no data is shown when
the skip method returned zero.
This is an abstract from the javadoc of InputStream.skip() :
"The skip method may, for a variety of reasons, end up skipping over some
smaller number of bytes, possibly 0. This may result from any of a number of
conditions; reaching end of file before n bytes have been skipped is only
one possibility."
This seems to be the issue. But why does it return 0 for some of the dted
files ?
My dted files shows properly when not in a jar, running the application as a
StandAlone app.
Any ideas ?
Cheers
David
-----Ursprungligt meddelande-----
Från: Don Dietrick [mailto:dietrick@bbn.com]
Skickat: den 4 mars 2002 15:19
Till: Marklund David
Kopia: 'openmap-users@bbn.com'
Ämne: Re: dted-layer
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"]
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT