NPE when deleting a participant's SD without metadata
2022-12-15 13:05:03.437 DEBUG 1 --- [http-nio-8081-exec-19] o.s.security.web.FilterChainProxy : Securing GET /participants
2022-12-15 13:05:03.437 DEBUG 1 --- [http-nio-8081-exec-19] s.s.w.c.SecurityContextPersistenceFilter : Set SecurityContextHolder to empty SecurityContext
2022-12-15 13:05:03.438 DEBUG 1 --- [http-nio-8081-exec-19] o.s.s.o.s.r.a.JwtAuthenticationProvider : Authenticated token
2022-12-15 13:05:03.438 DEBUG 1 --- [http-nio-8081-exec-19] .o.s.r.w.BearerTokenAuthenticationFilter : Set SecurityContextHolder to JwtAuthenticationToken [Principal=org.springframework.security.oauth2.jwt.Jwt@6503639, Credentials=[PROTECTED], Authenticated=true, Details=WebAuthenticationDetails [RemoteIpAddress=31.11.204.110, SessionId=null], Granted Authorities=[ROLE_Ro-MU-A, SCOPE_openid, SCOPE_gaia-x, ROLE_Ro-PA-A, ROLE_Ro-MU-CA, ROLE_Ro-SD-A]]
2022-12-15 13:05:03.438 DEBUG 1 --- [http-nio-8081-exec-19] o.s.s.w.a.i.FilterSecurityInterceptor : Authorized filter invocation [GET /participants] with attributes [hasAnyRole('ROLE_Ro-MU-CA')]
2022-12-15 13:05:03.438 DEBUG 1 --- [http-nio-8081-exec-19] o.s.security.web.FilterChainProxy : Secured GET /participants
2022-12-15 13:05:03.438 DEBUG 1 --- [http-nio-8081-exec-19] o.s.web.servlet.DispatcherServlet : GET "/participants", parameters={}
2022-12-15 13:05:03.439 DEBUG 1 --- [http-nio-8081-exec-19] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to eu.gaiax.difs.fc.server.generated.controller.ParticipantsApiController#getParticipants(Integer, Integer)
2022-12-15 13:05:03.439 DEBUG 1 --- [http-nio-8081-exec-19] e.g.d.f.s.service.ParticipantsService : getParticipants.enter; got offset: 0, limit: 100
2022-12-15 13:05:03.451 DEBUG 1 --- [http-nio-8081-exec-19] e.g.d.f.c.s.s.i.SelfDescriptionStoreImpl : getByFilter.enter; got filter: eu.gaiax.difs.fc.core.pojo.SdFilter@207be2e1, withMeta: true, withContent: true
2022-12-15 13:05:03.451 DEBUG 1 --- [http-nio-8081-exec-19] e.g.d.f.c.s.s.i.SelfDescriptionStoreImpl : buildCountQuery; Query: select count(*) from sdfiles where 1=1 and (sdhash in (:hashes))
2022-12-15 13:05:03.452 DEBUG 1 --- [http-nio-8081-exec-19] e.g.d.f.c.s.s.i.SelfDescriptionStoreImpl : buildHqlQuery; Query: select sdhash, subjectid, status, issuer, uploadtime, statustime, expirationtime, validators, null as content from sdfiles where 1=1 and (sdhash in (:hashes)) order by statustime desc, sdhash
2022-12-15 13:05:03.453 DEBUG 1 --- [http-nio-8081-exec-19] e.g.d.f.c.s.s.i.SelfDescriptionStoreImpl : getByFilter.exit; returning records: 0, total: 0
2022-12-15 13:05:03.453 DEBUG 1 --- [http-nio-8081-exec-19] o.s.web.servlet.DispatcherServlet : Failed to complete request: java.lang.NullPointerException
2022-12-15 13:05:03.454 DEBUG 1 --- [http-nio-8081-exec-19] s.s.w.c.SecurityContextPersistenceFilter : Cleared SecurityContextHolder to complete request
2022-12-15 13:05:03.454 ERROR 1 --- [http-nio-8081-exec-19] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause
java.lang.NullPointerException: null
at eu.gaiax.difs.fc.server.service.ParticipantsService.lambda$getParticipants$3(ParticipantsService.java:181)
at java.base/java.util.ArrayList.forEach(Unknown Source)
at eu.gaiax.difs.fc.server.service.ParticipantsService.getParticipants(ParticipantsService.java:180)
at eu.gaiax.difs.fc.server.service.ParticipantsService$$FastClassBySpringCGLIB$$8fd32d0c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy.invokeMethod(CglibAopProxy.java:386)
at org.springframework.aop.framework.CglibAopProxy.access$000(CglibAopProxy.java:85)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:704)
at eu.gaiax.difs.fc.server.service.ParticipantsService$$EnhancerBySpringCGLIB$$a48041e2.getParticipants(<generated>)
at eu.gaiax.difs.fc.server.generated.controller.ParticipantsApi.getParticipants(ParticipantsApi.java:222)
at eu.gaiax.difs.fc.server.generated.controller.ParticipantsApi$$FastClassBySpringCGLIB$$b746eab7.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:793)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.validation.beanvalidation.MethodValidationInterceptor.invoke(MethodValidationInterceptor.java:123)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:763)
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:708)
at eu.gaiax.difs.fc.server.generated.controller.ParticipantsApiController$$EnhancerBySpringCGLIB$$9eb225c3.getParticipants(<generated>)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:898)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:655)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:327)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:115)
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:122)
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:116)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:126)
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:81)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:109)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:149)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.oauth2.server.resource.web.BearerTokenAuthenticationFilter.doFilterInternal(BearerTokenAuthenticationFilter.java:142)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:103)
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:89)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.header.HeaderWriterFilter.doHeadersAfter(HeaderWriterFilter.java:90)
at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:75)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:112)
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:82)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:55)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.session.DisableEncodeUrlFilter.doFilterInternal(DisableEncodeUrlFilter.java:42)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:336)
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:211)
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:183)
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:354)
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:267)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:769)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.base/java.lang.Thread.run(Unknown Source)
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] o.s.security.web.FilterChainProxy : Securing GET /error
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] s.s.w.c.SecurityContextPersistenceFilter : Set SecurityContextHolder to empty SecurityContext
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] o.s.s.w.a.AnonymousAuthenticationFilter : Set SecurityContextHolder to anonymous SecurityContext
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] o.s.security.web.FilterChainProxy : Secured GET /error
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] o.s.web.servlet.DispatcherServlet : "ERROR" dispatch for GET "/error", parameters={}
2022-12-15 13:05:03.455 DEBUG 1 --- [http-nio-8081-exec-19] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2022-12-15 13:05:03.456 DEBUG 1 --- [http-nio-8081-exec-19] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Using 'application/json', given [application/json] and supported [application/json, application/*+json, application/json, application/*+json]
2022-12-15 13:05:03.456 DEBUG 1 --- [http-nio-8081-exec-19] o.s.w.s.m.m.a.HttpEntityMethodProcessor : Writing [{timestamp=Thu Dec 15 13:05:03 UTC 2022, status=500, error=Internal Server Error, path=/participants (truncated)...]
2022-12-15 13:05:03.456 DEBUG 1 --- [http-nio-8081-exec-19] w.c.HttpSessionSecurityContextRepository : Did not store anonymous SecurityContext
2022-12-15 13:05:03.456 DEBUG 1 --- [http-nio-8081-exec-19] o.s.web.servlet.DispatcherServlet : Exiting from "ERROR" dispatch, status 500
2022-12-15 13:05:03.457 DEBUG 1 --- [http-nio-8081-exec-19] w.c.HttpSessionSecurityContextRepository : Did not store anonymous SecurityContext
2022-12-15 13:05:03.457 DEBUG 1 --- [http-nio-8081-exec-19] s.s.w.c.SecurityContextPersistenceFilter : Cleared SecurityContextHolder to complete request
Edited by Cristina Pauna