连接到ORACLE DB时获取ClassNotFoundException:org.apache.juli.ClassLoaderLogManager / 1catalina.org.apache.juli.FileHandler

时间:2014-10-20 14:50:29

标签: java jdbc

当我在Windows上使用Eclipse java版本:1.7.0_07时,我的代码工作正常。当我使用HP Unix java版本:1.7.0.06时,我得到以下异常。在这两种情况下,我都使用ojdbc6.jar

即使我遇到此异常,我也能够成功连接并执行数据库操作。有什么问题,我该如何解决?

堆栈跟踪:

Could not load Logmanager "org.apache.juli.ClassLoaderLogManager"
java.lang.ClassNotFoundException: org.apache.juli.ClassLoaderLogManager
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$1.run(LogManager.java:186)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnet.<init>(DBConnet.java:42)
Can't load log handler "1catalina.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnet.<init>(DBConnet.java:42)
Can't load log handler "1catalina.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 1catalina.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1249)
                at java.util.logging.LogManager.access$1300(LogManager.java:150)
                at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:1322)
                at java.util.logging.LogManager$4.run(LogManager.java:699)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnet.<init>(DBConnet.java:42)
Can't load log handler "2localhost.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 2localhost.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1249)
                at java.util.logging.LogManager.access$1300(LogManager.java:150)
                at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:1322)
                at java.util.logging.LogManager$4.run(LogManager.java:699)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnet.<init>(DBConnet.java:42)
Can't load log handler "3manager.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 3manager.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 3manager.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1249)
                at java.util.logging.LogManager.access$1300(LogManager.java:150)
                at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:1322)
                at java.util.logging.LogManager$4.run(LogManager.java:699)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnet.<init>(DBConnet.java:42)
Can't load log handler "4admin.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 4admin.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 4admin.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1249)
                at java.util.logging.LogManager.access$1300(LogManager.java:150)
                at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:1322)
                at java.util.logging.LogManager$4.run(LogManager.java:699)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnect.<init>(DBConnect.java:42)

Can't load log handler "5host-manager.org.apache.juli.FileHandler"
java.lang.ClassNotFoundException: 5host-manager.org.apache.juli.FileHandler
java.lang.ClassNotFoundException: 5host-manager.org.apache.juli.FileHandler
                at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
                at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
                at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
                at java.util.logging.LogManager$4.run(LogManager.java:684)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.initializeGlobalHandlers(LogManager.java:1249)
                at java.util.logging.LogManager.access$1300(LogManager.java:150)
                at java.util.logging.LogManager$RootLogger.addHandler(LogManager.java:1322)
                at java.util.logging.LogManager$4.run(LogManager.java:699)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.loadLoggerHandlers(LogManager.java:678)
                at java.util.logging.LogManager.addLogger(LogManager.java:851)
                at java.util.logging.LogManager$1.run(LogManager.java:200)
                at java.security.AccessController.doPrivileged(Native Method)
                at java.util.logging.LogManager.<clinit>(LogManager.java:176)
                at java.util.logging.Logger.demandLogger(Logger.java:307)
                at java.util.logging.Logger.getLogger(Logger.java:361)
                at com.sun.jmx.remote.util.ClassLogger.<init>(ClassLogger.java:55)
                at javax.management.NotificationBroadcasterSupport.<clinit>(NotificationBroadcasterSupport.java:352)
                at javax.management.MBeanServerDelegate.<init>(MBeanServerDelegate.java:72)
                at com.sun.jmx.mbeanserver.MBeanServerDelegateImpl.<init>(MBeanServerDelegateImpl.java:100)
                at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServerDelegate(JmxMBeanServer.java:1359)
                at javax.management.MBeanServerBuilder.newMBeanServerDelegate(MBeanServerBuilder.java:66)
                at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:319)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:230)
                at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:191)
                at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:466)
                at oracle.jdbc.driver.OracleDriver.registerMBeans(OracleDriver.java:320)
                at oracle.jdbc.driver.OracleDriver$1.run(OracleDriver.java:199)
                at java.security.AccessController.doPrivileged(Native Method)
                at oracle.jdbc.driver.OracleDriver.<clinit>(OracleDriver.java:195)
                at java.lang.Class.forName0(Native Method)
                at java.lang.Class.forName(Class.java:192)
                at com.gmax.extract.DBConnect.<init>(DBConnet.java:42)

我的数据库连接代码:

public DBConnect(String className, String url, String userName, String passwd) throws Exception{
              try{
              Class.forName(className);
               connection = DriverManager.getConnection(url, userName, passwd);
               connection.setAutoCommit(false);
               if (connection != null) {
                       System.out.println("Connected to the database");
                   }
              } catch (Exception e) {
                    throw e;
                    }
                  }

0 个答案:

没有答案