I am migrating grails-2.4.0 from 2.3.2 and jdk-1.8 from 1.7.
I am using this article for migration.
BuildConfig.groovy
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes e.g.
runtime 'org.springframework:spring-test:3.1.0.RELEASE'
}
plugins {
// plugins for the build system only
build ":tomcat:7.0.52.1"
// Default plugins for the compile step
compile ":scaffolding:2.1.0"
compile ':cache:1.1.3'
// Persistency plugins
runtime ":hibernate:3.6.10.14"
// Styling plugins
runtime ':twitter-bootstrap:3.3.4'
runtime ":resources:1.2.14"
runtime ":jquery:1.11.0.2"
// PDF rendering plugins
compile ":rendering:1.0.0"
// Spring security plugins
compile ":spring-security-core:2.0-RC5"
// Uncomment these (or add new ones) to enable additional resources capabilities
runtime ":zipped-resources:1.0.1"
runtime ":cached-resources:1.1"
compile ":cache-headers:1.1.7"
}
Removed grailsResourceLoader
from applicationContext.xml
Removed sitemesh filter details from web.xml
When I run the application using grails run-app it is working fine. But when I use update,Sort etc at that time below errors are occur.
Stacktrace
ERROR org.codehaus.groovy.grails.web.errors.GrailsExceptionResolver - NullPointerException occurred when processing request: [GET] /wba-web/airline/index - parameters:
mode:
modeId:
Stacktrace follows:
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag <sitemesh:captureContent>: Error executing tag <g:render>: null
at grails.plugin.cache.web.filter.PageFragmentCachingFilter.doFilter(PageFragmentCachingFilter.java:189)
at grails.plugin.cache.web.filter.AbstractFilter.doFilter(AbstractFilter.java:63)
at grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter.doFilter(GrailsAnonymousAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.RequestHolderAuthenticationFilter.doFilter(RequestHolderAuthenticationFilter.java:53)
at grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter.doFilter(MutableLogoutFilter.java:62)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <sitemesh:captureContent>: Error executing tag <g:render>: null
at airline_index$_run_closure10.doCall(index:26)
at airline_index.run(index:57)
... 8 more
Caused by: org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException: Error executing tag <g:render>: null
at airline_index$_run_closure10_closure16.doCall(index:25)
... 10 more
Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
at grails.util.CacheEntry.getValue(CacheEntry.java:141)
at grails.util.CacheEntry.getValue(CacheEntry.java:81)
... 11 more
Does I miss something to upgrade? or this is bug in my code?
Quick help will highly appreciate.!!!
Please find log here log.txt.
3
Answers
Actually this was the error regarding filter. Every time filter block my request. I made some changes in my custom filter and it works.!
Based on the stacktrace the error is you are passing null value to the render function, when you are hitting /wba-web/airline/index. please copy the full stacktrace for more information.
The latest version of Java have issues with Grails. However 1.8.0_25, 1.8.0_31 versions support 2.4.0. Those above 1.8.0_40 might have issues.