Quartz Plugin

Controllers are not Autowired into Quartz Job

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Won't Fix
  • Affects Version/s: 0.2
  • Fix Version/s: 0.3
  • Component/s: None
  • Labels:
    None
  • Environment:
    Grails 1.0 RC2 Grails Quartz 0.2 Windows Java 1.5

Description

I have attached a zip file that reproduces the problem take a look at the simple job.

UserController is always null.

Activity

Hide
Wolfgang Schell added a comment -

I Think this issue is not valid:

A controller is not a singleton like a service or filter class! For each request a new controller is created. So there is no controller to be autowired into the job. If you need a specific controller object, simply create one.

When creating a controller, I think you should be using applicationContext.getBean("MyController') as otherwise the controller dependencies won't be set... (might be application instead of applicationcontext)

Show
Wolfgang Schell added a comment - I Think this issue is not valid: A controller is not a singleton like a service or filter class! For each request a new controller is created. So there is no controller to be autowired into the job. If you need a specific controller object, simply create one. When creating a controller, I think you should be using applicationContext.getBean("MyController') as otherwise the controller dependencies won't be set... (might be application instead of applicationcontext)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: