Win a copy of The Java Performance Companion this week in the Performance forum!
  • 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: 2756
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
Marshal
Posts: 34672
367
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for posting the solution
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic