Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Driver class can not be found in the class path

Steve Cuthbertson October 11, 2022

Hello - I am trying without success to install Bamboo as a learning exercise. I get MySQL installed and configured, but when I launch the URL and get to http://{server}:8085/setup/setupDatabaseConnection.action?selectedDatabase=mysql I had a message "Driver class can not be found in the class path". I downloaded and installed the driver with "yum install mysql-connector-java" and copied /usr/share/java/mysql-connector-j.jar to /var/bamboo/bamboo-home/atlassian-bamboo/WEB-INF/lib/ but now when I reload the page I just get a huge error that starts:

io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.NullPointerException at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156) at io.atlassian.util.concurrent.LazyReference.get(LazyReference.java:116) at...

What am I doing wrong?

$CLASSPATH is not set - is that where Bamboo is looking?

Should I set it to /usr/share/java?

I've had this on CentOS7 and now I'm on CentOS Stream 8.

Thanks!

1 answer

1 vote
Vani
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 11, 2022

Hi @Steve Cuthbertson ,

Thank you for contacting Atlassian Community.

We understand you are trying to connect to Bamboo with your Mysql Database. Please follow this documentation on how to connect Bamboo to a MySQL database.

  1. Download the MySQL Connector/J JDBC driver 5.1 from the download site.
  2. Extract the downloaded zip/tar.gz file.
  3. Copy the mysql-connector-java-5.1.XX-bin.jar file from the extracted directory to the <Bamboo installation directory>/lib  directory (create the lib/ directory if it doesn't already exist).
    If you are using the Java Service Wrapper to start your Bamboo instance (Bamboo/wrapper/run-bamboo start), copy the mysql-connector-java-5.1.XX-bin.jar file to <Bamboo installation directory> /wrapper/lib directory.
  4. Stop Bamboo on Windows, Linux or Mac.
  5. Restart Bamboo on WindowsLinux or Mac.

We assume your Bamboo-install directory is  /var/bamboo/bamboo-home/

Please let us know if you have any questions.

 

Thanks

Vani

Steve Cuthbertson October 12, 2022

Thanks Vani, I may have got a little further. If I use the connection string:

jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8&sessionVariables=storage_engine=InnoDB

I get an error in atlassian-bamboo.log:

Unknown system variable 'storage_engine'

If I take that out of the string this is what I see:

2022-10-12 09:16:32,327 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating database configuration...
2022-10-12 09:16:32,328 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Validating connection to url: [jdbc:mysql://localhost/bamboo?autoReconnect=true&useUnicode=true&characterEncoding=utf8]
2022-10-12 09:16:32,452 INFO [performSetupDatabaseConnectionBackgroundThread] [SetupDatabaseConnectionAction] Database configuration is valid.

... but the next lines are:

2022-10-12 09:16:32,480 ERROR [http-nio-8085-exec-8] [ExceptionMappingInterceptor] null
java.lang.IllegalStateException: null
at com.google.common.base.Preconditions.checkState(Preconditions.java:486) ~[guava-31.0.1-jre.jar:?]
at com.atlassian.bamboo.ww2.actions.setup.SetupUtilityBean.setupStandardDatabase(SetupUtilityBean.java:160) ~[atlassian-bamboo-web-9.0.0.jar:?]
..2022-10-12 09:16:32,517 ERROR [http-nio-8085-exec-8] [FiveOhOh] 500 Exception was thrown.

I think this is progress, but not sure.
Any ideas?
Steve

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events