Closed GoogleCodeExporter closed 9 years ago
Adding my log output, as it provides more environment info.
Original comment by ad...@72hills.com
on 8 Jun 2012 at 8:36
Attachments:
I have reproduced the issue using JIRA 5.0.
It seems to me that using the javamelody JdbcDriver in dbconfig.xml does not
work anymore since JIRA 5.0.
And it is probably because JIRA or the ofbiz entityengine calls
setDriverClassLoader on the commons dbcp datasource. I do not know what
contains this classLoader but it probably does not contain the plugins classes.
So I suggest that the dbconfig.xml of JIRA should not be changed anymore for
javamelody (doc to be fixed).
Instead you can use a JNDI datasource and it will be monitored automatically.
As said in the user guide [1]:
Or you could just use a jndi datasource in JIRA 4.4 or later and it will be
automatically monitored. To use a jndi datasource, replace in the dbconfig.xml
file "<jdbc-datasource>...</jdbc-datasource>" with
"<jndi-datasource><jndi-name>java:comp/env/jdbc/JiraDS</jndi-name></jndi-datasou
rce>" (take a backup before), and add a Resource element for a datasource
inside the Context element of the Tomcat's "JIRA/conf/server.xml" file.
See this example [2] of datasource for mysql; the values in your Resource element should be inspired by the values that were just removed from your dbconfig.xml file. And so the jndi datasource will be automatically monitored after restart.
[1]
https://code.google.com/p/javamelody/wiki/UserGuide#Atlassian_JIRA,_Confluence_a
nd_Bamboo_Plugin
[2]
http://confluence.atlassian.com/display/JIRA043/Connecting+JIRA+to+MySQL#Connect
ingJIRAtoMySQL-51ConfigureyourapplicationservertoconnecttoMySQL
Original comment by evernat@free.fr
on 10 Jun 2012 at 12:03
user guide updated as said above:
https://code.google.com/p/javamelody/wiki/UserGuide#Atlassian_JIRA,_Confluence_a
nd_Bamboo_Plugin
Original comment by evernat@free.fr
on 10 Jun 2012 at 9:18
Thanks for the response.
For complete newbies it would be helpful to include instructions on how to
configure java melody using connection property.
Is it something like this:
<Engine name="Catalina" defaultHost="localhost">
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true">
<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false" useHttpOnly="true">
<!--
====================================================================================
Note, you no longer configure your database driver or connection parameters here.
These are configured through the UI during application setup.
====================================================================================
-->
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
username="jirauser]"
password="issuemeister"
driverClassName="net.bull.javamelody.JdbcDriver"
url="jdbc:jtds:sqlserver://localhost:1433/jira5"
connectionProperties="driver=net.sourceforge.jtds.jdbc.Driver"
maxActive="20"
maxIdle="10"
validationQuery="select 1"
/>
<!--
<driver-class>net.bull.javamelody.JdbcDriver</driver-class>
<connection-properties>driver=net.sourceforge.jtds.jdbc.Driver</connection-properties>
-->
<Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
<Manager pathname=""/>
</Context>
</Host>
This results in an exception on startup:
2012-06-11 12:08:16,995 main ERROR
[atlassian.jira.startup.LauncherContextListener] Unable to start JIRA.
java.lang.RuntimeException: Unable to obtain a connection from the underlying
connection pool
at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:59)
at ...
Caused by: org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create JDBC
driver of class 'net.bull.javamelody.JdbcDriver' for connect URL
'jdbc:jtds:sqlserver://localhost:1433/jira5'
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
...
Caused by: java.sql.SQLException: No suitable driver
at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1443)
... 50 more
Original comment by valentijnscholten
on 11 Jun 2012 at 10:12
Looks like you don't need the property anymore and also not the
net.bull.javameldoy.jdbcdriver ????
Original comment by valentijnscholten
on 11 Jun 2012 at 10:15
Yes, there is no need of net.bull.javamelody.JdbcDriver when using a datasource
as said in the user guide:
https://code.google.com/p/javamelody/wiki/UserGuide#Atlassian_JIRA,_Confluence_a
nd_Bamboo_Plugin
In your case with JTDS, it is the following in conf/server.xml:
<Context path="" docBase="${catalina.home}/atlassian-jira" reloadable="false"
useHttpOnly="true">
<Resource name="jdbc/JiraDS" auth="Container" type="javax.sql.DataSource"
username="<user>"
password="<password>"
driverClassName="net.sourceforge.jtds.jdbc.Driver"
url="jdbc:jtds:sqlserver://localhost:1433/jira5"
maxActive="20"
maxIdle="10"
validationQuery="select 1"
/>
<Resource name="UserTransaction" auth="Container" type="javax.transaction.UserTransaction"
factory="org.objectweb.jotm.UserTransactionFactory" jotm.timeout="60"/>
<Manager pathname=""/>
</Context>
An example from the Atlassian documentation, using Mysql, is here:
https://confluence.atlassian.com/display/JIRA043/Connecting+JIRA+to+MySQL#Connec
tingJIRAtoMySQL-51ConfigureyourapplicationservertoconnecttoMySQL
Original comment by evernat@free.fr
on 11 Jun 2012 at 4:49
Yeah thanks. in the end I got it.
I was confused because I thought I needed to use the
net.bull.javameldoy.jdbcdriver also with the datasource.
Original comment by valentijnscholten
on 11 Jun 2012 at 5:47
Original issue reported on code.google.com by
valentijnscholten
on 8 Jun 2012 at 11:42