• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Autowiring Problem - NullPointerException.

 
Greenhorn
Posts: 14
MySQL Database Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have an Web MVC application that uses Hibernate to access a MySql db. I am using @Autowired to inject the Services into my classes. This works with my @Controller class, the services I require are available, however I have another class CustomerDownloader that is run via Quartz Scheduler which also requires the service but the service is not being injected, can anyone help?

CustomerDownloader (Service not injected)


IndexController (Service Injected)


Partial Root-Context.xml


Servlet-Context.xml


web.xml


Thanks in advance.

 
Craig Worsell
Greenhorn
Posts: 14
MySQL Database Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've resolved the problem, but just in case anyone else has this problem, I have added another entry key into my applicationContext-scheduler.xml file:



and then added:


into my job class.

Cheers.
 
reply
    Bookmark Topic Watch Topic
  • New Topic