File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 72
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: 2278

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: 72
I think I solved it

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

Jeanne Boyarsky
internet detective

Joined: May 26, 2003
Posts: 30138

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:
subject: ClassPathXmlApplicationContext and configuration file
Similar Threads
Strange Spring problem
Http Status 404 - Servlet DataAccessServlet is currently unavailable
Spring and command line arguments
what is diff in Spring's ClassPathResource and FileSystemResource class
spring context loader