javax.servlet.ServletException:过滤器[sitemesh]:在将Grails 2.11 app部署到WebSphere 8.5自由配置文件时无法初始化?

时间:2012-10-19 15:15:27

标签: grails websphere websphere-liberty

当我尝试将我的grails应用程序部署到WebSphere 8.5 liberty配置文件服务器时,我收到以下错误消息。

Error Message: javax.servlet.ServletException: Filter [sitemesh]: could not be initialized

我为我的应用程序设置了父类最后一个类加载策略。相同的war文件部署到位于同一服务器上的tomcat没有问题。任何可能导致这种情况以及如何解决这个问题的想法?我已经粘贴了下面的完整堆栈跟踪。

Error Page Exception
SRVE0260E: The server cannot use the error page specified for your application to handle the Original Exception printed below.


Original Exception: 
Error Message: javax.servlet.ServletException: Filter [sitemesh]: could not be initialized
Error Code: 500
Target Servlet: com.ibm.ws.webcontainer.extension.DefaultExtensionProcessor
Error Stack: 
com.opensymphony.module.sitemesh.factory.FactoryException: Could not initialize DecoratorMapper : org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined 
     at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:117) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.(Grails5535Factory.java:66) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83) 
     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:579) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:480) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:299) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:372) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:903) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1036) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4173) 
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:302) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.handleRequest(DynamicVirtualHost.java:296) 
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1006) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$1.run(DynamicVirtualHost.java:253) 
     at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:457) 
     at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398) 
     at com.ibm.ws.threading.internal.Worker.run(Worker.java:380) 
     at java.lang.Thread.run(Thread.java:722) 
     Root cause: 
     org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:553) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) 
     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1102) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper.init(GrailsLayoutDecoratorMapper.java:48) 
     at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:110) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.(Grails5535Factory.java:66) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83) 
     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:579) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:480) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:299) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:372) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:903) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1036) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4173) 
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:302) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.handleRequest(DynamicVirtualHost.java:296) 
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1006) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$1.run(DynamicVirtualHost.java:253) 
     at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:457) 
     at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398) 
     at com.ibm.ws.threading.internal.Worker.run(Worker.java:380) 
     at java.lang.Thread.run(Thread.java:722) 




Error Page Exception: 
Error Message: javax.servlet.ServletException: Filter [sitemesh]: could not be initialized
Error Code: 0
Target Servlet: 
Error Stack: 
com.opensymphony.module.sitemesh.factory.FactoryException: Could not initialize DecoratorMapper : org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined 
     at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:117) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.(Grails5535Factory.java:66) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83) 
     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:579) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:480) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:299) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:372) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:906) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1036) 
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1383) 
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:191) 
     at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:3650) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleException(WebApp.java:4203) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4184) 
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:302) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.handleRequest(DynamicVirtualHost.java:296) 
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1006) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$1.run(DynamicVirtualHost.java:253) 
     at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:457) 
     at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398) 
     at com.ibm.ws.threading.internal.Worker.run(Worker.java:380) 
     at java.lang.Thread.run(Thread.java:722) 
     Root cause: 
     org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'groovyPageLayoutFinder' is defined 
     at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:553) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1095) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:277) 
     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) 
     at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1102) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsLayoutDecoratorMapper.init(GrailsLayoutDecoratorMapper.java:48) 
     at com.opensymphony.module.sitemesh.factory.BaseFactory.pushDecoratorMapper(BaseFactory.java:110) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadDecoratorMappers(Grails5535Factory.java:231) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.loadConfig(Grails5535Factory.java:98) 
     at org.codehaus.groovy.grails.web.sitemesh.Grails5535Factory.(Grails5535Factory.java:66) 
     at org.codehaus.groovy.grails.web.sitemesh.GrailsPageFilter.init(GrailsPageFilter.java:83) 
     at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.init(FilterInstanceWrapper.java:142) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager._loadFilter(WebAppFilterManager.java:579) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.loadFilter(WebAppFilterManager.java:480) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterInstanceWrapper(WebAppFilterManager.java:299) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.getFilterChain(WebAppFilterManager.java:372) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:906) 
     at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1036) 
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java:1383) 
     at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:191) 
     at com.ibm.ws.webcontainer.webapp.WebApp.sendError(WebApp.java:3650) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleException(WebApp.java:4203) 
     at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:4184) 
     at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:302) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost.handleRequest(DynamicVirtualHost.java:296) 
     at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:1006) 
     at com.ibm.ws.webcontainer.osgi.DynamicVirtualHost$1.run(DynamicVirtualHost.java:253) 
     at com.ibm.ws.http.dispatcher.internal.channel.HttpDispatcherLink$TaskWrapper.run(HttpDispatcherLink.java:457) 
     at com.ibm.ws.threading.internal.Worker.executeWork(Worker.java:398) 
     at com.ibm.ws.threading.internal.Worker.run(Worker.java:380) 
     at java.lang.Thread.run(Thread.java:722) 

1 个答案:

答案 0 :(得分:1)

WebSphere 8.5 Liberty Profile在部署时不会扩展WAR,并且令人惊讶的是,相当多的Web应用程序在很大程度上依赖于该功能。这就是导致你的情况。

我很确定您将Grails Web应用程序部署为WAR。

解决方案非常简单 - 部署扩展的Web应用程序,问题就消失了。

为了证明我的想法,我从2.3 Creating an Application运行了样本。当我部署它时,您遇到的错误消息确实显示在浏览器和日志中。

jacek:~/sandbox/helloworld
$ cp target/helloworld-0.1.war ~/apps/wlp/usr/servers/libertyGrails/dropins/

你忽略的是当它询问网络存档是否扩展时,日志中的行。

  

引起:java.io.FileNotFoundException:ServletContext资源   [/WEB-INF/grails-app/i18n/messages.properties]无法解析为   绝对文件路径 - Web应用程序存档未扩展? ...... 20   更

我重新部署了网络应用程序(之后仅rm unzip -d),欢迎页面显示正确。

jacek:~/sandbox/helloworld
$ rm ~/apps/wlp/usr/servers/libertyGrails/dropins/helloworld-0.1.war
jacek:~/sandbox/helloworld
$ unzip -d ~/apps/wlp/usr/servers/libertyGrails/dropins/helloworld-0.1.war target/helloworld-0.1.war
jacek:~/sandbox/helloworld
$ open http://localhost:9080/helloworld-0.1