java.lang.NullPointerException

Atlassian JIRA | Dmitry Zagorovsky | 2 years ago
  1. 0

    How to reproduce: 1. Disable all bamboo agents (remote and local); 2. start deployment project; 3. start remote agent. The problem is in the following method: com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl#getDeploymentExecutingOnAgent Here it is (incorrect code highlighted with *****): {code} @Nullable @Override public DeploymentInProgress getDeploymentExecutingOnAgent(final long agentId) { for (DeploymentInProgress deploymentInProgress : deploymentInProgressMap.values()) { *****if (deploymentInProgress.getAgentId() == agentId)**** { return deploymentInProgress; } } return null; } {code} deploymentInProgress.getAgentId() is null (deployment is still unassigned) and it's unboxing before compare execution leads to NPE: {code} [RemoteInvocationTraceInterceptor] Processing of BambooJmsServiceExporter remote call resulted in fatal exception: com.atlassian.bamboo.buildqueue.manager.RemoteAgentManager.registerAgent [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl.getDeploymentExecutingOnAgent(DeploymentsInProgressServiceImpl.java:103) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonDeployment(AgentManagerImpl.java:542) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonBuild(AgentManagerImpl.java:570) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy87.abandonBuild(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl$2.visitRemote(RemoteAgentManagerImpl.java:246) [INFO] [talledLocalContainer] at com.atlassian.bamboo.v2.build.agent.RemoteAgentDefinitionImpl.accept(RemoteAgentDefinitionImpl.java:49) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerReturningAgent(RemoteAgentManagerImpl.java:155) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerAgent(RemoteAgentManagerImpl.java:99) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy104.registerAgent(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205) [INFO] [talledLocalContainer] at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:112) [INFO] [talledLocalContainer] at org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.doInvoke(JmsServiceExporterMessageListener.java:222) [INFO] [talledLocalContainer] at com.atlassian.bamboo.lingo.BambooJmsServiceExporter.doInvoke(BambooJmsServiceExporter.java:42) [INFO] [talledLocalContainer] at org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.onMessage(JmsServiceExporterMessageListener.java:102) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1361) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [INFO] [talledLocalContainer] at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129) [INFO] [talledLocalContainer] at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:695) {code}

    Atlassian JIRA | 2 years ago | Dmitry Zagorovsky
    java.lang.NullPointerException
  2. 0

    How to reproduce: 1. Disable all bamboo agents (remote and local); 2. start deployment project; 3. start remote agent. The problem is in the following method: com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl#getDeploymentExecutingOnAgent Here it is (incorrect code highlighted with *****): {code} @Nullable @Override public DeploymentInProgress getDeploymentExecutingOnAgent(final long agentId) { for (DeploymentInProgress deploymentInProgress : deploymentInProgressMap.values()) { *****if (deploymentInProgress.getAgentId() == agentId)**** { return deploymentInProgress; } } return null; } {code} deploymentInProgress.getAgentId() is null (deployment is still unassigned) and it's unboxing before compare execution leads to NPE: {code} [RemoteInvocationTraceInterceptor] Processing of BambooJmsServiceExporter remote call resulted in fatal exception: com.atlassian.bamboo.buildqueue.manager.RemoteAgentManager.registerAgent [INFO] [talledLocalContainer] java.lang.NullPointerException [INFO] [talledLocalContainer] at com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl.getDeploymentExecutingOnAgent(DeploymentsInProgressServiceImpl.java:103) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonDeployment(AgentManagerImpl.java:542) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonBuild(AgentManagerImpl.java:570) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [INFO] [talledLocalContainer] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy87.abandonBuild(Unknown Source) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl$2.visitRemote(RemoteAgentManagerImpl.java:246) [INFO] [talledLocalContainer] at com.atlassian.bamboo.v2.build.agent.RemoteAgentDefinitionImpl.accept(RemoteAgentDefinitionImpl.java:49) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerReturningAgent(RemoteAgentManagerImpl.java:155) [INFO] [talledLocalContainer] at com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerAgent(RemoteAgentManagerImpl.java:99) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70) [INFO] [talledLocalContainer] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) [INFO] [talledLocalContainer] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) [INFO] [talledLocalContainer] at com.sun.proxy.$Proxy104.registerAgent(Unknown Source) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [INFO] [talledLocalContainer] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [INFO] [talledLocalContainer] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [INFO] [talledLocalContainer] at java.lang.reflect.Method.invoke(Method.java:597) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205) [INFO] [talledLocalContainer] at org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76) [INFO] [talledLocalContainer] at org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:112) [INFO] [talledLocalContainer] at org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.doInvoke(JmsServiceExporterMessageListener.java:222) [INFO] [talledLocalContainer] at com.atlassian.bamboo.lingo.BambooJmsServiceExporter.doInvoke(BambooJmsServiceExporter.java:42) [INFO] [talledLocalContainer] at org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.onMessage(JmsServiceExporterMessageListener.java:102) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1361) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131) [INFO] [talledLocalContainer] at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202) [INFO] [talledLocalContainer] at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129) [INFO] [talledLocalContainer] at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [INFO] [talledLocalContainer] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [INFO] [talledLocalContainer] at java.lang.Thread.run(Thread.java:695) {code}

    Atlassian JIRA | 2 years ago | Dmitry Zagorovsky
    java.lang.NullPointerException
  3. 0

    Android: Saving Map State in Google map

    Stack Overflow | 11 months ago | Junie Negentien
    java.lang.RuntimeException: Unable to resume activity {com.ourThesis.junieNegentien2015/com.ourThesis.junieNegentien2015.MainActivity}: java.lang.NullPointerException
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl.getDeploymentExecutingOnAgent()
    2. com.atlassian.bamboo
      AgentManagerImpl.abandonBuild
      1. com.atlassian.bamboo.deployments.runtime.DeploymentsInProgressServiceImpl.getDeploymentExecutingOnAgent(DeploymentsInProgressServiceImpl.java:103)
      2. com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonDeployment(AgentManagerImpl.java:542)
      3. com.atlassian.bamboo.buildqueue.manager.AgentManagerImpl.abandonBuild(AgentManagerImpl.java:570)
      3 frames
    3. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    4. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    5. Spring Tx
      TransactionInterceptor.invoke
      1. org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
      1 frame
    6. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    7. com.sun.proxy
      $Proxy87.abandonBuild
      1. com.sun.proxy.$Proxy87.abandonBuild(Unknown Source)
      1 frame
    8. com.atlassian.bamboo
      RemoteAgentManagerImpl.registerAgent
      1. com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl$2.visitRemote(RemoteAgentManagerImpl.java:246)
      2. com.atlassian.bamboo.v2.build.agent.RemoteAgentDefinitionImpl.accept(RemoteAgentDefinitionImpl.java:49)
      3. com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerReturningAgent(RemoteAgentManagerImpl.java:155)
      4. com.atlassian.bamboo.buildqueue.manager.RemoteAgentManagerImpl.registerAgent(RemoteAgentManagerImpl.java:99)
      4 frames
    9. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    10. Spring AOP
      ReflectiveMethodInvocation.proceed
      1. org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
      2. org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
      3. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
      3 frames
    11. Spring Context
      RemoteInvocationTraceInterceptor.invoke
      1. org.springframework.remoting.support.RemoteInvocationTraceInterceptor.invoke(RemoteInvocationTraceInterceptor.java:70)
      1 frame
    12. Spring AOP
      JdkDynamicAopProxy.invoke
      1. org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
      2. org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
      2 frames
    13. com.sun.proxy
      $Proxy104.registerAgent
      1. com.sun.proxy.$Proxy104.registerAgent(Unknown Source)
      1 frame
    14. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:597)
      4 frames
    15. Spring Context
      RemoteInvocationBasedExporter.invokeAndCreateResult
      1. org.springframework.remoting.support.RemoteInvocation.invoke(RemoteInvocation.java:205)
      2. org.springframework.remoting.support.DefaultRemoteInvocationExecutor.invoke(DefaultRemoteInvocationExecutor.java:38)
      3. org.springframework.remoting.support.RemoteInvocationBasedExporter.invoke(RemoteInvocationBasedExporter.java:76)
      4. org.springframework.remoting.support.RemoteInvocationBasedExporter.invokeAndCreateResult(RemoteInvocationBasedExporter.java:112)
      4 frames
    16. Lingo
      JmsServiceExporterMessageListener.doInvoke
      1. org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.doInvoke(JmsServiceExporterMessageListener.java:222)
      1 frame
    17. com.atlassian.bamboo
      BambooJmsServiceExporter.doInvoke
      1. com.atlassian.bamboo.lingo.BambooJmsServiceExporter.doInvoke(BambooJmsServiceExporter.java:42)
      1 frame
    18. Lingo
      JmsServiceExporterMessageListener.onMessage
      1. org.logicblaze.lingo.jms.JmsServiceExporterMessageListener.onMessage(JmsServiceExporterMessageListener.java:102)
      1 frame
    19. ActiveMQ :: Core
      PooledTaskRunner$1.run
      1. org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1361)
      2. org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)
      3. org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)
      4. org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)
      5. org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)
      5 frames
    20. Java RT
      Thread.run
      1. java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
      2. java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
      3. java.lang.Thread.run(Thread.java:695)
      3 frames