Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira can connect to the Oracle database, but not any plugins.

David Seff June 9, 2023

Trying to run the official Docker 9.4.7 image. We have added ojdbc8.jar to /opt/atlassian/jira/lib using this Dockerfile:

 

 

FROM atlassian/jira-software:9.4.7

# Instal Oracle driver
COPY ojdbc8.jar /opt/atlassian/jira/lib/

 

 

 

 

 

Jira Can connect to the database but no plugins can find the driver:

2023-06-08 00:53:27,891+0000 main INFO [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks.
2023-06-08 00:53:27,891+0000 main INFO [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully.
2023-06-08 00:56:15,670+0000 main INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Database Checklist Launcher
2023-06-08 00:56:15,860+0000 main INFO [c.a.jira.startup.DatabaseChecklistLauncher] Jira database startup checks completed successfully.
2023-06-08 00:56:15,861+0000 main INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Post database-configuration launchers
2023-06-08 00:56:17,518+0000 main INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /var/atlassian/application-data/jira/dbconfig.xml
2023-06-08 00:56:17,521+0000 main INFO [c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it
2023-06-08 00:56:17,521+0000 main INFO [c.a.j.config.database.DatabaseConfigHandler] Database password decryption not performed.
2023-06-08 00:56:32,462+0000 main INFO [c.a.jira.upgrade.PluginUpgradeListener] [plugin-upgrade-listener] Created
2023-06-08 00:56:32,665+0000 main INFO [c.a.jira.startup.DatabaseLauncher] Database transactions enabled: true
2023-06-08 00:56:32,665+0000 main INFO [c.a.jira.startup.DatabaseLauncher] Using JIRA's default for database transaction isolation level: 2
2023-06-08 00:56:33,221+0000 main INFO [c.a.jira.startup.JiraStartupLogger]

Database configuration OK

___ Database Configuration _________________

Loading entityengine.xml from : file:/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/entityengine.xml
Entity model field type name : oracle10g
Entity model schema name :
Database Version : Oracle - Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
Database Driver : Oracle JDBC driver - 19.3.0.0.0
Database URL : jdbc:oracle:thin:@//v319jiradb3002.cmcucblk1ep8.ap-southeast-2.rds.amazonaws.com:1521/ORCL
Database JDBC config : oracle10g jdbc:oracle:thin:@//v319jiradb3002.cmcucblk1ep8.ap-southeast-2.rds.amazonaws.com:1521/ORCL

2023-06-08 00:56:34,125+0000 main INFO [c.a.jira.startup.JiraStartupLogger]

___ Starting the JIRA Plugin System _________________

Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver not found from bundle [com.atlassian.plugins.static-assets-url]
at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:140)
at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:212)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2129)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2032)
at org.apache.commons.dbcp2.BasicDataSource.setLogWriter(BasicDataSource.java:1625)
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:101)

2 answers

0 votes
David Seff March 3, 2024

In the end it came down to issues with an old version of dbconfig.xml. Since I was upgrading from v8 Jira to V9 I needed to create a new config using the V9 specs before the upgrade. There didn't seem to be any documentation within Atlassian that outlines the differences between the versions. 

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 10, 2023

Welcome to the Atlassian Community!

Plugins should not be trying to read the Jira database directly, they should be using the java API to talk to it.  I suspect this error is a misconfiguration of the plugin though, not a coding error.  You'll need to take it up with the vendor.

David Seff June 11, 2023

Every plugin is throwing this error. I have been trying to take it up with the vendor, which is Atlassian themselves but they are slow to respond. 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 16, 2023

I think we need a bit more detail - what errors are your apps getting that your  applications are not?

David Seff June 20, 2023

Did you not read the log output above? 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2023

Yes.

What errors are your apps getting that your  applications are not?

Matthew Marshall December 23, 2023

@David Seff I am also getting the exact same as yourself with the Jira service management docker image, I load in the ojdbc jar to the correct directory, Jira starts up, database connects, then plugins all throw 

 

Cannot load JDBC driver class 'oracle.jdbc.OracleDrivers’ 

 

did you ever get to the bottom of it? 

Matthew Marshall March 1, 2024

@Nic Brough -Adaptavist- 

Can you advise on this at all?

Jira can connect to the DB, but all plugins (including those by atlassian) all fail to find the oracle driver

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2024

It's the same question - what errors are you finding in the logs when your apps try to use the database link?

Matthew Marshall March 1, 2024

@Nic Brough -Adaptavist- 

 

Hi Nick, 

 

thanks for coming back to me, but its the same answer.

 

"what errors are you finding in the logs when your apps try to use the database link?"

Jira just wont load any plugins. The logs are pretty much the above. Jira loads connection to the DB, then starts the plugins, and throw errors it cannot locate the oracle jdbc driver, when its just been loaded by the database configuration

 

If you can be more descriptive in what further information you need will be happy to provide.

 

 

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2024

We can't debug this any further without knowing what the errors are - you need to read the logs and see what the connection attempts are telling you what is failing.

Matthew Marshall March 1, 2024

@Nic Brough -Adaptavist- 

The plugins arent getting that far?because they cannot load the OJDBC jdriver.

 

