aspose file tools
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

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

Joined: Jan 17, 2008
Posts: 2553

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

Joined: May 26, 2003
Posts: 31634

Thanks for posting the solution

[OCA 8 book] [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:
subject: ClassPathXmlApplicationContext and configuration file