Error in filter sitemesh only in war or run-war

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

Error in filter sitemesh only in war or run-war

Werther
Hello,
I´m having a problem with my application when I try to deploy a generated war or run the "run-war" command from grails. When I use run command, the application runs without problems.
I´m using grails 2.2.4 and have lots of plugins in this app. I recently upgraded this app from 1.3.7 but last week I was able to create war files without a problem. I use IntelliJ Idea 13, but I try both in Idea and in command prompt.

The error in tomcat (run-war or war deployed in tomcat 7 or 6) is:

28/02/2014 14:03:40 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
28/02/2014 14:03:40 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Tomcat
28/02/2014 14:03:40 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.42
28/02/2014 14:03:41 org.apache.catalina.startup.ContextConfig getDefaultWebXmlFragment
INFO: No global web.xml found
28/02/2014 14:04:08 org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
28/02/2014 14:04:10 org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring root WebApplicationContext
28/02/2014 14:05:47 org.apache.catalina.core.StandardContext filterStart
GRAVE: Exception starting filter sitemesh
java.lang.IllegalStateException: Cannot load excludes configuration file "/WEB-INF/decorators.xml" as specified in "sitemesh.xml" or "sitemesh-default.xml"
        at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadExcludes(Grails5535Factory.java:172)
        at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:105)
        at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.<init>(Grails5535Factory.java:66)
        at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:84)
        at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:281)
        at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:262)
        at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:107)
        at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4775)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5452)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
        at java.lang.Thread.run(Thread.java:662)
28/02/2014 14:05:47 org.apache.catalina.core.StandardContext startInternal
GRAVE: Error filterStart

I try to find any relation to sitemesh.xml and decorators.xml and cannto see anything.

Any help or directions is highly appreciated.

Regards,

Werther
Reply | Threaded
Open this post in threaded view
|

Re: Error in filter sitemesh only in war or run-war

Werther
OK, I found a solution but I don´t know why this is happening. I found that the file sitemesh.xml was not in the war file, but it is in the WEB-INF folder of my project. I put a code in BuildConfig.groovy to copy the file when grails is generating the war file (the file applicationContext.xml was not being copied either):

grails.war.copyToWebApp = {args->
    fileset(dir:"web-app") {
        include(name: "WEB-INF/applicationContext.xml")
        include(name: "WEB-INF/sitemesh.xml")
    }
}

I create a totaly new project in 2.2.4 and the problem is not ocurring. Is this something I did wrong in my migration form 1.3.7?

It´s working now, but I´m trying to understand why the war generation is not copying these files in this particular project.

Regards,

Werther