fengshao0907 / javamelody

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

Database not recognised in Websphere Application Server #281

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Deploy an application on WAS with a datasource

What is the expected output? What do you see instead?
The URL https://host:port/app/monitoring?part=database return a messageBox  and 
the message is "null". This is due to a NullPointerException in 
DatabaseInformations.Database.getDatabaseForConnection(..) because 
metaData.getURL() return null.

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

Please provide any additional information below.
The provided patch is inspired by Hibernate. I use the method 
metaData.getDatabaseProductName instead of metaData.getURL().

With this modification javamelody works fine in WAS (for information, i use 
SpringDataSourceBeanPostProcessor because datasources can't be wrapped)

The provided patch was tested with: JBoss/Websphere Application Server/Weblogic 
and Sybase 

Original issue reported on code.google.com by lastm...@yahoo.fr on 15 Jan 2013 at 4:29

Attachments:

GoogleCodeExporter commented 9 years ago
I have changed the patch a bit, but the result is the same as your patch.
And I have kept the url comparison (when it is not null) as fallback, because 
database names may change in the future.

It is committed in trunk (revision 3254) and ready for the next release (1.43).

Original comment by evernat@free.fr on 20 Jan 2013 at 12:03