File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes Autowiring Problem - NullPointerException. 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 "Autowiring Problem - NullPointerException." Watch "Autowiring Problem - NullPointerException." New topic

Autowiring Problem - NullPointerException.

Craig Worsell

Joined: Sep 22, 2011
Posts: 13

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



Thanks in advance.

Craig Worsell

Joined: Sep 22, 2011
Posts: 13

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.

With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Autowiring Problem - NullPointerException.
Similar Threads
javax.servlet.ServletException: No adapter for handler
javax.servlet.ServletException: Could not resolve view with name home-- apache Velocity, spring
No mapping found for HTTP request with URI [/springmvc/] in DispatcherServlet
STS springMVC project how to run on tomcat application