gpt4 book ai didi

java - SQuirreL配置: could not initial class org. apache.phoenix.jdbc.PhoenixDriver

转载 作者:行者123 更新时间:2023-12-01 09:20:10 25 4
gpt4 key购买 nike

当我配置 SQuirreL(3.7.1) 时,抛出此错误:

could not initial class org.apache.phoenix.jdbc.PhoenixDriver


java.lang.NoClassDefFoundError: Could not initialize class org.apache.phoenix.jdbc.PhoenixDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at java.lang.Class.newInstance(Class.java:442)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager.registerSQLDriver(SQLDriverManager.java:75)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriverManager$MyDriverListener.propertyChange(SQLDriverManager.java:197)
at java.beans.PropertyChangeSupport.fire(PropertyChangeSupport.java:335)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:327)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:263)
at net.sourceforge.squirrel_sql.fw.util.PropertyChangeReporter.firePropertyChange(PropertyChangeReporter.java:65)
at net.sourceforge.squirrel_sql.fw.sql.SQLDriver.setJarFileNames(SQLDriver.java:277)
at net.sourceforge.squirrel_sql.client.gui.db.DriverInternalFrame.applyFromDialog(DriverInternalFrame.java:246)
at net.sourceforge.squirrel_sql.client.gui.db.DriverInternalFrame.performOk(DriverInternalFrame.java:221)
at net.sourceforge.squirrel_sql.client.gui.db.DriverInternalFrame.access$200(DriverInternalFrame.java:57)
at net.sourceforge.squirrel_sql.client.gui.db.DriverInternalFrame$3.actionPerformed(DriverInternalFrame.java:373)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6535)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6300)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4891)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2750)
at java.awt.Component.dispatchEvent(Component.java:4713)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at net.sourceforge.squirrel_sql.client.Main$1.dispatchEvent(Main.java:99)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

enter image description here

这是详细日志:

最佳答案

该错误消息表明 JVM 已尝试执行类 org.apache.phoenix.jdbc.PhoenixDriver 的静态初始化,但失败。

如果 JVM 无法静态初始化一个类,可能是因为它所依赖的类丢失,或者 static { ... } block 中的某些代码抛出了异常,那么 JVM 将不会尝试第二次加载此类。正如您所看到的,它只会抛出一个 NoClassDefFoundError 。您将需要重新启动 JVM 以使其尝试再次加载驱动程序类。重新启动 SQuirreL,尝试再次连接到 Phoenix,看看第一次是否收到不同的错误消息。

查看source code of this class ,如果 (a) slf4j JAR 丢失,(b) 您正在运行的应用程序具有拒绝添加关闭 Hook 的权限的 SecurityManager,或者 (c) JVM 无法创建其父类(super class)的实例,则静态初始化可能会失败, PhoenixEmbeddedDriver 。父类(super class)依赖于 commons-logging,因此另一个可能的原因可能是 commons-logging JAR 丢失。

但是,这些只是我对问题所在的猜测。据我所知,唯一确定的方法是重新启动 SQuirreL,看看您是否第一次收到不同的异常消息。

关于java - SQuirreL配置: could not initial class org. apache.phoenix.jdbc.PhoenixDriver,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40215921/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com