• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can Java Fx/hibernate use application.propperties? (Props with hibernate config)  RSS feed

 
Daniel Demesmaecker
Ranch Hand
Posts: 44
1
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

0
down vote
favorite
I'm trying to build my first javaFX application, but I have some difficulties writig the hibernate configuration. Can I use a application.propperties in java FX or is this only for spring? I included my hibernateconfigurationfile and the code for building my connection.

hibernate.cfg.xml:



Invocation:



StackTrace:


If there isn't a way to use a application.propperties in FX, could anyone point me in the direction of wat is wrong with my configuration?
And yes, I know you can use javaFx in spring, but don't want to start over again.
Sorry for my crappy English, but I'm not native.
Thanks in advance.
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also posted here: https://stackoverflow.com/questions/46862898/can-java-fx-hibernate-use-application-propperties-props-with-hibernate-config

Daniel: It's permitted in CodeRanch to cross-post (post the same question in two places), but we ask that you state you have done this.  That way we at CodeRanch don't waste our time posting something that's already been posted at StackOverflow.
 
Daniel Demesmaecker
Ranch Hand
Posts: 44
1
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And how do I edit my original post, so I can do so?
The question on stackoverflow is also posted by me.
The reason i posted on 2 forums is on stackoverflow, your question easily get's lost in all the other posts.
My appoligies, next time I will mention that I already posted somewhere else
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The stack trace seems to say that you're having trouble loading the FXML file.  What makes you think this is a Hibernate problem?
 
Daniel Demesmaecker
Ranch Hand
Posts: 44
1
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cause if I commit  the invocation out everything works
 
Daniel Demesmaecker
Ranch Hand
Posts: 44
1
Java MySQL Database Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I ment comment, not commit
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know this can be done.  Googling JavaFX and Hibernate produces several tutorials. 

I am a great believer in creating very stripped-down programs that isolate the processes you want to test.  I would create a little JavaFX program with just a scene and try to connect to Hibernate.  Then try a program that only loads and displays your FXML resource.  Then put the two together.
 
Daniel Demesmaecker
Ranch Hand
Posts: 44
1
Java MySQL Database Spring
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I rebuilded my program using Spring Boot and configured it to use FXML, that seems to work, so... Woehoe
 
Knute Snortum
Sheriff
Posts: 4287
127
Chrome Eclipse IDE Java Postgres Database VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Glad you got it working!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!