java.lang.NullPointerException

Atlassian JIRA | Jaime Silveira [Atlassian] | 2 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    After creating a plan and a deployment project using the plan, it's possible to delete the plan, leaving the project without a plan. This seems to be a expected, as this message is shown when the plan is deleted: {quote} Deployment projects related to this plan The following deployment projects are related to this plan and will not run when this plan is removed: My Deployment Project {quote} However, this is causing bugs like [this one|https://jira.atlassian.com/browse/BAM-16000] when cloning or the following stacktrace when creating an environment, failing to create it: {noformat} java.lang.NullPointerException at com.atlassian.bamboo.trigger.environment.AbstractEnvironmentTriggerConfigurator.populateContextWithBranchControlVariablesForDeployments(AbstractEnvironmentTriggerConfigurator.java:128) at com.atlassian.bamboo.trigger.dependency.AfterSuccessfulPlanTriggerConfigurator.populateContextForCreate(AfterSuccessfulPlanTriggerConfigurator.java:55) at com.atlassian.bamboo.ww2.actions.chains.admin.triggers.TriggerUIConfigBean.prepareCreateHtml(TriggerUIConfigBean.java:83) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:105) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:95) at com.google.common.collect.Iterators$8.next(Iterators.java:812) at com.google.common.collect.Lists.newArrayList(Lists.java:139) at com.google.common.collect.Lists.newArrayList(Lists.java:119) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment.prepare(CreateEnvironment.java:94) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:65) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:31) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.xwork.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.doIntercept(PaginationAwareInterceptor.java:100) at com.atlassian.bamboo.ww2.interceptors.AbstractBambooInterceptor.intercept(AbstractBambooInterceptor.java:34) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.ConditionalActionInterceptor.intercept(ConditionalActionInterceptor.java:82) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:93) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:70) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:78) {noformat} This is both not expected (a stacktrace is definitively not an expected behavior), prevents the users from completely using the system and it's now clear on how to fix it. *Steps to reproduce* # Create a build plan # Create a deployment project using that plan # Delete the plan # Clone project or try to set an environment *Expected behavior* Expected behaviors may be: # Prevent users from doing the operation while the project doesn't have a plan # Prevent users from editing the project at all while it doesn't have a plan # Prevent plan from being deleted while it's associated with deployment projects # Ask customer to set the plan in the deployment project before continuing with the operations # Have all operations work even without a plan *Actual outcome* * In both cases (and probably in other situations) a stack trace is shown and the operation is not completed *Workaround* * Set a plan before cloning/setting and environment

    Atlassian JIRA | 2 years ago | Jaime Silveira [Atlassian]
    java.lang.NullPointerException
  2. 0

    After creating a plan and a deployment project using the plan, it's possible to delete the plan, leaving the project without a plan. This seems to be a expected, as this message is shown when the plan is deleted: {quote} Deployment projects related to this plan The following deployment projects are related to this plan and will not run when this plan is removed: My Deployment Project {quote} However, this is causing bugs like [this one|https://jira.atlassian.com/browse/BAM-16000] when cloning or the following stacktrace when creating an environment, failing to create it: {noformat} java.lang.NullPointerException at com.atlassian.bamboo.trigger.environment.AbstractEnvironmentTriggerConfigurator.populateContextWithBranchControlVariablesForDeployments(AbstractEnvironmentTriggerConfigurator.java:128) at com.atlassian.bamboo.trigger.dependency.AfterSuccessfulPlanTriggerConfigurator.populateContextForCreate(AfterSuccessfulPlanTriggerConfigurator.java:55) at com.atlassian.bamboo.ww2.actions.chains.admin.triggers.TriggerUIConfigBean.prepareCreateHtml(TriggerUIConfigBean.java:83) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:105) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:95) at com.google.common.collect.Iterators$8.next(Iterators.java:812) at com.google.common.collect.Lists.newArrayList(Lists.java:139) at com.google.common.collect.Lists.newArrayList(Lists.java:119) at com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment.prepare(CreateEnvironment.java:94) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:167) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:65) at com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:31) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.xwork.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.doIntercept(PaginationAwareInterceptor.java:100) at com.atlassian.bamboo.ww2.interceptors.AbstractBambooInterceptor.intercept(AbstractBambooInterceptor.java:34) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.ConditionalActionInterceptor.intercept(ConditionalActionInterceptor.java:82) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.atlassian.bamboo.ww2.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:93) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:70) at com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36) at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:78) {noformat} This is both not expected (a stacktrace is definitively not an expected behavior), prevents the users from completely using the system and it's now clear on how to fix it. *Steps to reproduce* # Create a build plan # Create a deployment project using that plan # Delete the plan # Clone project or try to set an environment *Expected behavior* Expected behaviors may be: # Prevent users from doing the operation while the project doesn't have a plan # Prevent users from editing the project at all while it doesn't have a plan # Prevent plan from being deleted while it's associated with deployment projects # Ask customer to set the plan in the deployment project before continuing with the operations # Have all operations work even without a plan *Actual outcome* * In both cases (and probably in other situations) a stack trace is shown and the operation is not completed *Workaround* * Set a plan before cloning/setting and environment

    Atlassian JIRA | 2 years ago | Jaime Silveira [Atlassian]
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.bamboo.trigger.environment.AbstractEnvironmentTriggerConfigurator.populateContextWithBranchControlVariablesForDeployments()
    2. com.atlassian.bamboo
      CreateEnvironment$1.apply
      1. com.atlassian.bamboo.trigger.environment.AbstractEnvironmentTriggerConfigurator.populateContextWithBranchControlVariablesForDeployments(AbstractEnvironmentTriggerConfigurator.java:128)
      2. com.atlassian.bamboo.trigger.dependency.AfterSuccessfulPlanTriggerConfigurator.populateContextForCreate(AfterSuccessfulPlanTriggerConfigurator.java:55)
      3. com.atlassian.bamboo.ww2.actions.chains.admin.triggers.TriggerUIConfigBean.prepareCreateHtml(TriggerUIConfigBean.java:83)
      4. com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:105)
      5. com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment$1.apply(CreateEnvironment.java:95)
      5 frames
    3. Guava
      Lists.newArrayList
      1. com.google.common.collect.Iterators$8.next(Iterators.java:812)
      2. com.google.common.collect.Lists.newArrayList(Lists.java:139)
      3. com.google.common.collect.Lists.newArrayList(Lists.java:119)
      3 frames
    4. com.atlassian.bamboo
      CreateEnvironment.prepare
      1. com.atlassian.bamboo.deployments.environments.actions.CreateEnvironment.prepare(CreateEnvironment.java:94)
      1 frame
    5. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:167)
      2. com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)
      3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      4. com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:139)
      5. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      5 frames
    6. com.atlassian.bamboo
      WebworkSecurityInterceptorProxy.intercept
      1. com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptor.intercept(WebworkSecurityInterceptor.java:65)
      2. com.atlassian.bamboo.security.acegi.intercept.web.WebworkSecurityInterceptorProxy.intercept(WebworkSecurityInterceptorProxy.java:31)
      2 frames
    7. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      1 frame
    8. com.atlassian.xwork
      AroundInterceptor.intercept
      1. com.atlassian.xwork.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25)
      1 frame
    9. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      1 frame
    10. com.atlassian.bamboo
      AbstractBambooInterceptor.intercept
      1. com.atlassian.bamboo.ww2.interceptors.PaginationAwareInterceptor.doIntercept(PaginationAwareInterceptor.java:100)
      2. com.atlassian.bamboo.ww2.interceptors.AbstractBambooInterceptor.intercept(AbstractBambooInterceptor.java:34)
      2 frames
    11. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      1 frame
    12. com.atlassian.bamboo
      ConditionalActionInterceptor.intercept
      1. com.atlassian.bamboo.ww2.interceptors.ConditionalActionInterceptor.intercept(ConditionalActionInterceptor.java:82)
      1 frame
    13. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      2. com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:191)
      3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      3 frames
    14. com.atlassian.bamboo
      AroundInterceptor.intercept
      1. com.atlassian.bamboo.ww2.interceptors.AroundInterceptor.intercept(AroundInterceptor.java:25)
      1 frame
    15. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      1 frame
    16. Struts2
      ServletConfigInterceptor.intercept
      1. org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)
      1 frame
    17. XWork
      DefaultActionInvocation.invoke
      1. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      2. com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:193)
      3. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      4. com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:189)
      5. com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:246)
      5 frames
    18. Struts2
      StrutsExecuteFilter.doFilter
      1. org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:54)
      2. org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:564)
      3. org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)
      4. org.apache.struts2.dispatcher.ng.filter.StrutsExecuteFilter.doFilter(StrutsExecuteFilter.java:93)
      4 frames
    19. Glassfish Core
      ApplicationFilterChain.doFilter
      1. org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      2. org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      2 frames
    20. com.atlassian.plugin
      DelegatingPluginFilter$1.doFilter
      1. com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:46)
      2. com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:70)
      2 frames
    21. com.atlassian.labs
      BotKillerFilter.doFilter
      1. com.atlassian.labs.botkiller.BotKillerFilter.doFilter(BotKillerFilter.java:36)
      1 frame
    22. com.atlassian.plugin
      DelegatingPluginFilter.doFilter
      1. com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:78)
      1 frame