-1

I am getting this error:

Feb 11, 2014 10:32:34 AM org.apache.catalina.core.ApplicationContext log
Information: ContextListener: contextInitialized()
Feb 11, 2014 10:32:34 AM org.apache.catalina.core.ApplicationContext log
Information: SessionListener: contextInitialized()
Feb 11, 2014 10:32:34 AM org.apache.catalina.core.ApplicationContext log
Information: ContextListener:     attributeAdded('org.apache.jasper.compiler.TldLocationsCache',     'org.apache.jasper.compiler.TldLocationsCache@6b2c636d')
Feb 11, 2014 10:43:04 AM org.apache.catalina.core.ApplicationContext log
Information: No Spring WebApplicationInitializer types detected on classpath
Feb 11, 2014 10:43:05 AM org.apache.catalina.core.ApplicationContext log
Information: Initializing Spring root WebApplicationContext
Feb 11, 2014 10:43:06 AM org.apache.catalina.core.StandardContext listenerStart
Schwerwiegend: Exception sending context initialized event to listener instance of class     org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'grailsApplication' defined in ServletContext resource [/WEB-INF/applicationContext.xml]:     Invocation of init method failed; nested exception is java.lang.VerifyError: (class: elektrova/UserController, method: $tt__index signature: (Ljava/lang/Integer;Lorg/springframework/transaction/TransactionStatus;)Ljava/lang/Object;) Stack size too large
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask.run(FutureTask.java:262)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.lang.VerifyError: (class: elektrova/UserController, method: $tt__index signature: (Ljava/lang/Integer;Lorg/springframework/transaction/TransactionStatus;)Ljava/lang/Object;)     Stack size too large
at java.lang.Class.forName(Class.java:270)
... 5 more

In this method:

def index(Integer max) {
    params.max = Math.min(max ?: 10, 100)

    if(!session.isAdmin){
        Hauler haul = Hauler.get(session.haulerID)
        println haul
        if(params.firstName)
            respond User.findAllWhere([hauler:haul,firstName:params.firstName]), model:[userInstanceCount: User.count()]
        else if(params.lastName)
            respond User.findAllWhere([hauler:haul,lastName:params.lastName]), model:[userInstanceCount: User.count()]
        else if(params.role)
            respond User.findAllWhere([hauler:haul,role:params.role]), model:[userInstanceCount: User.count()]
        else
            respond User.findAllByHauler(haul), model:[userInstanceCount: User.count()]
    }else{
        if(params.firstName){
            model:[userInstanceList: User.findAllByFirstName(params.firstName),userInstanceCount: User.count()]
        }else if(params.lastName)
        model:[userInstanceList: User.findAllByLastName(params.lastName),userInstanceCount: User.count()]
        else if(params.role)
        model:[userInstanceList: User.findAllByRole(params.role),userInstanceCount: User.count()]
        else
        model:[userInstanceList: User.list(params),userInstanceCount: User.count()]
    }
}

I found this thread, that solves the problem imho:

VerifyError: Stack size too large (what does it mean?)

but I don't quite get how to calculate and declare the stack size. And I don't understand either, why I have to declare it, since other methods don't need it. Thanks for any help!

Community
  • 1
  • 1
olkoza
  • 715
  • 2
  • 17
  • 35
  • Using Oracle's/Sun's JVM, you can set the per-thread stack size using `-Xss` (for instance `-Xss256k`). Don't know for groovy, but since it runs in a JVM... – fge Feb 11 '14 at 10:08
  • What version of grails? How are you running it? Is this when run as a war in tomcat? – tim_yates Feb 11 '14 at 10:34

1 Answers1

0

The problem disappeared without me changing anything, I have no idea why

olkoza
  • 715
  • 2
  • 17
  • 35