Home Oracle logs filled with "java.lang.Throwable: No Error"?
Reply: 2

Oracle logs filled with "java.lang.Throwable: No Error"?

ab11
1#
ab11 Published in 2017-12-07 21:20:19Z

I have enabled JDBC logging for my Oracle connection. I would like the log to only contain the text of executed queries, but it is filled with the below error.

Any suggestions for what may be causing this trace, how I can fix it, and/or how I can limit my logging to the text of executed queries?

java.lang.Throwable: No Error
  at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1624)
  at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:4347)
  at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:4426)
  at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:4733)
  at sun.reflect.GeneratedMethodAccessor47.invoke(Unknown Source)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:606)
  at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:125)
  at com.sun.proxy.$Proxy60.executeQuery(Unknown Source)
  at com.me.MyClass.doQuery(MyClass.java:56)
  at org.apache.jsp.jsp.secure.b2f.b2flogin_jsp._jspService(b2flogin_jsp.java:686)
  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:438)
  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:396)
  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:340)
  at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
  at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504)
  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
  at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1539)
  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1495)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
  at java.lang.Thread.run(Thread.java:745)

My OraceLog.properties

oracle.jdbc.level=CONFIG
oracle.jdbc.handlers=java.util.logging.FileHandler
java.util.logging.FileHandler.level=CONFIG
java.util.logging.FileHandler.count=1
java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter

java.util.logging.FileHandler.pattern = /tmp/jdbc.log

Edit

After using the JDBC logging a bit for debugging my applications, I have found the trace is useful, as it indicates code locations of SQL statements. And it can be easily filtered out with regex like:

tail -f /tmp/jdbc.log | grep -v 'java.lang.*\|.at.

Jim Garrison
2#
Jim Garrison Reply to 2017-12-07 21:31:06Z

This seems to be a known side-effect of tracing SQL statements (.level=CONFIG and finer). It is discussed in the comments on Enabling Oracle JDBC Driver Debug. The last post there was in 2012.

There does not seem to be a way to disable the stack trace.

Douglas Surber
3#
Douglas Surber Reply to 2017-12-11 16:04:21Z

Write a java.util.logging.Filter that does nothing with No Error log messages and attach it to your Handler. Note that the Throwable is not thrown. It's just a hack to get the stack trace.

Oracle Database JDBC logging is a tool intended for debugging, not production. It's a huge performance drain. We strongly discourage using it in production. Our experience is that customers who want to see the SQL also want to see where it came from. That's why the stack trace.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.309843 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO