Large delay when trying to access any class for the first time. Jar getting inflated to locate class for first time access in Grails 3.3.0.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view

Large delay when trying to access any class for the first time. Jar getting inflated to locate class for first time access in Grails 3.3.0.


I am using Grails 3.3.0. Whenever any controller (or any other class from subsequent invocation from other class) tries to refer or instantiate a class ( e.g. non Spring Bean class), there is large delay for the first time access only. I took thread dump & it seems that it is trying to inflate jars while loading the class definition.This leads to blocking to other threads & subsequently large delay in response time.

I am aware of a issue related to unpackWARs as false in tomcat But I am not sure whether this applies to GRAILS 3.3.0 as it uses Tomcat 8.5.15 by default. We are using war plugin in build.gradle.

We were not facing this issue when we were using Grails 3.0.11

Any help is much appreciated.

Here is the thread dump.

java.lang.Thread.State: RUNNABLE
    at Method)
    - locked <2e1d12d> (a
    at java.util.jar.JarInputStream.getNextEntry(
    at java.util.jar.JarInputStream.getNextJarEntry(
    at org.apache.catalina.webresources.JarWarResourceSet.getArchiveEntries(
    - locked <31fa9e2f> (a java.lang.Object)
    at org.apache.
    at org.apache.catalina.webresources.StandardRoot.getResourceInternal(
    at org.apache.catalina.webresources.Cache.getResource(
    at org.apache.catalina.webresources.StandardRoot.getResource(
    at org.apache.catalina.webresources.StandardRoot.getClassLoaderResource(
    at org.apache.catalina.loader.WebappClassLoaderBase.findClassInternal(
    at org.apache.catalina.loader.WebappClassLoaderBase.findClass(
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader.findClassIgnoringNotFound(
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader.doLoadClass(
    at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader.loadClass(
    - locked <309d49e4> (a org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedWebappClassLoader)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(
    at com.sun.beans.finder.ClassFinder.findClass(
    at com.sun.beans.finder.ClassFinder.findClass(
    at com.sun.beans.finder.InstanceFinder.instantiate(
    at com.sun.beans.finder.InstanceFinder.find(
    at java.beans.Introspector.findExplicitBeanInfo(
    at java.beans.Introspector.<init>(
    at java.beans.Introspector.getBeanInfo(
    at groovy.lang.MetaClassImpl$
    at Method)
    at groovy.lang.MetaClassImpl.addProperties(
    at groovy.lang.MetaClassImpl.initialize(
    - locked <d5813b0> (a groovy.lang.MetaClassImpl)
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClassUnderLock(
    at org.codehaus.groovy.reflection.ClassInfo.getMetaClass(
    at org.codehaus.groovy.runtime.callsite.ClassMetaClassGetPropertySite.<init>(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.createClassMetaClassGetPropertySite(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.createGetPropertySite(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.acceptGetProperty(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(

Reply | Threaded
Open this post in threaded view

Re: Large delay when trying to access any class for the first time. Jar getting inflated to locate class for first time access in Grails 3.3.0.

This post was updated on .
Thank u so much admin and sorry permission share in