2023-06-08 00:53:27,891+0000 main INFO [c.a.jira.startup.JiraStartupLogger] Running Jira startup checks.
2023-06-08 00:53:27,891+0000 main INFO [c.a.jira.startup.JiraStartupLogger] Jira pre-database startup checks completed successfully.
2023-06-08 00:56:15,670+0000 main INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Database Checklist Launcher
2023-06-08 00:56:15,860+0000 main INFO [c.a.jira.startup.DatabaseChecklistLauncher] Jira database startup checks completed successfully.
2023-06-08 00:56:15,861+0000 main INFO [c.a.j.config.database.DatabaseConfigurationManagerImpl] The database is configured. Now running Post database-configuration launchers
2023-06-08 00:56:17,518+0000 main INFO [c.a.j.config.database.SystemDatabaseConfigurationLoader] Reading database configuration from /var/atlassian/application-data/jira/dbconfig.xml
2023-06-08 00:56:17,521+0000 main INFO [c.a.j.config.database.DatabaseConfigHandler] Trying to get encrypted password from xml and decrypt it
2023-06-08 00:56:17,521+0000 main INFO [c.a.j.config.database.DatabaseConfigHandler] Database password decryption not performed.
2023-06-08 00:56:32,462+0000 main INFO [c.a.jira.upgrade.PluginUpgradeListener] [plugin-upgrade-listener] Created
2023-06-08 00:56:32,665+0000 main INFO [c.a.jira.startup.DatabaseLauncher] Database transactions enabled: true
2023-06-08 00:56:32,665+0000 main INFO [c.a.jira.startup.DatabaseLauncher] Using JIRA's default for database transaction isolation level: 2
2023-06-08 00:56:33,221+0000 main INFO [c.a.jira.startup.JiraStartupLogger]

Database configuration OK

___ Database Configuration _________________

Loading entityengine.xml from : file:/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/entityengine.xml
Entity model field type name : oracle10g
Entity model schema name :
Database Version : Oracle - Oracle Database 19c Standard Edition 2 Release 19.0.0.0.0 - Production
Version 19.18.0.0.0
Database Driver : Oracle JDBC driver - 19.3.0.0.0
Database URL : jdbc:oracle:thin:@//v319jiradb3002.cmcucblk1ep8.ap-southeast-2.rds.amazonaws.com:1521/ORCL
Database JDBC config : oracle10g jdbc:oracle:thin:@//v319jiradb3002.cmcucblk1ep8.ap-southeast-2.rds.amazonaws.com:1521/ORCL

2023-06-08 00:56:34,125+0000 main INFO [c.a.jira.startup.JiraStartupLogger]

 

LOGS OUTPUT THAT THE DATABASE CONFIGURATION IS OK, CONNECTS TO THE DB AND ALSO RETURNS THE ORACLE VERSION OF THE DB

 

___ Starting the JIRA Plugin System _________________

Cannot load JDBC driver class 'oracle.jdbc.OracleDriver'
java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver not found from bundle [com.atlassian.plugins.static-assets-url]
at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.findClass(BundleDelegatingClassLoader.java:140)
at org.eclipse.gemini.blueprint.util.BundleDelegatingClassLoader.loadClass(BundleDelegatingClassLoader.java:212)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
at org.apache.commons.dbcp2.BasicDataSource.createConnectionFactory(BasicDataSource.java:2129)
at org.apache.commons.dbcp2.BasicDataSource.createDataSource(BasicDataSource.java:2032)
at org.apache.commons.dbcp2.BasicDataSource.setLogWriter(BasicDataSource.java:1625)
at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:101)

 

PLUGIN SYSTEM STARTS AND NO PLUGINS CAN LOAD THE ORACLE DRIVER, WHICH WE KNOW IS PRESENT BECAUSE THE DATABASE CONFIGURATION USES IT

 

so in terms of "connection attempts failing", there isnt any on the plugin side, it reports it cannot find the driver (which we know is present)

Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2024

That looks like you have not put the oracle driver in the right place (or not made it usable by the Jira user, but that's a rare mistake, I only mention it for completeness).  Apps tend not to use the main database driver that Jira uses to connect to its database, they usually need it installed in the Tomcat or often the app's plugin directory in Jira's home directory. 

What do the docs for the app that uses the database say?

Matthew Marshall March 1, 2024

@Nic Brough -Adaptavist-

Hi Nick,

Thanks for coming back to me

docs tell you to place it in the directory below.

 /opt/atlassian/jira/lib/

if it was in the wrong place the database configuration would fail on initial start up, which it doesn’t - database configuration passes and can correctly read the DB (aswell as returning the oracle database version)

so I’m pretty sure the driver being in the wrong place isn’t the issue 

 

Like Nic Brough -Adaptavist- likes this
Matthew Marshall March 1, 2024

More than happy to eat my words though! @Nic Brough -Adaptavist- 😅👍

Like Nic Brough -Adaptavist- likes this
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 1, 2024

/lib in the Jira installation is for the main database driver for Jira.

The plugin you are using seems to need (a copy) somewhere else. 

Generally, plugins should not need a database driver, they normally read and write Jira data via the API, and there's only a small handful of apps that do try to read databases (either they're poorly written if they're reading the Jira database, or they are specifically intended to read/write non-Jira external databases)

Your logs don't tell us what app you have installed that is having this problem, so you might have to debug this the slow way, if you can't see one in your list of apps that says "I read other databases".  Disable all your installed apps, then restart the service repeatedly, re-enabling one app at a time until the error reoccurs.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.4.7
TAGS
AUG Leaders

Atlassian Community Events