Javamelody not monitoring JDBC

adrianprocter August 9, 2018

I've installed Javamelody (v1.73.0) on my installation of Jira (7.10.1).  I've got Jira configured to use JDNI, and i've following all the instructions I've found (my redacted server.xml and dbconfig.cfg are below), Jira is working, but it doesn't seem to be monitoring my SQL.  The database is MS SQL Server 2016.  I must have missed a step, but I'm not sure what - can anyone provide any insight into what I've misconfigured?

 

Adrian

 

dbconfig.xml:

(some of the values may not be required)

<jira-database-config>
<name>JiraDS</name>
<delegator-name>default</delegator-name>
<database-type>mssql</database-type>
<schema-name>dbo</schema-name>
<url>jdbc:sqlserver://sqlservername:1433;databaseName=JIRA</url>
<driverClassName>com.microsoft.sqlserver.jdbc.SQLServerDriver</driverClassName>
<username>xxxx</username>
<password>xxxx</password>
<pool-min-size>20</pool-min-size>
<pool-max-size>20</pool-max-size>
<pool-max-wait>30000</pool-max-wait>
<validation-query>select 1</validation-query>
<min-evictable-idle-time-millis>60000</min-evictable-idle-time-millis>
<time-between-eviction-runs-millis>300000</time-between-eviction-runs-millis>
<pool-max-idle>20</pool-max-idle>
<pool-remove-abandoned>true</pool-remove-abandoned>
<pool-remove-abandoned-timeout>300</pool-remove-abandoned-timeout>
<pool-test-on-borrow>false</pool-test-on-borrow>
<pool-test-while-idle>true</pool-test-while-idle>
<jndi-datasource>
<jndi-name>java:comp/env/JiraDS</jndi-name>
</jndi-datasource>
</jira-database-config>

server.xml

 <Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">
<Resource name="JiraDS" auth="Container" type="javax.sql.DataSource"
username="xxxxxx"
password="xxxxxx"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://servername:1433;databaseName=JIRA"
maxActive="20"
maxIdle="10"
validationQuery="select 1"
/>

 

javamelody.PNG

 

2 answers

1 accepted

0 votes
Answer accepted
adrianprocter October 2, 2018

I came back to this after some time away, and managed to get it to work.  Everything I had done was correct, with the exception of one small thing, which I can not see documented anywhere.

If my definition for the JDNI data source, I had defined:

<jndi-datasource>
<jndi-name>java:comp/env/JiraDS</jndi-name>
</jndi-datasource>

When I changed this to: 

<jndi-datasource>
<jndi-name>java:comp/env/jira/JiraDS</jndi-name>
</jndi-datasource>

And the corresponding entry in the server.xml file, it started working immediately after restarting the Jira service. 

0 votes
Emeric Vernat
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.
July 16, 2020

None of the above is supposed to work as is.

You are supposed to use a name with jdbc like:

<jndi-datasource>
<jndi-name>java:comp/env/jdbc/JiraDS</jndi-name>
</jndi-datasource>

There is documentation for that:

https://github.com/javamelody/javamelody/wiki/AtlassianPlugin

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events