#using Mongodb in Java Desktop Application
56 messages · Page 1 of 1 (latest)
⌛ This post has been reserved for your question.
Hey @haughty pumice! Please use
/closeor theClose Postbutton above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.
TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.
what are your questions
I have an already fullfilled database in mongo , is there a way to embed this database with the desktop app so that it comes with the installer?
you would have to embed mongodb which would involve launching a separate mongodb process (probably using native code)
you might be better off using a naturally embedded database (e.g. HSQLDB, H2), or connect to a remote mongodb instance, for example their cloud offering has a free tier: https://www.mongodb.com/pricing (see "Shared")
I am know using mongodb compass which means its connecting to the local host
right
I dont think i can change the implementation because a lot of pages in the app depend on the data retrieved from the db
Thzt would mean another process
So i thought i would embed it ready with my app
there is an embedded mongodb lib called flapdoodle but i think it's just for testing (i.e. it's not persistent)
so maybe it's better to use the hosted mongodb i linked above^ ?
Does it require internet connection for the users who install my app?
yeah that is the downside
you create a read-only user that can only query the DB (used in the desktop app), and you can update records etc using a separate admin type user
Wdym not persistent ? What are their limits?
i think it only implements the mongodb api but doesn't actually store anything
Thanks i will do a research on those, another question please, do you have any experience with linking an app to the internet (for example for authentication using Google)?
If you are finished with your post, please close it.
If you are not, please ignore this message.
Note that you will not be able to send further messages here after this post have been closed but you will be able to create new posts.
I have some issues when turning the app into an executable
not sure what you mean, you should just be able to make http requests?
unless if user is behind a proxy or something but that's kind of not your problem
also if you're asking about oauth with google then you should definitely use mongodb atlas free tier 😉
I will explain, the authentication used is by OAuth2.0 library, everything is working fine in intellij , like i click on the button to authenticate and then a web window appear where i authenticate using google then it redirects me inside the app
When i run the jar on the cmd it works (by adding javafx —add-modules etc..)
But when i turn the jar into an exe it doesn’t work
I think i am missing a step in the bundling process
how are you turning it into an exe
The error is about java.util.logging.logger
I tried a lot of things tbh, i even tried that launch4j
I tried jlink and jpackage as well
Same error , as i said i think im skipping something when packaging with maven
what's the error
I don’t remember exactly i ve been stuck for a week in this and as i said i tried a lot of things i half forgot what i ve done
But the project structure is non modular
And when i used launch4j (last thing that i tried)
The app launches but when i click to authenticate (means going to the internet) , the app crashes
So you think that jpackage/jlink is the solution for packaging a javafx app?
jpackage is the latest so probably most supportable etc
but if you can share the error it would be more helpful
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
with jpackage or anything, the error is still the same
What's the error
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
and when i follow the stacktrace
Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
i think that java.util.logging.Logger is the one that dont let my app redirect to the web (to authenticate with google)
Weird, that's part of the jdk
exactly
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.