Re: [OpenMap Users] Problems with Projection Loader properties

From: Greg Jewell <greg17_at_jewell.net>
Date: Mon, 9 Jul 2012 09:59:55 -0400

Don,

I'm sorry for the delayed response, but I was out of the office on Friday.

I discovered that the reason that the prefix was null for the projection
loaders was due to a mistake on my part. I modified the
"openmap.components" line in the properties file, and the "projFactory"
component was accidentally removed. Putting that back in prevented the
NPEs from occurring.

However, I am encountering another issue now. Although the properties file
is apparently successfully created, reloading the map with the new
properties file causes all of the buttons along the top to disappear (pan,
zoom, etc.) As I mentioned above, I did modify the openmap.components
line, but my new components don't have any state, and just return an empty
properties object on the getProperties() call.

I noticed that if I open the custom properties file with a text editor, it
is opened in hex mode. Additionally, a lot of the properties have keys,
but no values -- they'll look like "key=" or "key= " Could the blank values
be causing these issues? What is the difference between
"openmap.components" and "main.components"? I see a lot of overlap in the
values of these properties, but they aren't identical.


Thanks again,
Greg


On Fri, Jul 6, 2012 at 1:03 PM, Don Dietrick <dfdietrick_at_gmail.com> wrote:

> 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 Mon Jul 09 2012 - 10:01:22 EDT

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