Re: [javamelody] SQL & JDBC graphs empty Tomcat 8.5 - SQL Server 2014

225 views
Skip to first unread message

Emeric Vernat

unread,
May 14, 2019, 3:07:56 AM5/14/19
to javam...@googlegroups.com
Hi Craig,

First, I suppose that you have made some tests on your webapp in order to execute some sql requests before looking at the monitoring reports.
Then the datasource may have been read and cached by a Spring framework for example, before being monitored by javamelody.
In order that your webapp uses the monitored datasource, I suggest to add the javamelody listener as first thing in your WEB-INF/web.xml file:
<listener>
	<listener-class>net.bull.javamelody.SessionListener</listener-class>
</listener>
If you had already added the listener in WEB-INF/web.xml, then move it near the top of the file.

By the way, if you use Spring, you can add "classpath:net/bull/javamelody/monitoring-spring.xml" in your Spring context. It can also monitor the datasource from Spring.

bye,
Emeric

Le lun. 13 mai 2019 à 18:46, Craig Armstead <g1nge...@hotmail.com> a écrit :
Hi All,

I've got javamelody running on our proof of concept Pega application server running on Tomcat 8.5 with MS SQL Server 2014.
It correctly recognises the datasources but shows no data.  I'm using -Djavamelody.datasources=java:comp/env/jdbc/PegaRULES option to force only 1 datasource.

Tomcat context.xml
<Resource name="jdbc/PegaRULES"
auth="Container"
type="javax.sql.DataSource"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://sqlserver1:1433;databaseName=PEGA730;selectMethod=cursor;sendStringParametersAsUnicode=false;multiSubnetFailover=true"
username="pegabaseuser"
password="password"
maxTotal="100"
maxIdle="30"
maxWaitMillis="10000"
/>

Debugging Logs :-

Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody listener init started
Mon May 13 16:35:20 UTC 2019     DEBUG     datasources found in JNDI: [java:comp/env/jdbc/PegaRULES]
Mon May 13 16:35:20 UTC 2019     DEBUG     datasource rebinded: java:comp/env/jdbc/PegaRULES from class org.apache.tomcat.dbcp.dbcp2.BasicDataSource to class com.sun.proxy.$Proxy3
Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody listener init done in 27 ms
Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody filter init started
Mon May 13 16:35:20 UTC 2019     DEBUG     OS: Windows Server 2012 R2 , amd64/64
Mon May 13 16:35:20 UTC 2019     DEBUG     Java: Java(TM) SE Runtime Environment, 1.8.0_211-b12
Mon May 13 16:35:20 UTC 2019     DEBUG     Server: Apache Tomcat/8.5.40
Mon May 13 16:35:20 UTC 2019     DEBUG     Webapp context: /prweb
Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody version: 1.77.0
Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody classes loaded from: file:/C:/apache-tomcat-8.5.40-service/webapps/prweb/WEB-INF/lib/javamelody-core-1.77.0.jar
Mon May 13 16:35:20 UTC 2019     DEBUG     Application type: Classic
Mon May 13 16:35:20 UTC 2019     DEBUG     Application version: null
Mon May 13 16:35:20 UTC 2019     DEBUG     Host: sqlse...@172.19.220.55
Mon May 13 16:35:20 UTC 2019     DEBUG     parameter defined: datasources=java:comp/env/jdbc/PegaRULES
Mon May 13 16:35:20 UTC 2019     DEBUG     log listeners initialized
Mon May 13 16:35:20 UTC 2019     DEBUG     datasources found in JNDI: [java:comp/env/jdbc/PegaRULES]
Mon May 13 16:35:20 UTC 2019     DEBUG     datasource rebinded: java:comp/env/jdbc/PegaRULES from class org.apache.tomcat.dbcp.dbcp2.BasicDataSource to class com.sun.proxy.$Proxy3
Mon May 13 16:35:20 UTC 2019     DEBUG     counters initialized
Mon May 13 16:35:20 UTC 2019     DEBUG     counters data read from files in C:\apache-tomcat-8.5.40-service\temp\javamelody\prweb_devpegachatsvr1
Mon May 13 16:35:20 UTC 2019     DEBUG     collect task scheduled every 60s
Mon May 13 16:35:20 UTC 2019     DEBUG     first collect of data done
Mon May 13 16:35:20 UTC 2019     DEBUG     JavaMelody filter init done in 688 ms

DataBase:java:comp/env/jdbc/PegaRULES:
jdbc:sqlserver://sqlserver1:1433;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustServerCertificate=false;sendStringParametersAsUnicode=false;selectMethod=cursor;responseBuffering=adaptive;packetSize=8000;multiSubnetFailover=true;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=PEGA730;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite;
Microsoft SQL Server, 12.00.6259
Driver JDBC:
Microsoft JDBC Driver 4.2 for SQL Server, 4.2.6420.100
Jdbc DataSource:java:comp/env/jdbc/PegaRULES:
maxActive = 100
poolPreparedStatements = false
defaultCatalog = null
defaultAutoCommit = null
defaultReadOnly = null
defaultTransactionIsolation = -1
driverClassName = com.microsoft.sqlserver.jdbc.SQLServerDriver
initialSize = 0
maxIdle = 30
maxOpenPreparedStatements = -1
maxWait = 10000
minEvictableIdleTimeMillis = 1800000
minIdle = 0
numTestsPerEvictionRun = 3
testOnBorrow = true
testOnReturn = false
testWhileIdle = false
timeBetweenEvictionRunsMillis = -1
validationQuery = null

What am I missing?

Thanks

--

---
You received this message because you are subscribed to the Google Groups "javamelody" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javamelody+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/javamelody/c3b8a14a-9c31-4e53-80f0-22bda1573225%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages