Re: [OpenMap Users] Political Layer NullPointerException

From: Andrew Hnatiw <Andrew_Hnatiw_at_raytheon.com>
Date: Wed, 6 Oct 2004 13:01:32 -0400

Here's the stack backtrace for that error:

java.lang.NullPointerException
        at
com.bbn.openmap.layer.shape.ShapeLayer.prepare(ShapeLayer.java:372)
        at
com.bbn.openmap.layer.policy.StandardRenderPolicy.prepare(StandardRenderPolicy.java:68)
        at
com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker.construct(OMGraphicHandlerLayer.java:590)
        at com.bbn.openmap.util.SwingWorker$2.run(SwingWorker.java:107)
        at java.lang.Thread.run(Thread.java:536)

It sometimes happens on startup (I think...), though it usually happens
when I send a bunch of new graphics through
the network to the plugin I wrote. I was getting another error at some
point where it would complain that the thread
reading in the Political Boundaries Layer data from a file was being
interrupted - I'd like to say that they're probably related.
To get rid of that I just modified BinaryBufferedFile to not throw that
exception. it worked for a while, and now I get the above
error.

Here is the original error that I was suppressing to get the above error:

java.io.InterruptedIOException
        at java.io.RandomAccessFile.readBytes(Native Method)
        at java.io.RandomAccessFile.read(RandomAccessFile.java:303)
        at
com.bbn.openmap.io.FileInputReader.read(FileInputReader.java:209)
        at com.bbn.openmap.io.BinaryFile.read(BinaryFile.java:456)
        at
com.bbn.openmap.io.BinaryBufferedFile.assertSize(BinaryBufferedFile.java:162)
        at
com.bbn.openmap.io.BinaryBufferedFile.readInteger(BinaryBufferedFile.java:428)
        at
com.bbn.openmap.layer.shape.SpatialIndex.locateRecords(SpatialIndex.java:288)
        at
com.bbn.openmap.layer.shape.ShapeLayer.prepare(ShapeLayer.java:368)
        at
com.bbn.openmap.layer.policy.StandardRenderPolicy.prepare(StandardRenderPolicy.java:68)
        at
com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker.construct(OMGraphicHandlerLayer.java:590)
        at com.bbn.openmap.util.SwingWorker$2.run(SwingWorker.java:107)
        at java.lang.Thread.run(Thread.java:536)

All I can guess is that when I send data over the network the thread that
is reading from the file in FileInputReader gets
interrupted by my thread reading in from the network. How can I keep this
from happening?

Thanks,
Andrew Hnatiw


Don Dietrick <dietrick_at_bbn.com> wrote on 10/06/2004 12:15:51 PM:

>
> On Oct 6, 2004, at 11:18 AM, Andrew Hnatiw wrote:
>
> >
> > When I run my code on a Solaris box I get an error window that pops up

> > and says
> >
> > "Political Boundaries|LayerWorker.construct():
> > java.lang.NullPointerException"
> >
> > and the backtrace says that it occurred at ShapeLayer.java:372. This
> > appears to be where it grabs
> > data from a file... I only get the error every once in a while, and
> > when I do the political layer doesn't get
> > drawn. If I cause the screen to redraw for any reason it will usually

> > draw itself fine afterwards.
> >
> > Does anybody know how to fix this, or at least how to get rid of the
> > error window that pops up? I am giving
> > a demo of my work next week and would love to not have error messages
> > popping up.
>
> You can comment out the call to fireRequestMessage() at the bottom of
> the OMGraphicHandler's LayerWorker.construct() method.
>
> Have you got a stack trace of the null pointer exception?
>
> - Don
>
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Don Dietrick, dietrick_at_bbn.com
> BBN Technologies, Cambridge, MA
> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>

--
[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 Wed Oct 06 2004 - 13:04:13 EDT

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