I am trying to use Apache Derby with LibreOffice Base. I am on OSX. I have gone into Preferences → Advanced, and added derby.jar
to the class path. However, when I create a new connection, I select JDBC, and enter org.apache.derby.jdbc.EmbeddedDriver
as the driver class. When I click “Test Class”, it replies “The JDBC Driver could not be loaded”.
Below is what I see when inspecting standard out (or standard error):
2014-03-05 09:37:17.365 soffice[1972:507] Apple AWT Java VM was loaded on first thread -- can't start AWT.
Exception in thread "Thread-1" java.lang.InternalError: Can't start the AWT because Java was started on the first thread. Make sure StartOnFirstThread is not specified in your application's Info.plist or on the command line
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1833)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1730)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1044)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1605)
at java.awt.Toolkit.<clinit>(Toolkit.java:1627)
at sun.awt.AppContext$2.run(AppContext.java:240)
at sun.awt.AppContext$2.run(AppContext.java:226)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.initMainAppContext(AppContext.java:226)
at sun.awt.AppContext.access$200(AppContext.java:112)
at sun.awt.AppContext$3.run(AppContext.java:306)
at java.security.AccessController.doPrivileged(Native Method)
at sun.awt.AppContext.getAppContext(AppContext.java:287)
at com.sun.jmx.trace.Trace.out(Trace.java:180)
at com.sun.jmx.trace.Trace.isSelected(Trace.java:88)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.isTraceOn(DefaultMBeanServerInterceptor.java:1830)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:929)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:916)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
at com.sun.jmx.mbeanserver.JmxMBeanServer$2.run(JmxMBeanServer.java:1195)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.jmx.mbeanserver.JmxMBeanServer.initialize(JmxMBeanServer.java:1193)
at com.sun.jmx.mbeanserver.JmxMBeanServer.<init>(JmxMBeanServer.java:225)
at com.sun.jmx.mbeanserver.JmxMBeanServer.<init>(JmxMBeanServer.java:170)
at com.sun.jmx.mbeanserver.JmxMBeanServer.newMBeanServer(JmxMBeanServer.java:1401)
at javax.management.MBeanServerBuilder.newMBeanServer(MBeanServerBuilder.java:93)
at javax.management.MBeanServerFactory.newMBeanServer(MBeanServerFactory.java:311)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:214)
at javax.management.MBeanServerFactory.createMBeanServer(MBeanServerFactory.java:175)
at sun.management.ManagementFactory.createPlatformMBeanServer(ManagementFactory.java:302)
at java.lang.management.ManagementFactory.getPlatformMBeanServer(ManagementFactory.java:504)
at org.apache.derby.impl.services.jmx.JMXManagementService$1.run(Unknown Source)
at org.apache.derby.impl.services.jmx.JMXManagementService$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.services.jmx.JMXManagementService.findServer(Unknown Source)
at org.apache.derby.impl.services.jmx.JMXManagementService.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(Unknown Source)
at org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Unknown Source)
at org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown Source)
at org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
at org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
at org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
at org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
Exception in thread "Thread-5" java.lang.NoClassDefFoundError: Could not initialize class org.apache.derby.jdbc.EmbeddedDriver
It would seem that the JRE is able to find the class, but an error occurs when attempting to load it? Or am I reading this wrong? How can I use Derby with LibreOffice Base?