2

当我ojdbc6.jar用于我的应用程序时。我遇到了一些奇怪的错误。谁能帮我解决这个错误?

这是我的应用程序执行期间引发的异常的完整堆栈跟踪

Sep 20, 2013 4:05:36 PM oracle.jdbc.driver.OracleDriver registerMBeans
SEVERE: Error while registering Oracle JDBC Diagnosability MBean.
javax.management.MalformedObjectNameException: Invalid character '\n' in value part of property
    at javax.management.ObjectName.construct(ObjectName.java:618)
    at javax.management.ObjectName.<init>(ObjectName.java:1382)
    at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:303)
    at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:213)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:209)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:190)
    at conf.dbcon.dbstate(dbcon.java:42)
    at system.ObjectInfo.getObjectType(ObjectInfo.java:100)
    at system.readFile.readContents(readFile.java:36)
    at system.upload.doPost(upload.java:54)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:936)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1004)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)
4

2 回答 2

4

ojdbc6.jar从 OTN 重新下载了路径驱动程序。

要检查您是否有路径驱动程序,请按照以下步骤操作

> java -jar ojdbc6.jar

未打补丁的 jar 打印

Oracle 11.1.0.6.0-Production JDBC 4.0 complied with JDK6

和修补的罐子打印

Oracle 11.1.0.6.0-Production+ JDBC 4.0 complied with JDK6

如果您使用 ojdbc5,它将显示 3.0 和 1.5。

于 2013-10-01T17:32:08.290 回答
-1

重新下载 jar 或更改 maven/gradle 工件的版本。我有同样的问题

    <dependency>
        <groupId>com.oracle</groupId>
        <artifactId>ojdbc</artifactId>
        <version>11.1.0.6.0</version>
    </dependency>

更改以<version>11.2.0.4.0</version>解决问题

于 2019-07-13T17:00:55.363 回答