茫茫網海中的冷日 - 對這文章發表回應
茫茫網海中的冷日
         
茫茫網海中的冷日
發生過的事,不可能遺忘,只是想不起來而已!
 恭喜您是本站第 1671219 位訪客!  登入  | 註冊
主選單

Google 自訂搜尋

Goole 廣告

隨機相片
IMG_DPP_0044.jpg

授權條款

使用者登入
使用者名稱:

密碼:


忘了密碼?

現在就註冊!

對這文章發表回應

發表限制: 非會員 可以發表

發表者: 冷日 發表時間: 2019/4/26 7:09:54
WARNING: Error while registering Oracle JDBC Diagnosability MBean

We are getting the following error when using Oracle 11g ojdbc6.jar:
WARNING: Error while registering Oracle JDBC Diagnosability MBean.
java.lang.NoSuchMethodError:
javax.management.StandardMBean.<init>(Ljava/lang/Class;Z)V
        at oracle.jdbc.driver.OracleDiagnosabilityMBean.<init>(OracleDiagnosabilityMBean.java:34)
        at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:342)
        at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)

After investigating from many forums and blogs, we have not found any final solutions yet. So, we want to share the workaround way here.



According Oracle document, The JDBC diagnosability management feature introduces an MBean, oracle.jdbc.driver.OracleDiagnosabilityMBean. This MBean provides means to enable and disable JDBC logging, you can find it here: https://docs.oracle.com/cd/B28359_01/java.111/b31224/diagnose.htm.
And, the driver uses java.util.logging for logging purpose, actually in our cases we don't really need to use that info, so decide to disable the log and there is NO warning happen anymore.
How to disable the log for the driver (oracle.jdbc):
As default, JRE use the default properties file in JRE_HOME\lib\logging.properties, so edit the file and adding this info:
oracle.jdbc.level=OFF

Or configuring your own properties log file for java.util.logging
java -Djava.util.logging.config.file=/YourConfig.properties
        Add oracle.jdbc.level=OFF to YourConfig.properties

It works for us, don't get any WANRING error above.

This may not solve the problem for everyone, as it did not for me. Link to Oracle download is not valid. – jedison Jul 9 '15 at 16:58



I had the exact same issue. I don't know if my environment is the same.
In my environment, I'm using both jdbc and jboss jars in the same application. I believe, but did not verify, that something in the jboss jars is hooking into the class loader and causing the issue.
I got around the issue by only loading the ojdbc driver jar, creating my database instance, and then loading the jboss jars.



I'm using Maven and my project was using log4j 1.2.15. For whatever reason, 1.2.15 has dependencies on jms 1.1, jmxtools 1.2.1, and jmxri 1.2.1.
jmxri 1.2.1 contains a version of StandardMBean with a constructor that takes a StandardMBean (not java.lang.Class). While I did not do extensive testing to confirm this hypothesis, I believe that this is the version of the class that was being used, and the ultimate cause of the error.
It seems as though log4j 1.2.14 doesn't have those dependencies. So I backed down to 1.2.14, and took them out.

原文出處:java - WARNING: Error while registering Oracle JDBC Diagnosability MBean - Stack Overflow
內容圖示
url email imgsrc image code quote
樣本
bold italic underline linethrough   












 [詳情...]
validation picture

注意事項:
預覽不需輸入認證碼,僅真正發送文章時才會檢查驗證碼。
認證碼有效期10分鐘,若輸入資料超過10分鐘,請您備份內容後,重新整理本頁並貼回您的內容,再輸入驗證碼送出。

選項

Powered by XOOPS 2.0 © 2001-2008 The XOOPS Project|