wood burning stoves 2.0*
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 Murach's Java Servlets and JSP this week in the Servlets forum!
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: 69
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: 2271
    
  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: 69
I think I solved it

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

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30075
    
149

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