Project

General

Profile

bug #6825

Specimen map shows point data only if ALL field units are georeferenced

Added by Andreas Müller over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
07/18/2017
Due date:
% Done:

100%

Severity:
blocker
Found in Version:

Associated revisions

Revision 699c8224 (diff)
Added by Andreas Müller over 1 year ago

fix #6825 remove null points from fieldUnitPoints list

Revision 9d327042 (diff)
Added by Andreas Müller over 1 year ago

fix #6825 again handle null points, to be on the safe side

History

#1 Updated by Andreas Kohlbecker over 1 year ago

  • Category changed from cdm-dataportal to cdmlib
  • Assignee changed from Andreas Kohlbecker to Andreas Müller

the root cause for this is a NPE in EditGeoServiceUtilities

http://test.e-taxonomy.eu/cdmserver/salvador/ext/edit/mapServiceParameters/taxonOccurrencesFor/507e13f3-5db7-45a6-a41e-07f0de20348a.json?relationshipsInvers=&relationships=

Caused by: java.lang.NullPointerException
    at eu.etaxonomy.cdm.ext.geo.EditGeoServiceUtilities.addToStyleAndData(EditGeoServiceUtilities.java:626)
    at eu.etaxonomy.cdm.ext.geo.EditGeoServiceUtilities.getOccurrenceServiceRequestParameterString(EditGeoServiceUtilities.java:579)
    at eu.etaxonomy.cdm.ext.geo.EditGeoService.getOccurrenceServiceRequestParameterString(EditGeoService.java:230)
    at sun.reflect.GeneratedMethodAccessor3185.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
    at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
    at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)
    at com.sun.proxy.$Proxy6786.getOccurrenceServiceRequestParameterString(Unknown Source)
    at eu.etaxonomy.cdm.remote.controller.ext.ExternalGeoController.doGetOccurrenceMapUriParams(ExternalGeoController.java:221)
    at sun.reflect.GeneratedMethodAccessor3184.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:222)
    at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
    at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:814)
    at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:737)
    at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)

#2 Updated by Andreas Kohlbecker over 1 year ago

The code line throwing the exception is:

data.append(point.getLatitude() + "," + point.getLongitude());

so there must be incomplete point data.

#3 Updated by Andreas Müller over 1 year ago

The main problem is in EditGeoService l221ff


            if (specimenOrObservation instanceof FieldUnit) {
                fieldUnitPoints.add(((FieldUnit) specimenOrObservation).getGatheringEvent()
                        .getExactLocation());
            }

a check is missing if point data is available (we can't expect that all gatheringEvents do have point data

#4 Updated by Andreas Müller over 1 year ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

#5 Updated by Andreas Müller over 1 year ago

  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 50 to 90

please review

#6 Updated by Andreas Kohlbecker over 1 year ago

  • Status changed from Resolved to Closed
  • % Done changed from 90 to 100

using

try {
...
} catch (NullPointerException e){ /*IGONRE*/ }

would improve readability, but anyway, this is a matter of taste.

well done & 150% fixed

Andreas

#7 Updated by Andreas Müller about 1 year ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

it's more a matter of performance :-)

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)