• Post Reply Bookmark Topic Watch Topic
  • New Topic

ClassPathXmlApplicationContext and configuration file

 
Alex Armenteros
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Normally when using XML Beans I use this



But now I need to use Spring Scheduling and I need an ApplicationContext


And it seems the properties are black as this exception appears loading the Hibernate SessionFactory

org.hibernate.HibernateException: 'hibernate.dialect' must be set when no Connection available

Any error on that code snippet?


 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, as the exception says there is something wrong with either the hibernate dialect or the connection to database. You will need to look at how your data source is setup
 
Alex Armenteros
Ranch Hand
Posts: 75
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think I solved it

I must not call applicationContext.refresh() before adding the configurer so this must be done:

 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36032
432
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution
 
Gravity is a harsh mistress. But this tiny ad is pretty easy to deal with:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!