11
votes

I have a Grails 2.4.5 GSP page which loads two iFrame:

<iframe scrolling="no"
            src="${createLink(controller:'admin', action:'page1', id: serviceCard.id)}"></iframe>
<iframe scrolling="no"
            src="${createLink(controller:'admin', action:'page2', id: serviceCard.id)}"></iframe>

After every second reload or so I have the following problem. Note that this does not occur all the time.

On my GSP I see Error 500. The console shows the following error:

2015-08-01 21:41:11,530 [http-nio-8080-exec-3] ERROR errors.GrailsExceptionResolver  - ConcurrentModificationException occurred when processing request: [GET] /test/adminServiceCard/previewCard/4b6dc4730fd3acd80a
Stacktrace follows:
Message: Error processing GroovyPageView: Error executing tag <asset:stylesheet>: null
    Line | Method
->>  527 | doFilter         in /grails-app/views/adminServiceCard/previewCard.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Caused by GrailsTagException: Error executing tag <asset:stylesheet>: null
->>    6 | doCall           in /grails-app/views/adminServiceCard/previewCard.gsp
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Caused by ConcurrentModificationException: null
->> 1456 | sort             in java.util.ArrayList
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
|    175 | sort             in java.util.Collections
|    145 | fileNameWithoutExtensionFromArtefact in asset.pipeline.AssetHelper
|     99 | loadRequiresForTree in asset.pipeline.DirectiveProcessor
|     76 | getFlattenedRequireList in     ''
|     83 | getDependencyList in asset.pipeline.AssetPipeline
|     79 | doCall . . . . . in asset.pipeline.grails.AssetsTagLib$_closure2
|      6 | doCall           in Users_mg_Documents_Grails_GGTS3_6_3_test_grails_app_views_adminServiceCard_previewCard_gsp$_run_closure1
|     10 | run . . . . . .  in Users_mg_Documents_Grails_GGTS3_6_3_test_grails_app_views_adminServiceCard_previewCard_gsp
|    198 | doFilter         in grails.plugin.cache.web.filter.PageFragmentCachingFilter
|     63 | doFilter . . . . in grails.plugin.cache.web.filter.AbstractFilter
|     53 | doFilter         in grails.plugin.springsecurity.web.filter.GrailsAnonymousAuthenticationFilter
|     62 | doFilter . . . . in grails.plugin.springsecurity.web.authentication.logout.MutableLogoutFilter
|     46 | doFilterInternal in org.grails.jaxrs.web.JaxrsFilter
|   1142 | runWorker . . .  in java.util.concurrent.ThreadPoolExecutor
|    617 | run              in java.util.concurrent.ThreadPoolExecutor$Worker
^    745 | run . . . . . .  in java.lang.Thread

Edit: Here is the content of adminServiceCardpreview_gsp.groovy.gsp:

import org.codehaus.groovy.grails.plugins.metadata.GrailsPlugin
import org.codehaus.groovy.grails.web.pages.GroovyPage
import org.codehaus.groovy.grails.web.taglib.*
import org.codehaus.groovy.grails.web.taglib.exceptions.GrailsTagException
import org.springframework.web.util.*
import grails.util.GrailsUtil

class gsp_majestella_adminServiceCardpreview_gsp extends GroovyPage {
public String getGroovyPageFileName() { "/WEB-INF/grails-app/views/adminServiceCard/preview.gsp" }
public Object run() {
Writer out = getOut()
Writer expressionOut = getExpressionOut()
registerSitemeshPreprocessMode()
printHtmlPart(0)
createTagBody(1, {->
printHtmlPart(1)
invokeTag('javascript','g',5,['library':("jquery"),'plugin':("jquery")],-1)
printHtmlPart(1)
invokeTag('stylesheet','asset',7,['src':("perfect-scrollbar/perfect-scrollbar.min.css")],-1)
printHtmlPart(2)
invokeTag('javascript','asset',8,['src':("perfect-scrollbar/perfect-scrollbar.jquery.min.js")],-1)
printHtmlPart(2)
invokeTag('javascript','asset',9,['src':("jquery.cycle.all.js")],-1)
printHtmlPart(1)
invokeTag('stylesheet','asset',11,['src':("preview.css")],-1)
printHtmlPart(3)
})
invokeTag('captureHead','sitemesh',13,[:],1)
printHtmlPart(4)
createTagBody(1, {->
printHtmlPart(5)
if(true && (showCard == true)) {
printHtmlPart(6)
if(true && (serviceCard.imageItems)) {
printHtmlPart(7)
expressionOut.print(createLink(controller:'image', action:'getImage', id:serviceCard.imageItems[0].id, absolute:true))
printHtmlPart(8)
}
printHtmlPart(9)
expressionOut.print(serviceCard?.title)
printHtmlPart(10)
expressionOut.print(serviceCard?.company?.name)
printHtmlPart(11)
}
printHtmlPart(12)
if(true && (showDetail == true)) {
printHtmlPart(13)
loop:{
int i = 0
for( imageItem in (serviceCard.imageItems) ) {
printHtmlPart(14)
expressionOut.print(createLink(controller:'image', action:'getImage', id:imageItem.id, absolute:true))
printHtmlPart(15)
i++
}
}
printHtmlPart(16)
expressionOut.print(raw(serviceCard.description))
printHtmlPart(17)
}
printHtmlPart(18)
})
invokeTag('captureBody','sitemesh',116,[:],1)
printHtmlPart(19)
}
public static final Map JSP_TAGS = new HashMap()
protected void init() {
    this.jspTags = JSP_TAGS
}
public static final String CONTENT_TYPE = 'text/html;charset=UTF-8'
public static final long LAST_MODIFIED = 1438521220000L
public static final String EXPRESSION_CODEC = 'html'
public static final String STATIC_CODEC = 'none'
public static final String OUT_CODEC = 'none'
public static final String TAGLIB_CODEC = 'none'
}

How can I solve this problem?

1
The stacktrace points to the view adminServiceCard/previewCard.gsp. What's in that file?Emmanuel Rosa
@EmmanuelRosa I updated my post with the file.confile
Oops, although that may help, I asked for the wrong file. GSP pages are trans-compiled into Groovy code. That's the file that's going to match up with the stacktrace line numbers. The file should be something like target/work/gspcompile/gsp_SOMETHING_adminServiceCardpreviewCard_gsp.groovy. If the file is not there try running grails compile ---gspEmmanuel Rosa
Yes the files was not there. the gspcompile folder was not there.confile
@EmmanuelRosa I posted the compiled file. Hope that helps.confile

1 Answers

0
votes

This error looks a lot like this one from asset pipeline.

You should remove all //=require in previewCard.gsp and then work through which is causing the error.