Bamboo Data center is not not able to start with exception : Cannot find class
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles 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
Summary
This knowledge base article covers a scenario where Bamboo was not able to start with exception : Cannot find class [com.atlassian.bamboo.crowd.license.BambooDcLicenseChecker].
This page will cover the diagnostics and the solution considering the above missing class during the startup, but the solution will be applicable for any other similar class missing during the startup.
Environment
The issue was seen on Bamboo 9.5.4 but the solution will be applicable for any other supported version of Bamboo.
Diagnosis
Post starting up Bamboo, on the Bamboo GUI HTTP Status 404 - Not found exception is seen:
Looking at <bamboo-home>logs>atlassian-bamboo.log file we can see the below error:
Error creating bean with name 'hostComponentProvider': Unsatisfied dependency expressed through method 'setSpringHostComponentProviderConfig' parameter 0; nested exception is
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [com.atlassian.bamboo.crowd.license.BambooDcLicenseChecker] for bean with name 'bambooCrowdLicenseService' defined in class path resource [applicationContextEmbeddedCrowd.xml]; nested exception is java.lang.ClassNotFoundException: com.atlassian.bamboo.crowd.license.BambooDcLicenseChecker
Cause
The error basically means that Bamboo is not able to find the class BambooDcLicenseChecker defined under bean bambooCrowdLicenseService inside applicationContextEmbeddedCrowd.xml
Below is definition of this bean inside applicationContextEmbeddedCrowd.xml
<bean id="bambooCrowdLicenseService" class="com.atlassian.bamboo.crowd.license.BambooDcLicenseChecker"/>
Below are the probable cause for the same
- Bamboo user which is running the service is not having the correct read/write access to the Jar file.
- Jar file containing the class file is missing.
- Jar file is corrupted.
Solution
The first step is to identify the jar file which the missing class belongs to, in the above example Bamboo complains about missing BambooDcLicenseChecker class, to check the jar file we can run the below command inside <bamboo-install> directory.
find -type f -iname '*.jar' | xargs grep --text --files-with-matches 'BambooDcLicenseChecker.class'
Result :
Once the jar file is identified then the below solution can be tried.
Solution 1
If the issue is with the Bamboo user not having the correct read/write access to the jar file, please provide the correct read/write access to the Bamboo user to the jar file and restart the Bamboo service.
Solution 2
If the solution 1 does not work, then either the jar file is corrupted or missing the class, the ideal approach here is to download the whole installation directory from bamboo-download-archives and replace the jar in the exact same location found above and provide the right access to the user which is running Bamboo and restart the Bamboo service.
Please take a backup of the original jar file before replacing it.
Solution 3
If the solution 1, 2 does not fix the issue, the idea is to install Bamboo service from scratch by using a fresh download, pointing it to the same home directory and see if it makes any difference.
Please take a snapshot of the machine especially the home folder, so that you can roll it back to the original state.
If you are going ahead with solution 3, you'll need to make sure to copy any manual changes done on files like server.xml , setenv.sh/bat etc on the new Bamboo Installation directory.
Good idea is to install it in a different directory than the original Installation, for example in windows if Bamboo is running inside C Drive, probably move the installation directory to some other location.