• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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.
 
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic