我正在尝试将我的 Grails 2.1.1 应用程序部署到 cloudfoundry.com。在我的本地计算机上,应用程序运行没有问题。从 BuildConfig.groovy 中删除 Quartz 插件依赖项时,我能够成功启动 cloudfoundry 上的应用程序。
依赖:
compile ":quartz:1.0-RC5"
grails cf-logs 打印以下错误:
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
下面看我的工作:
package de.tum.wi.fm.game
import org.quartz.JobExecutionContext
class StartGameJob {
def execute(JobExecutionContext context) {
def gameRoundId = context.mergedJobDataMap.get('gameRoundId')
if(gameRoundId) {
GameRound gameRound = GameRound.get(gameRoundId)
if(gameRound) {
Game game = gameRound?.game
game.currentGameRound = gameRound
game.save(flush: true)
}
}
}
}
触发器放置在服务中:
def jobParams = [gameRoundId:gameRound.id]
Date gameRoundEndDate = gameRound.endDate.toDate()
ChangeRoundJob.schedule(gameRoundEndDate, jobParams)