#using Mongodb in Java Desktop Application

56 messages · Page 1 of 1 (latest)

haughty pumice
#

Can i find someone who has implemented mongodb in their java desktop app? like retrieving data from a mongo database for app to use it, i have some questions ?

stable irisBOT
#

This post has been reserved for your question.

Hey @haughty pumice! Please use /close or the Close Post button 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.

haughty pumice
merry river
#

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")

haughty pumice
merry river
#

right

haughty pumice
#

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

haughty pumice
merry river
#

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^ ?

haughty pumice
#

Does it require internet connection for the users who install my app?

merry river
#

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

haughty pumice
merry river
haughty pumice
stable irisBOT
haughty pumice
#

I have some issues when turning the app into an executable

merry river
#

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 😉

haughty pumice
merry river
#

right...

#

and when bundled as a jar it doesn't do that?

haughty pumice
#

But when i turn the jar into an exe it doesn’t work

#

I think i am missing a step in the bundling process

merry river
#

how are you turning it into an exe

haughty pumice
#

The error is about java.util.logging.logger

haughty pumice
#

I tried jlink and jpackage as well

merry river
#

oh you did try jpackage

#

what happens with jpackage

haughty pumice
#

Same error , as i said i think im skipping something when packaging with maven

merry river
#

what's the error

haughty pumice
#

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?

merry river
#

jpackage is the latest so probably most supportable etc

#

but if you can share the error it would be more helpful

stable irisBOT
#

💤 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.

haughty pumice
merry river
#

What's the error

haughty pumice
#

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)

merry river
#

Weird, that's part of the jdk

haughty pumice
stable irisBOT
#

💤 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.