Meaningless Drivel is fun!*
The moose likes Spring and the fly likes ClassPathXmlApplicationContext and configuration file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "ClassPathXmlApplicationContext and configuration file" Watch "ClassPathXmlApplicationContext and configuration file" New topic
Author

ClassPathXmlApplicationContext and configuration file

Alex Armenteros
Ranch Hand

Joined: May 05, 2010
Posts: 73
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
Bartender

Joined: Jan 17, 2008
Posts: 2448
    
  28

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

Joined: May 05, 2010
Posts: 73
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

Joined: May 26, 2003
Posts: 31079
    
163

Thanks for posting the solution


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassPathXmlApplicationContext and configuration file