Re: [OpenMap Users] Problems with Projection Loader properties

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Fri, 6 Jul 2012 13:03:24 -0400

Hi Greg,

On Jul 5, 2012, at 3:50 PM, Greg Jewell wrote:

> Hello,
>
> I have encountered another issues with porting an application to use OpenMap 5. A button on the application UI causes PropertyHandler.createOpenMapProperties(..) to be called. From here, the ProjectionFactory.getProperties(..) method is called is eventually called. The ProjectionFactory tries to iterate over all of its projection loader classes, and to obtain the property prefix for each of them. However, the prefix is always null, and is causing a NullPointerException to be thrown at line 168.

Why is the prefix null? I don't see how the read from properties will work if the prefix for each ProjectionLoader is null.

The null pointer exception is a bug, and I think if the prefix is null the code should probably try to generate a unique prefix to use in the properties.


>
> In OpenMap 4.6.5, the ProjectionFactory class simply returns the Properties object passed into the method, or an empty Properties if the original was null. I created a class that derived from ProjectionFactory with this older implementation of getProperties(..) and placed this new class in the openmap.properties file, but the original class still loaded.
>
> How can I get my custom ProjectionFactory class to load? Is this the best solution?

The ProjectionFactory moved in OM5 from being a singleton class to being a SoloMapComponent, which means only one can be in a MapHandler at a time - so different MapBeans can have different projections available to them.

The OM5 ProjectionFactory will still generate a new Properties object if a null one is passed in, that's handled in the OMComponent superclass.

I think the problem could be better handled if the ProjectionLoaders had property prefixes on them - if they are being created via a properties file, they should have them. If they are being created that way and don't have prefixes, that's a bug I haven't seen.

- Don

--
[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 Jul 06 2012 - 13:04:48 EDT

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