Grails

Job Template is still invalid?

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.3.1
  • Fix Version/s: 0.5-RC1
  • Component/s: None
  • Labels:
    None

Description

I had to make a couple additions to get Eclipse Groovy plugin to stop complaining, anyhow. Sorry, no diff/patch:

class @artifact.name@Job implements org.quartz.Job {
def timeout = 1000

def void execute(org.quartz.JobExecutionContext context) { // execute task }
}

Grails also doesn't seem to be injecting Services (per the sample in the doco) - I don't even know where to begin looking for that one.

Issue Links

Activity

Hide
Lance Lavandowska added a comment -

Here is the page with the sample I was referring to: http://grails.codehaus.org/Job+Scheduling+%28Quartz%29

Show
Lance Lavandowska added a comment - Here is the page with the sample I was referring to: http://grails.codehaus.org/Job+Scheduling+%28Quartz%29
Hide
Marcel Overdijk added a comment -

The timeout var was missing the surrounding double quotes (as noted in the userguide).

Changed:
def timeout = 1000
to:
def timeout = "1000"

Service was injected without a problem.

I used the following test service and job:

class MyService {

boolean transactional = true

def String sayHello(String name) {
return "hello ${name}"
}

}

class MyJob {
def timeout = "1000"

def MyService myService

def execute() { print "Job run!" print myService.sayHello("Marcel\n") }
}

Show
Marcel Overdijk added a comment - The timeout var was missing the surrounding double quotes (as noted in the userguide). Changed: def timeout = 1000 to: def timeout = "1000" Service was injected without a problem. I used the following test service and job: class MyService { boolean transactional = true def String sayHello(String name) { return "hello ${name}" } } class MyJob { def timeout = "1000" def MyService myService def execute() { print "Job run!" print myService.sayHello("Marcel\n") } }
Hide
Marcel Overdijk added a comment -

Timeout should be an integer as it is defined in the Job template now.
However when the timeout is defined as integer the exceution of the jobs fails.

Current workaround is to define the timeout as a String, then it works correctly.

But as discussed in http://www.nabble.com/bug-543-seems-to-have-come-back-tf3272894.html#a9170220 it needs (and makes sense) that the timeout should be an integer.

Note that also the user guide needs to be updated, because there the timeout is defined as String.

Show
Marcel Overdijk added a comment - Timeout should be an integer as it is defined in the Job template now. However when the timeout is defined as integer the exceution of the jobs fails. Current workaround is to define the timeout as a String, then it works correctly. But as discussed in http://www.nabble.com/bug-543-seems-to-have-come-back-tf3272894.html#a9170220 it needs (and makes sense) that the timeout should be an integer. Note that also the user guide needs to be updated, because there the timeout is defined as String.
Hide
Marcel Overdijk added a comment -

Refactored quartz plugin. Changed String properties to their equivalent types (long, boolean) in Spring API. Also upgraded to latest Quartz 1.6.0.

Show
Marcel Overdijk added a comment - Refactored quartz plugin. Changed String properties to their equivalent types (long, boolean) in Spring API. Also upgraded to latest Quartz 1.6.0.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: