JoaoGFarias / agiletrackingtool

Automatically exported from code.google.com/p/agiletrackingtool
0 stars 0 forks source link

Quartz configuation plugin workaround #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When running the application compile errors 

Known issue in grails bug tracking system. Hopefully this will be solved in
1.2 grails release.

In directory
$HOME/.grails/1.1.1/projects/agiletrackingtool/plugins/quartz-0.4.1-SNAPSHOT/gra
ils-app/conf
adjust files as shown below.

(Note: The files are also stored in trunk/quartzworkaround so you can copy
them.)

QuartzBootStrap.groovy:
/*
 * Copyright 2004-2005 the original author or authors.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

import org.codehaus.groovy.grails.commons.ApplicationAttributes
import org.codehaus.groovy.grails.commons.ConfigurationHolder

/**
 * Bootstrap class which turns on scheduler if autoStartup config parameter
is set to true.
 *
 * @author Sergey Nebolsin
 *
 * @since 0.3
 */
class QuartzBootStrap {
    def init = {servletContext ->
        def ctx =
servletContext.getAttribute(ApplicationAttributes.APPLICATION_CONTEXT)
        if(ConfigurationHolder.config?.quartz?.autoStartup)
ctx.quartzScheduler.start()
    }
    def destroy = {}
}

DefaultQuartzConfig.groovy:

//quartz {
//    autoStartup = true
//    jdbcStore = false
//}

import grails.util.Environment
quartz {
    if (Environment.current != Environment.TEST) { autoStartup = true }
else { autoStartup = false }
    jdbcStore = false
}

Original issue reported on code.google.com by ben.schreur@gmail.com on 30 Oct 2009 at 7:44

GoogleCodeExporter commented 9 years ago
Issue within QuartzConfig plugin already reported. See
http://jira.codehaus.org/browse/GRAILSPLUGINS-1159 for details.

Original comment by ben.schreur@gmail.com on 30 Oct 2009 at 7:50

GoogleCodeExporter commented 9 years ago

Original comment by ben.schreur@gmail.com on 1 Nov 2009 at 2:28

GoogleCodeExporter commented 9 years ago
Note: workaround not longer needed on quartz 0.4.1 release.

Original comment by ben.schreur@gmail.com on 7 Nov 2009 at 10:12