Subject load driver using URLClassLoader
Author dragospruteanu
Hi,

Here is Dragos from DbSchema(.com) database tool.
I have tried to connect to Firebird using the jdbc driver.
But I got an strange exception, look the stacktrace bellow:


Exception occurred during event dispatching:
java.lang.UnsatisfiedLinkError: no jaybird21 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1682)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1030)
at
org.firebirdsql.gds.impl.jni.JniGDSImpl.initJNIBridge(JniGDSImpl.java:58)
at org.firebirdsql.gds.impl.jni.JniGDSImpl.<clinit>(JniGDSImpl.java:23)
at
org.firebirdsql.gds.impl.jni.LocalGDSFactoryPlugin.getGDS(LocalGDSFactoryPlugin.java:40)
at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219)
at
org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:117)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125)
at
com.concrete.dbs.units.ConnectionFactory.getPooledConnection(ConnectionFactory.java:64)
at
com.concrete.dbs.editors.ConnectorEditor.actionPerformed(ConnectorEditor.java:286)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
at java.awt.Dialog$1.run(Dialog.java:1045)
at java.awt.Dialog$3.run(Dialog.java:1097)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1095)
at java.awt.Component.show(Component.java:1422)
at java.awt.Component.setVisible(Component.java:1375)
at java.awt.Window.setVisible(Window.java:806)
at java.awt.Dialog.setVisible(Dialog.java:985)
at
com.concrete.dbs.editors.EditorFactory.getEditorForNewUnit(EditorFactory.java:107)
at
com.concrete.dbs.editors.ConnectorChooser.<init>(ConnectorChooser.java:70)
at
com.concrete.dbs.panes.ProjectFrame.importProject(ProjectFrame.java:762)
at
com.concrete.dbs.panes.ProjectFrame.prelucrateActionEvent(ProjectFrame.java:569)
at
com.concrete.dbs.panes.ProjectFrame.actionPerformed(ProjectFrame.java:546)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at
com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(BasicJideButtonListener.java:83)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Exception occurred during event dispatching:
java.lang.NoClassDefFoundError: Could not initialize class
org.firebirdsql.gds.impl.jni.LocalGDSImpl
at
org.firebirdsql.gds.impl.jni.LocalGDSFactoryPlugin.getGDS(LocalGDSFactoryPlugin.java:40)
at org.firebirdsql.gds.impl.GDSFactory.getGDSForType(GDSFactory.java:219)
at
org.firebirdsql.jca.FBManagedConnectionFactory.getGDS(FBManagedConnectionFactory.java:117)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:125)
at
com.concrete.dbs.units.ConnectionFactory.getPooledConnection(ConnectionFactory.java:64)
at
com.concrete.dbs.editors.ConnectorEditor.actionPerformed(ConnectorEditor.java:286)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:177)
at java.awt.Dialog$1.run(Dialog.java:1045)
at java.awt.Dialog$3.run(Dialog.java:1097)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Dialog.show(Dialog.java:1095)
at java.awt.Component.show(Component.java:1422)
at java.awt.Component.setVisible(Component.java:1375)
at java.awt.Window.setVisible(Window.java:806)
at java.awt.Dialog.setVisible(Dialog.java:985)
at
com.concrete.dbs.editors.EditorFactory.getEditorForNewUnit(EditorFactory.java:107)
at
com.concrete.dbs.editors.ConnectorChooser.<init>(ConnectorChooser.java:70)
at
com.concrete.dbs.panes.ProjectFrame.importProject(ProjectFrame.java:762)
at
com.concrete.dbs.panes.ProjectFrame.prelucrateActionEvent(ProjectFrame.java:569)
at
com.concrete.dbs.panes.ProjectFrame.actionPerformed(ProjectFrame.java:546)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at
com.jidesoft.plaf.basic.BasicJideButtonListener.mouseReleased(BasicJideButtonListener.java:83)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at
java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:272)
at java.awt.Component.processMouseEvent(Component.java:6041)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3265)
at java.awt.Component.processEvent(Component.java:5806)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4413)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2440)
at java.awt.Component.dispatchEvent(Component.java:4243)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)