[OpenMap Users] Trying to display some VMAP features with the VPFLayer results in NullpointerExceptions

From: Straub, Daniel <Daniel.Straub_at_cassidian.com>
Date: Fri, 17 Aug 2012 14:53:18 +0200

Hi,

I got a problem while using the VPFLayer for displaying VMAP-data
(OpenMap 5.0):
Some features work without any problems. Others result in errors, when
additional features are displayed.

For example:
When I add the feature "Spot Elevation" which displays epoints, it does
not cause any exceptions.
Now I add the feature "Trees" which should display areas, I get the
following NullpointerException on each generate of the VPFLayer:

com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker construct
INFO: VMAP|LayerWorker.construct(): java.lang.NullPointerException, null
java.lang.NullPointerException
        at
com.bbn.openmap.layer.vpf.VPFFeatureCache.loadCachedGraphicList(VPFFeatu
reCache.java:113)
        at
com.bbn.openmap.layer.vpf.VPFFeatureCache.needToFetchTileContents(VPFFea
tureCache.java:149)
        at
com.bbn.openmap.layer.vpf.VPFCachedFeatureGraphicWarehouse.needToFetchTi
leContents(VPFCachedFeatureGraphicWarehouse.java:188)
        at
com.bbn.openmap.layer.vpf.CoverageTable.drawFeaturesFromThematicIndex(Co
verageTable.java:677)
        at
com.bbn.openmap.layer.vpf.CoverageTable.drawFeatures(CoverageTable.java:
492)
        at
com.bbn.openmap.layer.vpf.LibrarySelectionTable.drawFeatures(LibrarySele
ctionTable.java:402)
        at com.bbn.openmap.layer.vpf.VPFLayer.prepare(VPFLayer.java:706)
        at
com.bbn.openmap.layer.policy.BufferedImageRenderPolicy.prepare(BufferedI
mageRenderPolicy.java:101)
        at
com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker.construct(OMGrap
hicHandlerLayer.java:725)
        at
com.bbn.openmap.layer.OMGraphicHandlerLayer$LayerWorker.construct(OMGrap
hicHandlerLayer.java:707)
        at
com.bbn.openmap.util.PooledSwingWorker$1.call(PooledSwingWorker.java:31)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source)
        at java.lang.Thread.run(Unknown Source)

I see where the problem is: In the class VPFFeatureCache the method
loadCachedGraphicList is called a few times. Then at some call the
following parameters are set to:

libraryName = "lib_024b"
featureType = "elevp"
tilePath = "m/k/h/e/"
requestor = OMGraphicList

The variable "key" is then set to "lib_024b-elevp-m/k/h/e/" and the
boolean "exists" is set to false. (I'm now at line 110)
The call VPFUtil.getTypeForFeatureCode(feautureType) returns null
(because featureType ends with p and the code for that is commented
out).
Now the get is called with the nullpointer in the same line (111), to
retrieve the FeatureCacheGraphicList. The get() calls load(), again with
the nullpointer, which is returning null now (caused by the
nullpointer).
Returning back to the method loadCachedGraphicList the
FeatureCacheGraphicList is now set to null, and therefore the
getFeatureName() call on that nullpointer causes the exception to be
thrown.

Displaying the "trees" feature alone, does not cause any exception...

My problem now is: I don't really understand what happens there, or what
should happen. I would appreciate some help, if anyone knows more about
that.

Thanks in advance,
Daniel Straub


--
[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 Fri Aug 17 2012 - 08:54:48 EDT

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