tietang / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 1 forks source link

SQL/JDBC Stats/Graphs not monitored with jboss-4.0.5.GA for a JNDI datasource #388

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Single WAR (and EJB modules) packaged in an EAR deployed in jboss-4.0.5.GA
2.JNDI datasource is defined as "jtds-ds.xml"(attached) under <Some 
Folder>\jboss-4.0.5.GA\server\default\deploy
3.Module configuration for java melody JARs and WAR as detailed in 
https://code.google.com/p/javamelody/wiki/UserGuideAdvanced#1._Jar_files is not 
done, as there is only one WAR and JARs are packaged under the WAR's library.

What is the expected output? What do you see instead?
I can see HTTP Stats and Graphs updated. But not SQL/JDBC Stats or Graphs.

What version of the product are you using? On what application server, JDK,
operating system?

jboss-4.0.5.GA
OS: Windows 2003 Service Pack 2, x86/32
Java: Java(TM) 2 Runtime Environment, Standard Edition, 1.5.0_14-b03
JavaMelody version: 1.49.0

Please provide any additional information below.

I have added the below to web.xml; which doesn't have any other filter or 
listener:
**********
<filter>
                                <filter-name>monitoring</filter-name>
                                <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
                                <init-param>
                                                <param-name>system-actions-enabled</param-name>
                                                <param-value>true</param-value>
                                </init-param>
                                <init-param>
                                                <param-name>datasources</param-name>
                                                <param-value>java:/jdbc/officeData</param-value>
                                </init-param>
                </filter>

                <filter-mapping>
                                <filter-name>monitoring</filter-name>
                                <url-pattern>/*</url-pattern>
                </filter-mapping>

                <listener>
                                <listener-class>net.bull.javamelody.SessionListener</listener-class>
                </listener>
*******

Connections in the application are created by the following code snippet:
**********
String dataSourceJNDI = "java:/jdbc/officeData";
javax.naming.InitialContext initCtx = new javax.naming.InitialContext();
javax.sql.DataSource datasource = 
(javax.sql.DataSource)initCtx.lookup(dataSourceJNDI);
Connection connection = datasource.getConnection();
*****************

The startup log snippet in JBoss which has found the datasource is below:
*****************
2014-03-12 08:39:16,752 DEBUG [net.bull.javamelody] JavaMelody listener init 
started
2014-03-12 08:39:16,768 DEBUG [net.bull.javamelody] datasources found in JNDI: 
[java:/jdbc/officeData]
2014-03-12 08:39:16,768 DEBUG [net.bull.javamelody] datasource rebinded: 
java:/jdbc/officeData from class 
org.jboss.resource.adapter.jdbc.WrapperDataSource to class $Proxy53
2014-03-12 08:39:16,768 DEBUG [net.bull.javamelody] JavaMelody listener init 
done in 31 ms
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] JavaMelody filter init 
started
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] OS: Windows 2003 Service 
Pack 2, x86/32
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] Java: Java(TM) 2 Runtime 
Environment, Standard Edition, 1.5.0_14-b03
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] Server: WebServer
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] Webapp context: /appconnect
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] JavaMelody version: 1.49.0
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] JavaMelody classes loaded 
from: 
file:/D:/jboss-4.0.5.GA/server/default/tmp/deploy/tmp5208appconnect-exp.war/WEB-
INF/lib/javamelody-1.49.0.jar
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] Host: APP03@10.101.80.117
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] parameter defined: 
system-actions-enabled=true
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] parameter defined: 
datasources=java:/jdbc/officeData
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] log listeners initialized
2014-03-12 08:39:16,783 DEBUG [net.bull.javamelody] datasources found in JNDI: 
[java:/jdbc/officeData]
2014-03-12 08:39:16,799 DEBUG [net.bull.javamelody] datasource rebinded: 
java:/jdbc/officeData from class 
org.jboss.resource.adapter.jdbc.WrapperDataSource to class $Proxy53
2014-03-12 08:39:16,799 DEBUG [net.bull.javamelody] counters initialized
2014-03-12 08:39:16,846 DEBUG [net.bull.javamelody] counters data read from 
files in C:\WINNT\TEMP\javamelody\appconnect_APP03
2014-03-12 08:39:16,893 DEBUG [net.bull.javamelody] collect task scheduled 
every 60s
2014-03-12 08:39:17,002 DEBUG [net.bull.javamelody] first collect of data done
2014-03-12 08:39:17,002 DEBUG [net.bull.javamelody] JavaMelody filter init done 
in 219 ms
*************

Original issue reported on code.google.com by jaganath...@gmail.com on 13 Mar 2014 at 7:31

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the debugging log, it is helpful.
Given that log, the problem is probably that ServletContext.getServerInfo() 
returns "WebServer", and not something like "JBoss AS ..." (or "WildFly ..." in 
another era).
This is an issue in JBoss and I can't do anything.

And I should certainly remind you that JBoss 4.0.5 is obsolete compared to 
WildFly, and not supported by RedHat, even in extended life support.

If you want to find a workaround:
Do you know where that "WebServer" is coming from? from some xml or properties 
file in your directory?
You may look at 
jboss/server/**/deploy/jbossweb-tomcat55.sar/catalina.jar/org/apache/catalina/ut
il/ServerInfo.properties if you don't find it anywhere else.

Since this is a jboss configuration issue or a JBoss AS issue, this issue is 
invalid here.

Original comment by evernat@free.fr on 16 Mar 2014 at 12:18