UPDATED with latest information on 11/30/2021
I wrote a B4J program that accesses a legacy embedded Derby database so I can migrate data from that database to my new SQLite database. It also works on Windows, Mac, and Linux when run from B4J (using B4JBridge to connect to the Linux and Mac).
However, when I deploy to Windows, Mac, and Linux (using internal B4JPackager11 for windows, B4JPackager11.b4j project for Linux, and Mac Signer for the Mac) I get a classpath error when the code tries to initialize the SQL connection. So, it seems it must have something to do with my B4JPackager11.b4j project configuration but I cannot figure out what. I suspect I will need some sort of "AdditionalModuleInfoString: " line in my B4JPAckager11.b4j project configuration but I do not know what.
Additional information is provided below. Please remember that it does run from within B4J so I do not think it is the program itself. I am just giving you this information for background purposes.
1. Added to Main:
#AdditionalJar: derby
2. Relevant B4X code (where dbLocation is the location of the database in the system)
sql.Initialize("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:" & dbLocation)
3. Added to additionallibraries\B4X:
derby.jar
4. B4JPackager11.b4j project: (for Linux)
5. Error in deployed Application (Note the path to the database is correct):
Any help is appreciated - please see posts below for more information.
Thanks!
I wrote a B4J program that accesses a legacy embedded Derby database so I can migrate data from that database to my new SQLite database. It also works on Windows, Mac, and Linux when run from B4J (using B4JBridge to connect to the Linux and Mac).
However, when I deploy to Windows, Mac, and Linux (using internal B4JPackager11 for windows, B4JPackager11.b4j project for Linux, and Mac Signer for the Mac) I get a classpath error when the code tries to initialize the SQL connection. So, it seems it must have something to do with my B4JPackager11.b4j project configuration but I cannot figure out what. I suspect I will need some sort of "AdditionalModuleInfoString: " line in my B4JPAckager11.b4j project configuration but I do not know what.
Additional information is provided below. Please remember that it does run from within B4J so I do not think it is the program itself. I am just giving you this information for background purposes.
1. Added to Main:
#AdditionalJar: derby
2. Relevant B4X code (where dbLocation is the location of the database in the system)
sql.Initialize("org.apache.derby.jdbc.EmbeddedDriver", "jdbc:derby:" & dbLocation)
3. Added to additionallibraries\B4X:
derby.jar
4. B4JPackager11.b4j project: (for Linux)
Private InputJar As String = "/home/nmcollector/data/CP_JE_Exp_Deploy/Linux/nmCollectorCP_JE_Exp.jar"
Private AdditionalModuleInfoString As String = ""
Private VMArgs As String = ""
5. Error in deployed Application (Note the path to the database is correct):
Startup failed due to missing functionality for org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your classpath includes the correct Derby software.
ERROR XBM02: Startup failed due to missing functionality for org.apache.derby.iapi.services.stream.InfoStreams. Please ensure your classpath includes the correct Derby software.
at b4j/org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
at b4j/org.apache.derby.iapi.services.monitor.Monitor.missingImplementation(Unknown Source)
at b4j/org.apache.derby.impl.services.monitor.TopService.bootModule(Unknown Source)
at b4j/org.apache.derby.impl.services.monitor.BaseMonitor.startModule(Unknown Source)
at b4j/org.apache.derby.iapi.services.monitor.Monitor.startSystemModule(Unknown Source)
at b4j/org.apache.derby.impl.services.monitor.BaseMonitor.runWithState(Unknown Source)
at b4j/org.apache.derby.impl.services.monitor.FileMonitor.<init>(Unknown Source)
at b4j/org.apache.derby.iapi.services.monitor.Monitor.startMonitor(Unknown Source)
at b4j/org.apache.derby.iapi.jdbc.JDBCBoot.boot(Unknown Source)
at b4j/org.apache.derby.jdbc.EmbeddedDriver.boot(Unknown Source)
at b4j/org.apache.derby.jdbc.EmbeddedDriver.<clinit>(Unknown Source)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize2(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize(Unknown Source)
at b4j/b4j.nmCollector_JE_CP_Migr.dataaccessje._setvvvvvvvvvvvvvvvvvvvvvvvvv4(Unknown Source)
at b4j/b4j.nmCollector_JE_CP_Migr.b4xmainpage$ResumableSub_Button_Export_To_CSV_Click.resume(Unknown Source)
at b4j/anywheresoftware.b4a.BA.checkAndRunWaitForEvent(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA$1.run(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
dataaccessje._setvvvvvvvvvvvvvvvvvvvvvvvvv4 (java line: -1)
java.sql.SQLException: No suitable driver found for jdbc:derby:/home/nmcollector/Desktop/NMCollectorJE/NMCollectorJE.app/Contents/Resources/nmcswDB
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at java.sql/java.sql.DriverManager.getConnection(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize2(Unknown Source)
at b4j/anywheresoftware.b4j.objects.SQL.Initialize(Unknown Source)
at b4j/b4j.nmCollector_JE_CP_Migr.dataaccessje._setvvvvvvvvvvvvvvvvvvvvvvvvv4(Unknown Source)
at b4j/b4j.nmCollector_JE_CP_Migr.b4xmainpage$ResumableSub_Button_Export_To_CSV_Click.resume(Unknown Source)
at b4j/anywheresoftware.b4a.BA.checkAndRunWaitForEvent(Unknown Source)
at b4j/anywheresoftware.b4a.BA.raiseEvent2(Unknown Source)
at b4j/anywheresoftware.b4a.BA$1.run(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(Unknown Source)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.gtk.GtkApplication.lambda$runLoop$11(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Any help is appreciated - please see posts below for more information.
Thanks!
Last edited: