I have created a grails project using grails version 6.2.3. After this this added the quartz job dependencies and then create the class for schedule job. Command : grails create-app testApp grails create-job runjob
in the create class added the "println" line to print the date. verified the working using "grails run-app", it is printing the output on console Executing RunJob at Tue Feb 18 12:12:45 EST 2025
now used the "grails war" to generate the war file. When I deploy the war file on tomcat 11 job is not starting. Possibly it is not running because of javax is changed to jakarta in tomcat 11. I tried different combination of dependencies to change the javax to jakarta in build.gradle but none worked. What changes i need to make in my project to build a war file which will work in tomcat 11.
build.gradle
buildscript {
repositories {
maven { url "/" }
maven { url "; }
}
dependencies {
classpath ".grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "gradle.plugin.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.6"
classpath ".grails.plugins:hibernate5:7.3.0"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.7"
}
}
version "0.1"
group "jobapp"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:".grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:".grails.grails-gsp"
apply plugin:"com.bertramlabs.asset-pipeline"
repositories {
mavenCentral()
maven { url "; }
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly(".springframework.boot:spring-boot-devtools")
compileOnly "io.micronaut:micronaut-inject-groovy"
console ".grails:grails-console"
implementation ".springframework.boot:spring-boot-starter-logging"
implementation ".springframework.boot:spring-boot-starter-validation"
implementation ".springframework.boot:spring-boot-autoconfigure"
implementation ".grails:grails-core"
implementation ".springframework.boot:spring-boot-starter-actuator"
implementation ".springframework.boot:spring-boot-starter-tomcat"
implementation ".grails:grails-web-boot"
implementation ".grails:grails-logging"
implementation ".grails:grails-plugin-rest"
implementation ".grails:grails-plugin-databinding"
implementation ".grails:grails-plugin-i18n"
implementation ".grails:grails-plugin-services"
implementation ".grails:grails-plugin-url-mappings"
implementation ".grails:grails-plugin-interceptors"
implementation ".grails.plugins:cache"
implementation ".grails.plugins:async"
implementation ".grails.plugins:scaffolding"
implementation ".grails.plugins:hibernate5"
implementation ".hibernate:hibernate-core:5.6.11.Final"
implementation ".grails.plugins:events"
implementation ".grails.plugins:gsp"
implementation '.grails.plugins:quartz:3.0.0'
implementation ".quartz-scheduler:quartz:2.5.0"
implementation 'com.mysql:mysql-connector-j:9.2.0'
profile ".grails.profiles:web"
runtimeOnly ".glassfish.web:el-impl:2.2.1-b05"
runtimeOnly "com.h2database:h2"
runtimeOnly ".apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.4.7"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation ".grails:grails-gorm-testing-support"
testImplementation ".mockito:mockito-core"
testImplementation ".grails:grails-web-testing-support"
testImplementation ".grails.plugins:geb"
testImplementation ".seleniumhq.selenium:selenium-remote-driver:4.0.0"
testImplementation ".seleniumhq.selenium:selenium-api:4.0.0"
testImplementation ".seleniumhq.selenium:selenium-support:4.0.0"
testRuntimeOnly ".seleniumhq.selenium:selenium-chrome-driver:4.0.0"
testRuntimeOnly ".seleniumhq.selenium:selenium-firefox-driver:4.0.0"
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
webdriverBinaries {
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
chromedriver {
version = '2.45.0'
fallbackTo32Bit = true
}
geckodriver '0.30.0'
}
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}
assets {
minifyJs = true
minifyCss = true
}
gradle.properties
grailsVersion=6.2.3
grailsGradlePluginVersion=6.2.4
groovyVersion=3.0.23
gorm.version=8.1.2
.gradle.daemon=true
.gradle.parallel=true
.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
To fix the issue, I changed the dependencies of javax to jakarta, updated all other dependency to latest including spring, i expect it to work but not worked, when deployed, job is not getting started.
Second, I tried tomcat 10. inside to it create a webapps-javaee folder and paste the war file there to upgrade the dependency, in this job is not getting register and giving exception.
Caused by: java.lang.IllegalArgumentException: GrailsVersion snapshot is not in the expected format
at .grails.datastore.mapping.core.grailsversion.Snapshot.<init>(Snapshot.groovy:49)
I have created a grails project using grails version 6.2.3. After this this added the quartz job dependencies and then create the class for schedule job. Command : grails create-app testApp grails create-job runjob
in the create class added the "println" line to print the date. verified the working using "grails run-app", it is printing the output on console Executing RunJob at Tue Feb 18 12:12:45 EST 2025
now used the "grails war" to generate the war file. When I deploy the war file on tomcat 11 job is not starting. Possibly it is not running because of javax is changed to jakarta in tomcat 11. I tried different combination of dependencies to change the javax to jakarta in build.gradle but none worked. What changes i need to make in my project to build a war file which will work in tomcat 11.
build.gradle
buildscript {
repositories {
maven { url "https://plugins.gradle./m2/" }
maven { url "https://repo.grails./grails/core" }
}
dependencies {
classpath ".grails:grails-gradle-plugin:$grailsGradlePluginVersion"
classpath "gradle.plugin.github.erdi.webdriver-binaries:webdriver-binaries-gradle-plugin:2.6"
classpath ".grails.plugins:hibernate5:7.3.0"
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:3.4.7"
}
}
version "0.1"
group "jobapp"
apply plugin:"eclipse"
apply plugin:"idea"
apply plugin:"war"
apply plugin:".grails.grails-web"
apply plugin:"com.github.erdi.webdriver-binaries"
apply plugin:".grails.grails-gsp"
apply plugin:"com.bertramlabs.asset-pipeline"
repositories {
mavenCentral()
maven { url "https://repo.grails./grails/core" }
}
configurations {
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
developmentOnly(".springframework.boot:spring-boot-devtools")
compileOnly "io.micronaut:micronaut-inject-groovy"
console ".grails:grails-console"
implementation ".springframework.boot:spring-boot-starter-logging"
implementation ".springframework.boot:spring-boot-starter-validation"
implementation ".springframework.boot:spring-boot-autoconfigure"
implementation ".grails:grails-core"
implementation ".springframework.boot:spring-boot-starter-actuator"
implementation ".springframework.boot:spring-boot-starter-tomcat"
implementation ".grails:grails-web-boot"
implementation ".grails:grails-logging"
implementation ".grails:grails-plugin-rest"
implementation ".grails:grails-plugin-databinding"
implementation ".grails:grails-plugin-i18n"
implementation ".grails:grails-plugin-services"
implementation ".grails:grails-plugin-url-mappings"
implementation ".grails:grails-plugin-interceptors"
implementation ".grails.plugins:cache"
implementation ".grails.plugins:async"
implementation ".grails.plugins:scaffolding"
implementation ".grails.plugins:hibernate5"
implementation ".hibernate:hibernate-core:5.6.11.Final"
implementation ".grails.plugins:events"
implementation ".grails.plugins:gsp"
implementation '.grails.plugins:quartz:3.0.0'
implementation ".quartz-scheduler:quartz:2.5.0"
implementation 'com.mysql:mysql-connector-j:9.2.0'
profile ".grails.profiles:web"
runtimeOnly ".glassfish.web:el-impl:2.2.1-b05"
runtimeOnly "com.h2database:h2"
runtimeOnly ".apache.tomcat:tomcat-jdbc"
runtimeOnly "javax.xml.bind:jaxb-api:2.3.1"
runtimeOnly "com.bertramlabs.plugins:asset-pipeline-grails:3.4.7"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation ".grails:grails-gorm-testing-support"
testImplementation ".mockito:mockito-core"
testImplementation ".grails:grails-web-testing-support"
testImplementation ".grails.plugins:geb"
testImplementation ".seleniumhq.selenium:selenium-remote-driver:4.0.0"
testImplementation ".seleniumhq.selenium:selenium-api:4.0.0"
testImplementation ".seleniumhq.selenium:selenium-support:4.0.0"
testRuntimeOnly ".seleniumhq.selenium:selenium-chrome-driver:4.0.0"
testRuntimeOnly ".seleniumhq.selenium:selenium-firefox-driver:4.0.0"
}
bootRun {
ignoreExitValue true
jvmArgs(
'-Dspring.output.ansi.enabled=always',
'-noverify',
'-XX:TieredStopAtLevel=1',
'-Xmx1024m')
sourceResources sourceSets.main
String springProfilesActive = 'spring.profiles.active'
systemProperty springProfilesActive, System.getProperty(springProfilesActive)
}
tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}
tasks.withType(Test) {
useJUnitPlatform()
}
webdriverBinaries {
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
chromedriver {
version = '2.45.0'
fallbackTo32Bit = true
}
geckodriver '0.30.0'
}
}
tasks.withType(Test) {
systemProperty "geb.env", System.getProperty('geb.env')
systemProperty "geb.build.reportsDir", reporting.file("geb/integrationTest")
if (!System.getenv().containsKey('GITHUB_ACTIONS')) {
systemProperty 'webdriver.chrome.driver', System.getProperty('webdriver.chrome.driver')
systemProperty 'webdriver.gecko.driver', System.getProperty('webdriver.gecko.driver')
} else {
systemProperty 'webdriver.chrome.driver', "${System.getenv('CHROMEWEBDRIVER')}/chromedriver"
systemProperty 'webdriver.gecko.driver', "${System.getenv('GECKOWEBDRIVER')}/geckodriver"
}
}
assets {
minifyJs = true
minifyCss = true
}
gradle.properties
grailsVersion=6.2.3
grailsGradlePluginVersion=6.2.4
groovyVersion=3.0.23
gorm.version=8.1.2
.gradle.daemon=true
.gradle.parallel=true
.gradle.jvmargs=-Dfile.encoding=UTF-8 -Xmx1024M
To fix the issue, I changed the dependencies of javax to jakarta, updated all other dependency to latest including spring, i expect it to work but not worked, when deployed, job is not getting started.
Second, I tried tomcat 10. inside to it create a webapps-javaee folder and paste the war file there to upgrade the dependency, in this job is not getting register and giving exception.
Caused by: java.lang.IllegalArgumentException: GrailsVersion snapshot is not in the expected format
at .grails.datastore.mapping.core.grailsversion.Snapshot.<init>(Snapshot.groovy:49)
Share
Improve this question
edited yesterday
Komal Prasad
asked yesterday
Komal PrasadKomal Prasad
1252 silver badges9 bronze badges
1 Answer
Reset to default 2Grails 6.2.3 is on Spring Boot 2.7.18 which supports a max tomcat version of 9.0.x.
https://mvnrepository/artifact/.springframework.boot/spring-boot-dependencies/2.7.18
Grails 7 will be on Spring Boot 3.4.x which supports Tomcat 10.1.x. https://grails./blog/2024-12-23-grails-7-m1.html
https://mvnrepository/artifact/.springframework.boot/spring-boot-dependencies/3.4.0
Grails 8 will likely be the first version to support Tomcat 11.