[geotk] TemporalPrimitiveAdapter: NullPointer

Martin Desruisseaux martin.desruisseaux at geomatys.fr
Fri Mar 19 09:52:32 EDT 2010


Hello Robert

I just pushed a fix on Mercurial. You can get it right away if you get your 
source code from Mercurial, or you can just wait tomorrow after Hudson as 
performed its nightly build.

Parsing temporal primitives requires the "geotk-temporal" module, which live in 
the "pending" part of Geotoolkit.org for now. If this module is not present, the 
parser will now log a warning instead than throwing a NullPointerException, but 
the temporal primitive element will be missing from the metadata.

	Regards

		Martin


Le 19/03/10 14:26, Robert Csok a écrit :
> Hello Martin,
>
> thank you very much for providing a fix so that fragments like "#m" in "uom" attributes can now be processed.
>
> While unmarshalling some other CSW responses I figured out that the field named "factory" in the TemporalPrimitiveAdapter class is not checked against null when it is referenced in the setElement() method. And, as chance would have it, that field turned out to be null in my case.
>
> I am not sure what the default behavior should be in this particular case (when the statically invoked ServiceLoader can not find an appropriate class).
>
> Please find below the first lines of the stack trace:
>
> Exception in thread "main" java.lang.NullPointerException
>          at org.geotoolkit.internal.jaxb.referencing.TemporalPrimitiveAdapter.setElement(TemporalPrimitiveAdapter.java:131)
>          at org.geotoolkit.internal.jaxb.referencing.TemporalPrimitiveAdapter$JaxbAccessorM_getElement_setElement_org_geotoolkit_internal_jaxb_referencing_TimePeriod.set(MethodAccessor_Ref.java:45)
> [...]
>
> Best regards,
>
> Robert


More information about the Geotoolkit mailing list