JSF捆绑加载失败

时间:2011-11-14 16:23:16

标签: java tomcat6 icefaces jsf-1.2

目前,我的JSF(1.2)应用程序在Servlet引擎(Tomcat 6.0.32)启动期间产生以下故障....

java.util.MissingResourceException: Can't find bundle for base name javax.faces.Messages, locale de
    java.util.ResourceBundle.throwMissingResourceException(Unknown Source)
    java.util.ResourceBundle.getBundleImpl(Unknown Source)
    java.util.ResourceBundle.getBundle(Unknown Source)
    com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:177)
    com.sun.faces.util.MessageFactory.getMessage(MessageFactory.java:136)
    com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:351)
    com.sun.faces.mgbean.BeanBuilder.newBeanInstance(BeanBuilder.java:187)
    com.sun.faces.mgbean.BeanBuilder.build(BeanBuilder.java:105)
    com.sun.faces.mgbean.BeanManager.createAndPush(BeanManager.java:368)
    com.sun.faces.mgbean.BeanManager.create(BeanManager.java:230)
    com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:86)
    javax.el.CompositeELResolver.getValue(CompositeELResolver.java:54)
    com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
    org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:69)
    org.apache.el.parser.AstValue.getValue(AstValue.java:112)
    org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186)
    com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:113)
    javax.faces.component.ValueExpressionValueBindingAdapter.getValue(ValueExpressionValueBindingAdapter.java:70)
    org.apache.myfaces.custom.aliasbean.Alias.computeEvaluatedExpression(Alias.java:113)
    org.apache.myfaces.custom.aliasbean.Alias.make(Alias.java:137)
    org.apache.myfaces.custom.aliasbean.AliasBean.makeAlias(AliasBean.java:357)
    org.apache.myfaces.custom.aliasbean.AliasBean.makeAlias(AliasBean.java:342)
    org.apache.myfaces.custom.aliasbean.AliasBeanTagHandler.applyNextHandler(AliasBeanTagHandler.java:90)
    com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
    com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
    com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
    com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
    com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
    com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    com.sun.facelets.tag.jsf.ComponentHandler.applyNextHandler(ComponentHandler.java:314)
    com.sun.facelets.tag.jsf.ComponentHandler.apply(ComponentHandler.java:169)
    com.sun.facelets.tag.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:47)
    com.sun.facelets.tag.jsf.core.ViewHandler.apply(ViewHandler.java:109)
    com.sun.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:49)
    com.sun.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:25)
    com.sun.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:95)
    com.icesoft.faces.facelets.D2DFaceletViewHandler.renderResponse(D2DFaceletViewHandler.java:274)
    com.icesoft.faces.application.D2DViewHandler.renderView(D2DViewHandler.java:159)
    com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:110)
    com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
    com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
    com.icesoft.faces.webapp.http.core.JsfLifecycleExecutor.apply(JsfLifecycleExecutor.java:19)
    com.icesoft.faces.context.View$2$1.respond(View.java:48)
    com.icesoft.faces.webapp.http.servlet.ServletRequestResponse.respondWith(ServletRequestResponse.java:201)
    com.icesoft.faces.context.View$2.serve(View.java:77)
    com.icesoft.faces.context.View.servePage(View.java:149)
    com.icesoft.faces.webapp.http.core.SingleViewServer.service(SingleViewServer.java:52)
    com.icesoft.faces.webapp.http.common.ServerProxy.service(ServerProxy.java:11)
    com.icesoft.faces.webapp.http.servlet.MainSessionBoundServlet$4.service(MainSessionBoundServlet.java:149)
    com.icesoft.faces.webapp.http.common.standard.PathDispatcherServer.service(PathDispatcherServer.java:24)
    com.icesoft.faces.webapp.http.servlet.BasicAdaptingServlet.service(BasicAdaptingServlet.java:16)
    com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
    com.icesoft.faces.webapp.http.servlet.SessionDispatcher.service(SessionDispatcher.java:53)
    com.icesoft.faces.webapp.http.servlet.PathDispatcher.service(PathDispatcher.java:23)
    com.icesoft.faces.webapp.http.servlet.MainServlet.service(MainServlet.java:131)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
    org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter.doFilter(AbstractPreAuthenticatedProcessingFilter.java:89)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:97)
    de.konsens.wwwkmv.security.KmvExceptionTranslationFilter.doFilter(KmvExceptionTranslationFilter.java:54)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:57)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:79)
    org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)
    org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:169)
    org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237)
    org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167)

我在faces-config.xml文件中配置了一个消息包

<application>
  <view-handler>com.icesoft.faces.facelets.D2DFaceletViewHandler</view-handler>
  <locale-config>
     <default-locale>de</default-locale>
     <supported-locale>de</supported-locale>
     <supported-locale>de_DE</supported-locale>
   </locale-config>
   <message-bundle>Messages</message-bundle>
</application>

我已将属性文件放入WEB-INF / classes /文件夹(Messages_de.properties,Messages_de_DE.properties)但我总是得到这条消息....最神秘的是我只改变了配置中的内容应用程序但没有更改faces-config.xml或jspx文件中的内容。

2 个答案:

答案 0 :(得分:2)

我收到了同样的错误消息:

20-09-2012 16:20:31   HTTP JVM: Can't find resource for bundle javax.faces.Messages, key nl. For more detailed information, please consult error-log-0.xml located in /prj/notes/appldata/data/domino/workspace/logs

20-09-2012 16:20:31   HTTP JVM: com.ibm.xsp.webapp.FacesServlet$ExtendedServletException: javax.faces.FacesException: Can't find resource for bundle javax.faces.Messages, key nl

20-09-2012 16:20:31   HTTP JVM: CLFAD0134E: Exception processing XPage request. For more detailed information, please consult error-log-0.xml located in /prj/notes/appldata/data/domino/workspace/logs

好吧,我正在使用XPages(基于JSF的IBM强大的RAD工具),在我的情况下,这是因为系统想要显示一些字段验证错误消息,当我的{{1失焦(甚至没有渲染)。

我在问题的根源解决了它,因为错误是由于字段验证造成的。 实际上,我通过部分刷新点击了切换到其他动态内容的图像。我选择了“不验证或更新数据”,因此跳过了字段验证。

答案 1 :(得分:0)

java.util.MissingResourceException: Can't find bundle for base name javax.faces.Messages, locale de

这实际上是一个误导性的异常,也是旧版JSF 1.2版本错误报告中的错误。 真正的问题是无法找到<message-bundle>

您提到您已将Messages_de.propertiesMessages_de_DE.properties放在/WEB-INF/classes文件夹中,这很好,但您提供默认Messages.properties文件。它可以保持空白。

另一个可能的原因是您使用IDE 实际开发,并且您通过IDE导航器将其放在/WEB-INF/classes文件夹中。你不应该这样做。无论何时构建和部署WAR,都将覆盖它。相反,您应该将.properties文件放在项目的源根目录中,所有Java包都在那里。