File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Autowiring Problem - NullPointerException.

 
Craig Worsell
Greenhorn
Posts: 14
Java MySQL Database Notepad
  • 0
  • Mark post as helpful
  • send pies
  • 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
Java MySQL Database Notepad
  • 0
  • Mark post as helpful
  • send pies
  • 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.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic