Closed GoogleCodeExporter closed 9 years ago
It's just a bit strange.
SQL monitoring worked first in Tomcat 6 and JNDI, and for more than 4 years now.
Can you give the xml definition of the datasource (without private information
of course)?
And after that, can you debug and say why rebinding failed inside
net.bull.javamelody.JdbcWrapper?
Original comment by evernat@free.fr
on 20 Mar 2014 at 11:51
Datasource:
<Context docBase="/var/www/webapps/xxxx" path="/xxxx" debug="0"
reloadable="true">
<WatchedResource>WEB-INF/web.xml</WatchedResource>
<Resource name="jdbc/xxxx"
auth="Container"
type="javax.sql.DataSource"
maxActive="50"
maxIdle="30"
maxWait="10000"
removeAbandoned="true"
removeAbandonedTimeout="5000"
logAbandoned="true"
username="xxxx"
password="xxxx"
driverClassName="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@192.168.102.102:1684:XXXXXXX" />
</Context>
It's a real environment. It will be difficult to debug... Anyway, maybe I can
get more info if I add log4j.xml and library to the classpath. Or is there any
way to get more debug info?
Thanks!
Original comment by jll...@gmail.com
on 21 Mar 2014 at 10:36
Your datasource is mostly classic. No problem with that.
Why the serverInfo says "Server: XXXX Application Server" in the log above?
And what is XXX?
For Tomcat, it should be something like "Server: Apache Tomcat/6.0.26".
Your server is not really Tomcat?
Original comment by evernat@free.fr
on 21 Mar 2014 at 10:46
XXX = name of my company
I suppose it's getting it from one config file.
Anyway, I'm sure it's a Tomcat 6
Original comment by jll...@gmail.com
on 21 Mar 2014 at 10:53
It's a bit strange, I have never seen a company changing the name of the Tomcat
server. Why would someone do that?
I suggest to look into the server logs (logged with Logback or Log4J or
java.util.logging).
You should see the stack-trace of an exception near the message "rebinding
datasources failed, skipping". This stack-trace and its "caused by" may give us
an hint of the problem.
Original comment by evernat@free.fr
on 22 Mar 2014 at 1:26
[deleted comment]
I don't know why sysadmins changed the name of Tomcat Server...
Here it is the log (with the stack-trace):
13:42:26,097 DEBUG [net.bull.javamelody] rebinding datasources failed, skipping
javax.naming.NamingException: Context is read only
at org.apache.naming.NamingContext.checkWritable(NamingContext.java:903)
at org.apache.naming.NamingContext.bind(NamingContext.java:831)
at org.apache.naming.NamingContext.rebind(NamingContext.java:208)
at org.apache.naming.NamingContext.rebind(NamingContext.java:223)
at org.apache.naming.SelectorContext.rebind(SelectorContext.java:222)
at javax.naming.InitialContext.rebind(InitialContext.java:408)
at net.bull.javamelody.JdbcWrapperHelper.rebindDataSource(JdbcWrapperHelper.java:109)
at net.bull.javamelody.JdbcWrapper.rebindDataSources(JdbcWrapper.java:445)
at net.bull.javamelody.FilterContext.<init>(FilterContext.java:83)
at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:111)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4071)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4725)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:840)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Any idea?
Thanks!
Original comment by jll...@gmail.com
on 26 Mar 2014 at 12:50
I understand now.
In fact, javamelody knows how to work around this "read only context", when it
recognize a Tomcat server, that is when the name of the server contains
"Tomcat".
Given that your sysadmins have changed the name of "Tomcat", javamelody don't
know what to do and it skips datasource monitoring.
It is clear to me that your issue is invalid, because you can't expect
javamelody to recognize "Tomcat" when you have changed the name of the server.
That said, it may work to add the parameter "rewrap-datasources" = "true" (no
guarantee). For example, with the system property
-Djavamelody.rewrap-datasources=true
Otherwise, you can change back the name of the server to "Apache Tomcat/6.x.x"
Original comment by evernat@free.fr
on 28 Mar 2014 at 3:25
Forgot to say that "rewrap-datasources" is a non official parameter: not
documented, no support, no guarantee.
Original comment by evernat@free.fr
on 28 Mar 2014 at 3:26
Original issue reported on code.google.com by
jll...@gmail.com
on 20 Mar 2014 at 5:52