-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite database is not being created #3
Comments
When is created the SQLite database (C:\Users\fvarrui\AppData\Local\GistFX\SQLite\Database.sqlite) in your code? When does it try to connect to a non existing database? |
@fvarrui Curious, what happens if you run the EXE as Admin? |
@fvarrui - I changed the location for Windows data file storage over to the Microsoft prescribed APPDATA folder and I pushed the change to the repository. Try that. |
@fvarrui - I GOT IT WORKING! ... I'm so happy! I pushed the working version to the repository ... next up - MacOS installer ☺ |
Hi @EasyG0ing1! [INFO] Bundling JRE ... with C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot
[INFO] Creating customized JRE ...
[INFO] Getting required modules ...
[INFO] Executing command: cmd.exe /s /c ""C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\jdeps" -q --multi-release 17 --ignore-missing-deps --print-module-deps C:\Users\fvarrui\GistFX\target\GistFX\libs\*.jar C:\Users\fvarrui\GistFX\target\GistFX-3.3.6-runnable.jar"
[ERROR] Exception in thread "main" java.lang.module.FindException: Module org.apache.commons.lang3 not found, required by com.redmondsims.gistfx
[ERROR] at java.base/java.lang.module.Resolver.findFail(Resolver.java:893)
[ERROR] at java.base/java.lang.module.Resolver.resolve(Resolver.java:192)
[ERROR] at java.base/java.lang.module.Resolver.resolve(Resolver.java:141)
[ERROR] at java.base/java.lang.module.Configuration.resolve(Configuration.java:421)
[ERROR] at java.base/java.lang.module.Configuration.resolve(Configuration.java:255)
[ERROR] at jdk.jdeps/com.sun.tools.jdeps.JdepsConfiguration$Builder.build(JdepsConfiguration.java:564)
[ERROR] at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.buildConfig(JdepsTask.java:603)
[ERROR] at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:557)
[ERROR] at jdk.jdeps/com.sun.tools.jdeps.JdepsTask.run(JdepsTask.java:533)
[ERROR] at jdk.jdeps/com.sun.tools.jdeps.Main.main(Main.java:49)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.394 s
[INFO] Finished at: 2022-03-25T11:21:53Z
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal io.github.fvarrui:javapackager:1.6.5:package (package-for-windows) on project GistFX: Command execution failed: C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin\jdeps -q --multi-release 17 --ignore-missing-deps --print-module-deps [Ljava.lang.String;@34e7b058 C:\Users\fvarrui\GistFX\target\GistFX\libs\*.jar C:\Users\fvarrui\GistFX\target\GistFX-3.3.6-runnable.jar -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException Sometimes <configuration>
<mainClass>${exec.mainClass}</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>false</customizedJre>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
<!--
<jdkPath>/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home</jdkPath>
-->
</configuration>
Have you experienced this problem too? Then, when I try to run your app it stops due to the same error as I reported before (maybe I'm missing something or doing something wrong): C:\Users\fvarrui\GistFX>target\GistFX\GistFX.exe
*** SQLite.createSchema ***
[SQLITE_ERROR] SQL error or missing database (incomplete input)
org.sqlite.SQLiteException: [SQLITE_ERROR] SQL error or missing database (incomplete input)
at [email protected]/org.sqlite.core.DB.newSQLException(DB.java:1030)
at [email protected]/org.sqlite.core.DB.newSQLException(DB.java:1042)
at [email protected]/org.sqlite.core.DB.throwex(DB.java:1007)
at [email protected]/org.sqlite.core.NativeDB._exec_utf8(Native Method)
at [email protected]/org.sqlite.core.NativeDB._exec(NativeDB.java:97)
at [email protected]/org.sqlite.jdbc3.JDBC3Statement.executeUpdate(JDBC3Statement.java:102)
at com.redmondsims.gistfx.data.SQLite.createSchema(SQLite.java:116)
at com.redmondsims.gistfx.data.SQLite.setConnection(SQLite.java:56)
at com.redmondsims.gistfx.data.Action.setDatabaseConnection(Action.java:52)
at com.redmondsims.gistfx.Main.start(Main.java:166)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:847)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:484)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:457)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:456)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:184)
at java.base/java.lang.Thread.run(Unknown Source)
The SQLite library failed to create the schema.
Make sure your Access Control Lists are permissive for the folder that GistFX executes from.
Run program from a command prompt to see the full stack trace.
Exiting... |
@fvarrui The version I just now pushed, I literally just copied the project folder over to windows then from a CMD prompt, after changing into the project directory, I ran |
Could it be because the database file already exists on your system? So, there's no need to create a new one, and in my case, as it doesn't exist, fails when creating this file |
May you publish your Setup installer in the releases section, please? |
@fvarrui - no, the database file doesn't exist because I copy the installer off to a network drive, then I revert my virtual machine to a snapshot that I took long before I even started trying to run it on Windows and it still works. Have you tried running it as Admin? Also, whats the build switch that makes the Windows exe not launch a CMD window that it leaves running in the background? |
Hi @EasyG0ing1! C:\Users\fvarrui\GistFX\target\GistFX>GistFX.exe
[SQLITE_ERROR] SQL error or missing database (no such table: Gists)
com.redmondsims.gistfx.data.SQLite.hasData(SQLite.java:366)
com.redmondsims.gistfx.data.SQLite.gistsHasData(SQLite.java:355)
com.redmondsims.gistfx.data.SQLite.hasData(SQLite.java:350)
com.redmondsims.gistfx.data.SQLite.setConnection(SQLite.java:68)
com.redmondsims.gistfx.data.Action.setDatabaseConnection(Action.java:53)
com.redmondsims.gistfx.Main.start(Main.java:94) It seems that it can't find the |
@fvarrui - I published the installer |
It's creating this directory structure:
but Ok ... I'm going to try with your installer and tell you something in a moment. |
@fvarrui - Try deleting this folder Then re-run the program and see what happens And make sure you have an APPDATA environment variable |
Yes, done.
Ok, I'm gonna tell you something right now.
C:\Users\fvarrui\GistFX\target\GistFX>echo %APPDATA%
C:\Users\fvarrui\AppData\Roaming |
@fvarrui - ok that looks right |
Try to change |
@fvarrui so mine will run but yours won't? |
@fvarrui It might be because I have the luxury of installing all the tools from a fresh install of windows since I have the snapshots saved in VMWare ... |
Well ... I'm not sure why, but the important thing is that your installer works fine |
@fvarrui - Now I gotta figure out how to build a MacOS installer, then a linux installer after that. |
If you want that anybody can build your app, include instructions in README. This is my environment config:
I don't know how it differs from your environment. |
Great! Don't hesitate to ask me if you have difficulties |
Heres my build environment
|
I would venture to say that you only have to run |
@fvarrui - Well I'll need an execution setup properly under the plugin ... no? |
Almost the same configuration ... maybe the problem is mine ... could you try to build your app on another system? |
@fvarrui - The best I can do is another virtual machine ... OR I could use the BootCamp dual boot on my MacBook Pro. |
This config should work on each system: <plugin>
<groupId>io.github.fvarrui</groupId>
<artifactId>javapackager</artifactId>
<version>1.6.5</version>
<configuration>
<mainClass>${exec.mainClass}</mainClass>
<bundleJre>true</bundleJre>
<customizedJre>false</customizedJre>
<generateInstaller>true</generateInstaller>
<administratorRequired>false</administratorRequired>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>package</goal>
</goals>
<configuration>
<platform>auto</platform>
<createZipball>false</createZipball>
<createTarball>true</createTarball>
<vmArgs>
<vmArg>--module-path=libs</vmArg>
<vmArg>--add-modules=javafx.controls,javafx.graphics</vmArg>
</vmArgs>
<winConfig>
<headerType>gui</headerType>
<generateMsi>false</generateMsi>
</winConfig>
</configuration>
</execution>
</executions>
</plugin> |
I was just saying that to make sure your app can be built from any Windows |
@fvarrui - Well, I managed to get it compiled and working on my dev machine, but when I tried it on my macOS virtual machine, it errored out again saying that things were compiled with a newer version of Java ... then I was looking at the
And that file does not exist anywhere ... do you know what that's about? Here is the entire Info.plist file:
|
Hi @EasyG0ing1! Could you try to remove |
I have to improve JavaPackager to work better with modular apps ... until then, try this, please |
@fvarrui - OK, I did that ... and I removed the It runs fine on my dev machine without any problems at all. But when I run it on my Mac virtual machine (that is a clean install of MacOS and has no JDK or JRE installed anywhere) ... I get this error:
|
Ok. Could you take a look at the |
@fvarrui - just to experiment, I installed jdk18 and without doing anything else (no JAVA_HOME set or anything), the app runs fine on the virtual machine now ... but I'm going to reset the snapshot and run it again then look at the logs as you suggest. |
I'm not sure if the problem is with |
@fvarrui Well, like I said, there are no other JREs/JDKs installed on the virtual machine ... and Ive been looking in the console but nothing stands out, what am I looking for? |
Yes! You told me, sorry.
Any entry logged by |
@fvarrui no ita not logging anything at all |
@fvarrui the only thing I see is this error in Terminal when I launch the program:
|
@fvarrui - When I double click the icon, I get this error:
|
@fvarrui - I opened this issue - you might want to ake a look ... and I found this issue which is the exact problem I'm having. |
But this other issue refers to universalJavaApplicationStub 3.1.0, and JavaPackager is using 3.2.0. It should be fixed, so, same error but different cause. I've got a Mac Mini with MacOs 10.15 ... I'll try your project when arrive at home. Which Mac OS versions have your Mac Book and your VM? |
Please, could you push your changes (in a new branch if you prefer)? |
@fvarrui - Yes, I will push the current code by the next hour or so ... and you are correct on your assertion of the issue I created on the launch script. The closed issue seemed to indicate that the problem was resolved. But clearly it's still a problem so hopefully the issue I opened will help with a fix or a plausible work-around of some kind. He did say in the closed issue what the problem was in the script .... but on quick inspection - it's all greek to me ... I'll post here when I posh the current code ... I gotta clean some things up in the project first. By the way, I'm running MacOS Monteray 12.3 If you have a powerful enough PC, you can run MacOS in the free version of VMWare - Workstation (or maybe it's VMWare Player) I believe it's called for Windows - Fusion is the Mac flavor. |
Hi @EasyG0ing1! Please, take a look to this reply. Maybe your problem could be solved with a well defined |
Yes, I've got a MacOS 10.12.6 in a VM (I'm using VirtualBox) ... but I haven't had time to get a newer version |
@fvarrui You do know that thre is a free version of VMWare for personal use? I like it much better than VirtualBox, personally. I just pushed the latest code into the repository ... had to battle some monsters which took some time. Mike |
My issue isn't with code signing, it's with the app launching without being able to find the java executable when I don't have a JDK or JRE installed separately on the machine. |
@fvarrui - So this is interesting ... reading that other issue more carefully, I noticed that the guy said that he was able to get it to work with packager version 1.6.2, so I tried that and sure enough, it works just fine. Do you have any idea why? |
@fvarrui - ok, the pull request you made, once I committed it, then re-packaged on MacOS, using version 1.6.6 of the packager, worked perfectly. ☺ |
The current push to the repository is the working version by the way. |
Great news! 😄 Sorry, I didn't have time before to explain to you in the PR why entitlements solve the problem. As Mabula (@AstroPixelProcessor) explained, AFAIK, the entitlements file contains the permissions required by the app, and which must be granted by the OS. I tried on my Mac mini using entitlements and it worked like a charm. So your app's problem wasn't that it was not able to find the JRE, but it was that the JRE libraries did not have permissions to be loaded. Exactly, this entitlement: <key>com.apple.security.cs.disable-library-validation</key>
<true/> tells the OS not to validate the libraries ( So many thanks to @AstroPixelProcessor!!! |
Ah! That makes perfect sense. And yes, thanks to @AstroPixelProcessor for this solution ... Next item on the agenda ... LINUX! And I don't even know where to begin. |
Change platform property from mac to linux 😅 that's what I told you last time for building for mac. Good luck! 😄 |
No, seriously now. You can do two things:
And, of course, set |
Once you have managed to build your app for all platforms, it would be a good idea to use GitHub Action workflows to generate each installation artifact in the cloud. ASAP I'm going to make an example. |
Excellent, glad to contribute! |
When I run with
mvn javafx:run
it shows this error:and also shows this:
The text was updated successfully, but these errors were encountered: