Project

General

Profile

bug #8829

NullPointerException (NPE) in TaxonNodeService

Added by Andreas Kohlbecker 2 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
01/27/2020
Due date:
% Done:

100%

Severity:
critical
Found in Version:

Description

the request http://api.cybertaxonomy.org:80/euromed/taxonNode/f7a20e6e-c144-4d9e-b307-03a1f3b5305a causes

java.lang.NullPointerException
        at eu.etaxonomy.cdm.api.service.TaxonNodeServiceImpl.dto(TaxonNodeServiceImpl.java:256)
        at sun.reflect.GeneratedMethodAccessor42965.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.$Proxy793.dto(Unknown Source)
        at eu.etaxonomy.cdm.remote.controller.TaxonNodeController.doGet(TaxonNodeController.java:83)
        at sun.reflect.GeneratedMethodAccessor42964.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)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
        at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)

Associated revisions

Revision 4a428ec2 (diff)
Added by Andreas Müller 2 months ago

ref #8829 fix NPE in TaxonNodeServiceImpl.dto

Revision 24ebd429 (diff)
Added by Andreas Kohlbecker 2 months ago

ref #8829 sending http error code in case taxonNode uuid is not found

History

#1 Updated by Andreas Müller 2 months ago

  • Status changed from New to Feedback
  • Assignee changed from Andreas Müller to Andreas Kohlbecker
  • % Done changed from 0 to 40

The NPE in TaxonNodeServiceImpl.dto has been fixed. Please review and check that controller returns correct http error (404 ?) when null is returned.

#2 Updated by Andreas Kohlbecker 2 months ago

  • Status changed from Feedback to Closed
  • Assignee changed from Andreas Kohlbecker to Andreas Müller
  • % Done changed from 40 to 100

Your fix is correct.

I added a further null check in the controller method so that the the service responds with the correct http code in case the uuid does not exists.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)