java.lang.NullPointerException

Atlassian JIRA | FLYnet | 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

    We need a Plugin for Jira, that creates a Project with some Parameter and a Agile Board for the Project. In the Test-System that starts with "atlas-run" we have no errors. The Project and the Agile Board is configured correctly. But if we upload it to the production system (same Jira und Jira Agile version), we run in an error. The Project is configured correctly, but there is no Agile Board. The Code: {code:title=KanbanBigProjectHook.java|borderStyle=solid} package de.flynet.plugins.mytest.projectblueprint; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.atlassian.crowd.embedded.api.User; import com.atlassian.greenhopper.api.rapid.view.Column; import com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl; import com.atlassian.jira.blueprint.api.AddProjectHook; import com.atlassian.jira.blueprint.api.ConfigureData; import com.atlassian.jira.blueprint.api.ConfigureResponse; import com.atlassian.jira.blueprint.api.ValidateData; import com.atlassian.jira.blueprint.api.ValidateResponse; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.config.DefaultStatusManager; import com.atlassian.jira.issue.search.DefaultSearchRequestManager; import com.atlassian.jira.issue.search.SearchRequest; import com.atlassian.jira.issue.status.Status; import com.atlassian.jira.jql.builder.JqlClauseBuilder; import com.atlassian.jira.jql.builder.JqlQueryBuilder; import com.atlassian.jira.project.Project; import com.atlassian.jira.project.ProjectManager; import com.atlassian.jira.scheme.Scheme; import com.atlassian.jira.user.ApplicationUser; import com.atlassian.jira.util.ErrorCollection; import com.atlassian.jira.util.SimpleErrorCollection; import com.atlassian.jira.workflow.WorkflowSchemeManager; import com.atlassian.query.Query; import com.atlassian.query.QueryImpl; import com.atlassian.query.clause.Clause; // import com.atlassian.jira.ComponentManager; // import com.atlassian.greenhopper.service.rapid.view.RapidViewServiceImpl; public class KanbanBigProjectHook implements AddProjectHook { @Override public ValidateResponse validate(final ValidateData validateData) { ValidateResponse validateResponse = ValidateResponse.create(); return validateResponse; } @Override public ConfigureResponse configure(final ConfigureData configureData) { WorkflowSchemeManager workflowSchemeManager = ComponentAccessor.getWorkflowSchemeManager(); ProjectManager projectManager = ComponentAccessor.getProjectManager(); Project project = projectManager.getProjectByCurrentKey(configureData.project().getKey()); Scheme scheme = workflowSchemeManager.getSchemeObject("Arbeitsablaufschema Test"); workflowSchemeManager.addSchemeToProject(project, scheme); List<Project> projectlist = new ArrayList<Project>(); projectlist.add(project); ApplicationUser appuser = ComponentAccessor.getUserUtil().getUserByName("admin"); User user = appuser.getDirectoryUser(); JqlClauseBuilder clausebuilder = JqlQueryBuilder.newClauseBuilder().defaultAnd().project(project.getKey()); Clause clause = clausebuilder.buildClause(); Query query = new QueryImpl(clause); SearchRequest search = new SearchRequest(query, appuser, "RV " + project.getName(), project.getName()); DefaultSearchRequestManager dsrm = null; RapidViewCreationServiceImpl rvcsi = null; DefaultStatusManager dsm = null; try { dsrm = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.jira.issue.search.DefaultSearchRequestManager"); rvcsi = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl"); dsm = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.jira.config.DefaultStatusManager"); } catch (ClassNotFoundException e) { e.printStackTrace(); } search = dsrm.create(search); ErrorCollection errors = new SimpleErrorCollection(); // ERROR at this line Long rapidViewId = rvcsi.createNewRapidView(user, project.getName() + " Board", search.getId().longValue(), errors); ConfigureResponse configureResponse = ConfigureResponse.create().setRedirect("/browse/"+configureData.project().getKey()); // ConfigureResponse configureResponse = ConfigureResponse.create().setRedirect("/secure/RapidBoard.jspa?rapidView="+rapidViewId); return configureResponse; } } {code} Error Message: {code} java.lang.NullPointerException at com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl.createNewRapidView(RapidViewCreationServiceImpl.java:58) at de.flynet.plugins.mytest.projectblueprint.KanbanBigProjectHook.configure(KanbanBigProjectHook.java:84) at com.atlassian.jira.projecttemplates.service.ProjectTemplateServiceImpl.applyProjectTemplate(ProjectTemplateServiceImpl.java:108) {code}

    Atlassian JIRA | 2 years ago | FLYnet
    java.lang.NullPointerException
  2. 0

    We need a Plugin for Jira, that creates a Project with some Parameter and a Agile Board for the Project. In the Test-System that starts with "atlas-run" we have no errors. The Project and the Agile Board is configured correctly. But if we upload it to the production system (same Jira und Jira Agile version), we run in an error. The Project is configured correctly, but there is no Agile Board. The Code: {code:title=KanbanBigProjectHook.java|borderStyle=solid} package de.flynet.plugins.mytest.projectblueprint; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import com.atlassian.crowd.embedded.api.User; import com.atlassian.greenhopper.api.rapid.view.Column; import com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl; import com.atlassian.jira.blueprint.api.AddProjectHook; import com.atlassian.jira.blueprint.api.ConfigureData; import com.atlassian.jira.blueprint.api.ConfigureResponse; import com.atlassian.jira.blueprint.api.ValidateData; import com.atlassian.jira.blueprint.api.ValidateResponse; import com.atlassian.jira.component.ComponentAccessor; import com.atlassian.jira.config.DefaultStatusManager; import com.atlassian.jira.issue.search.DefaultSearchRequestManager; import com.atlassian.jira.issue.search.SearchRequest; import com.atlassian.jira.issue.status.Status; import com.atlassian.jira.jql.builder.JqlClauseBuilder; import com.atlassian.jira.jql.builder.JqlQueryBuilder; import com.atlassian.jira.project.Project; import com.atlassian.jira.project.ProjectManager; import com.atlassian.jira.scheme.Scheme; import com.atlassian.jira.user.ApplicationUser; import com.atlassian.jira.util.ErrorCollection; import com.atlassian.jira.util.SimpleErrorCollection; import com.atlassian.jira.workflow.WorkflowSchemeManager; import com.atlassian.query.Query; import com.atlassian.query.QueryImpl; import com.atlassian.query.clause.Clause; // import com.atlassian.jira.ComponentManager; // import com.atlassian.greenhopper.service.rapid.view.RapidViewServiceImpl; public class KanbanBigProjectHook implements AddProjectHook { @Override public ValidateResponse validate(final ValidateData validateData) { ValidateResponse validateResponse = ValidateResponse.create(); return validateResponse; } @Override public ConfigureResponse configure(final ConfigureData configureData) { WorkflowSchemeManager workflowSchemeManager = ComponentAccessor.getWorkflowSchemeManager(); ProjectManager projectManager = ComponentAccessor.getProjectManager(); Project project = projectManager.getProjectByCurrentKey(configureData.project().getKey()); Scheme scheme = workflowSchemeManager.getSchemeObject("Arbeitsablaufschema Test"); workflowSchemeManager.addSchemeToProject(project, scheme); List<Project> projectlist = new ArrayList<Project>(); projectlist.add(project); ApplicationUser appuser = ComponentAccessor.getUserUtil().getUserByName("admin"); User user = appuser.getDirectoryUser(); JqlClauseBuilder clausebuilder = JqlQueryBuilder.newClauseBuilder().defaultAnd().project(project.getKey()); Clause clause = clausebuilder.buildClause(); Query query = new QueryImpl(clause); SearchRequest search = new SearchRequest(query, appuser, "RV " + project.getName(), project.getName()); DefaultSearchRequestManager dsrm = null; RapidViewCreationServiceImpl rvcsi = null; DefaultStatusManager dsm = null; try { dsrm = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.jira.issue.search.DefaultSearchRequestManager"); rvcsi = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl"); dsm = ComponentAccessor.getComponentClassManager().newInstance("com.atlassian.jira.config.DefaultStatusManager"); } catch (ClassNotFoundException e) { e.printStackTrace(); } search = dsrm.create(search); ErrorCollection errors = new SimpleErrorCollection(); // ERROR at this line Long rapidViewId = rvcsi.createNewRapidView(user, project.getName() + " Board", search.getId().longValue(), errors); ConfigureResponse configureResponse = ConfigureResponse.create().setRedirect("/browse/"+configureData.project().getKey()); // ConfigureResponse configureResponse = ConfigureResponse.create().setRedirect("/secure/RapidBoard.jspa?rapidView="+rapidViewId); return configureResponse; } } {code} Error Message: {code} java.lang.NullPointerException at com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl.createNewRapidView(RapidViewCreationServiceImpl.java:58) at de.flynet.plugins.mytest.projectblueprint.KanbanBigProjectHook.configure(KanbanBigProjectHook.java:84) at com.atlassian.jira.projecttemplates.service.ProjectTemplateServiceImpl.applyProjectTemplate(ProjectTemplateServiceImpl.java:108) {code}

    Atlassian JIRA | 2 years ago | FLYnet
    java.lang.NullPointerException

    Root Cause Analysis

    1. java.lang.NullPointerException

      No message provided

      at com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl.createNewRapidView()
    2. com.atlassian.greenhopper
      RapidViewCreationServiceImpl.createNewRapidView
      1. com.atlassian.greenhopper.api.rapid.view.RapidViewCreationServiceImpl.createNewRapidView(RapidViewCreationServiceImpl.java:58)
      1 frame
    3. de.flynet.plugins
      KanbanBigProjectHook.configure
      1. de.flynet.plugins.mytest.projectblueprint.KanbanBigProjectHook.configure(KanbanBigProjectHook.java:84)
      1 frame
    4. com.atlassian.jira
      ProjectTemplateServiceImpl.applyProjectTemplate
      1. com.atlassian.jira.projecttemplates.service.ProjectTemplateServiceImpl.applyProjectTemplate(ProjectTemplateServiceImpl.java:108)
      1 frame