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

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Javamelody not monitoring JDBC

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

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. 

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
Community showcase
Published in Apps & Integrations

🍻🍂Apptoberfest Update: Upcoming Virtual Events 🎉

Hello Community! I hope you've been enjoying the 🍂Apptoberfestivities🍂 (I know I have!) The event is heating up next week with a series of virtual events that we're calling the 🍻🍂Partner App ...

580 views 5 21
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you