Project

General

Profile

Actions

bug #6825

closed

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

Added by Andreas Müller almost 5 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
blocker
Found in Version:

Actions #1

Updated by Andreas Kohlbecker almost 5 years 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)
Actions #2

Updated by Andreas Kohlbecker almost 5 years ago

The code line throwing the exception is:

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

so there must be incomplete point data.

Actions #3

Updated by Andreas Müller almost 5 years 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

Actions #4

Updated by Andreas Müller almost 5 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50
Actions #5

Updated by Andreas Müller almost 5 years ago

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

please review

Actions #6

Updated by Andreas Kohlbecker almost 5 years 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

Actions #7

Updated by Andreas Müller over 4 years ago

  • Assignee changed from Andreas Kohlbecker to Andreas Müller

it's more a matter of performance :-)

Actions

Also available in: Atom PDF