Creating new project fails due to java.lang.NullPointerException error

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Creating a new project will result in the UI error message below:

1 2 3 Unable to instantiate Action, com.atlassian.crucible.actions.admin.project.NewProjectAction, defined for 'newProject' in namespace '/admin'Error creating bean with name 'com.atlassian.crucible.actions.admin.project.NewProjectAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.crucible.actions.admin.project.NewProjectAction]: Constructor threw exception; nested exception is java.lang.NullPointerException Error creating bean with name 'com.atlassian.crucible.actions.admin.project.NewProjectAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.crucible.actions.admin.project.NewProjectAction]: Constructor threw exception; nested exception is java.lang.NullPointerException Could not instantiate bean class [com.atlassian.crucible.actions.admin.project.NewProjectAction]: Constructor threw exception; nested exception is java.lang.NullPointerException

And from logs:

1 2 3 2012-07-25 16:31:01,492 ERROR [btpool0-12 ] fisheye.console PermissionManager-getDefaultPermissionScheme - No default permission scheme exists 2012-07-25 16:31:01,493 ERROR [btpool0-12 ] fisheye.app TotalityFilter-logExceptionDetails - Exception "Unable to instantiate Action, com.atlassian.crucible.actions.admin.project.NewProjectAction, defined for 'newProject' in namespace '/admin'Error creating bean with name 'com.atlassian.crucible.actions.admin.project.NewProjectAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.crucible.actions.admin.project.NewProjectAction]: Constructor threw exception; nested exception is java.lang.NullPointerException" (javax.servlet.ServletException) while processing "/admin/newProject.do" (Referer:"http://fisheye:8081/admin/listProjects.do") javax.servlet.ServletException: Unable to instantiate Action, com.atlassian.crucible.actions.admin.project.NewProjectAction, defined for 'newProject' in namespace '/admin'Error creating bean with name 'com.atlassian.crucible.actions.admin.project.NewProjectAction': Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.atlassian.crucible.actions.admin.project.NewProjectAction]: Constructor threw exception; nested exception is java.lang.NullPointerException

Cause

  1. During Fisheye installation the default Fisheye project was not created and application uses the default project like a model to create new projects.

  2. Another cause would be a deletion or renaming of the "agile" permission scheme. The code looks either for a permission scheme named agile, or a permission scheme numbered id 1 (cru_ps_id = 1) If neither exist, when it hits the null value there, it throws a NullPointerException. To check it this is the case you can query the permissions table:

    1 select * from cru_perm_scheme;

Resolution

Re-create the default permission scheme (only in the case that there is no other conflict with id 1, or default name already existing in the database) by doing the following:

  1. Backup your Crucible instance for safety before shutting down.

  2. Execute the SQL queries below:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 INSERT INTO cru_perm_scheme VALUES(1,'default'); INSERT INTO cru_ps_all_user VALUES(1,'action:createReview'); INSERT INTO cru_ps_all_user VALUES(1,'action:viewReview'); INSERT INTO cru_ps_review_role VALUES(1,'Author','action:commentOnReview'); INSERT INTO cru_ps_review_role VALUES(1,'Author','action:viewReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:abandonReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:commentOnReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:deleteReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:modifyReviewFiles'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:recoverReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:submitReview'); INSERT INTO cru_ps_review_role VALUES(1,'Creator','action:viewReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:abandonReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:approveReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:closeReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:commentOnReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:deleteReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:modifyReviewFiles'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:recoverReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:rejectReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:reopenReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:summarizeReview'); INSERT INTO cru_ps_review_role VALUES(1,'Moderator','action:viewReview'); INSERT INTO cru_ps_review_role VALUES(1,'Reviewer','action:commentOnReview'); INSERT INTO cru_ps_review_role VALUES(1,'Reviewer','action:completeReview'); INSERT INTO cru_ps_review_role VALUES(1,'Reviewer','action:uncompleteReview'); INSERT INTO cru_ps_review_role VALUES(1,'Reviewer','action:viewReview'); COMMIT;

Alternatively, if the cru_perm_scheme table contains an entry such as agile(copy 1) you can safely rename it back to agile in the UI by:

  1. Go to Administration > Security Settings > Permission Schemes

  2. If you see a scheme named similar to "agile(copy 1)" click on the name

  3. There should be a box/option to rename the scheme back to agile

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.