Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en_US

Trying to execute SQL in a confluence plugin to a jiraDS datasource define in the confluence configuration file.  Plugin has dependencies for jira-api and jira-core defined with 'provided' as value for <scope>provided</scope>.  The subsequent atlas-compile and atlas-package build and packaging has no errors.  The resulting plugin jar file was too large at 76Mbytes and the limit on the server was defaulted to 67Mbytes.  I proceeded to copy just the class files that i used my code and reduced the file size to about 1Mbyte, which uploaded as an add on plugin with no errors.  When going to a page that has the plugin it then throws this error:

Caused by: java.util.MissingResourceException: Can't find bundle for base name cache, locale en_US

Code used in plugin to attempt to getConnection():

try {

    DefaultOfBizConnectionFactory factory = DefaultOfBizConnectionFactory.getInstance();

    Connection connection = factory.getConnection();

    // do something with connection

} catch (SQLException sqle) {

    String message = sqle.getMessage();


Is there another way to reduce the plugin jar file size without piece mealing the classes folder with required classes?  Is there a better way to get a connection object for executing SQL in a plugin without doing straight jdbc?  I'd like to reuse the defined 'jiraDS' datasource in Confluence's configuration file.

2 answers

After trying what seems like 10 different ways to access JIRA data from a Confluence Plugin, i finally found that this worked:

import javax.naming.InitialContext;
import javax.naming.Context;
import javax.naming.NamingException;
import javax.sql.DataSource;

private String sqlJNDITest() {
    String res = "NONE";
    DataSource dataSource;
    try {
        InitialContext initalContext = new InitialContext();
        Context context = (Context) initalContext.lookup("java:comp/env");
        dataSource = (DataSource) context.lookup("jdbc/<your_datasource_name>");
        Connection connection = dataSource.getConnection();
        res = connection.getCatalog();
        String query = "select * from jiraissue where id=<your_jiraissue_id>";
        Statement stmt = connection.createStatement();
        ResultSet rs = stmt.executeQuery(query);
        while ( {
            String summary = rs.getString("summary");
            res = res + summary;

    } catch (NamingException ex) {
        String message = ex.getMessage();
    } catch (SQLException sqle) {
        String message = sqle.getMessage();
    return res;

No need to include any jira-api or jira-core pom.xml dependencies in your confluence plugin and the plugin jar file size was less then 500Kbytes.  The nice thing here is that it uses your confluence server's configured datasource for JIRA instead of you having to code it in the plugin config or JAVA code.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Feb 06, 2019 in Confluence

Try out the new editing experience

Hi team, I’m Avinoam, a product manager on Confluence Cloud, and today I’m really excited to let the Community know that all customers can now try out the new editing experience and see some of the ...

783 views 33 5
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you