I am trying to deploy my Grails 2.1.1 application to cloudfoundry.com. On my local computer the application runs without problems. When removing the Quartz plugin dependency from the BuildConfig.groovy I’am able to start the application on cloudfoundry successfully.
Dependency:
compile ":quartz:1.0-RC5"
The grails cf-logs prints the following error:
Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: PermGen space
Below see my Job:
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)
}
}
}
}
The trigger is placed in a service:
def jobParams = [gameRoundId:gameRound.id]
Date gameRoundEndDate = gameRound.endDate.toDate()
ChangeRoundJob.schedule(gameRoundEndDate, jobParams)
The OutOfMemoryError exception determines that the JVM hasn’t enough memory assigned. You need to increase the memory of cloudfoundry instance and consequently increase memory of the JVM.
Try to execute following commands when deploying your application:
The first command will push (deploy) the application into the cloudfoundry instance and doesn’t start it.
The second will set JVM environment variables, sufficient memory settings.
Third command starts the application.