checkProjectGroupRole throws NullPointException if mapping does not exist #907

Open
jhiemer opened this Issue Dec 30, 2016 · 1 comment

Projects

None yet

2 participants

@jhiemer
jhiemer commented Dec 30, 2016 edited

When executing the checkProjectGroupRole I get NPE. Stack trace is as follows:

2016-12-30T22:18:11.03+0100 [APP/0]      OUT java.lang.NullPointerException: null
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.util.ReadFromStream.readFromStream(ReadFromStream.java:30)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.core.BaseClientResponse.copyFromError(BaseClientResponse.java:110)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.ClientResponseFailure.<init>(ClientResponseFailure.java:32)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.core.BaseClientResponse.readFrom(BaseClientResponse.java:432)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:390)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:361)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.jboss.resteasy.client.core.BaseClientResponse.getEntity(BaseClientResponse.java:355)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.connectors.resteasy.HttpResponseImpl.readEntity(HttpResponseImpl.java:116)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.core.transport.functions.ResponseToActionResponse.apply(ResponseToActionResponse.java:31)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.core.transport.functions.ResponseToActionResponse.apply(ResponseToActionResponse.java:22)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.core.transport.HttpEntityHandler.handle(HttpEntityHandler.java:36)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.connectors.resteasy.HttpResponseImpl.getEntity(HttpResponseImpl.java:64)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:220)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.openstack.internal.BaseOpenStackService$Invocation.execute(BaseOpenStackService.java:202)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.openstack4j.openstack.identity.v3.internal.RoleServiceImpl.checkProjectGroupRole(RoleServiceImpl.java:167)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at de.cloudscale.cloud.openstack.fluent.KeystoneFluent.checkProjectGroupRole(KeystoneFluent.java:145)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at de.cloudscale.web.customer.PlatformInstanceController.access(PlatformInstanceController.java:143)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at de.cloudscale.web.customer.PlatformInstanceController$$FastClassBySpringCGLIB$$95b36c4e.invoke(<generated>)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:721)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:69)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:656)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at de.cloudscale.web.customer.PlatformInstanceController$$EnhancerBySpringCGLIB$$98ce14e9.access(<generated>)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
2016-12-30T22:18:11.03+0100 [APP/0]      OUT 	at java.lang.reflect.Method.invoke(Method.java:498)

If the mapping does exist it works without any problem

@auhlig
Member
auhlig commented Dec 30, 2016

Hi @jhiemer,
Thanks for reporting.
I thought I covered that with a test. I'll take a look

@auhlig auhlig self-assigned this Dec 30, 2016
@auhlig auhlig added the bug label Dec 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment