JSF 包加载失败

发布于 2024-12-15 14:01:03 字数 7152 浏览 1 评论 0原文

目前,我的 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 文件中的内容。

Currently my JSF (1.2) application produces the following failure during the start of the Servlet Engine (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)

I have configured a message bundle in the faces-config.xml file

<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>

I have put the property file into WEB-INF/classes/ folder (Messages_de.properties, Messages_de_DE.properties) but i always get this message....the most mysterious thing is that i only changed things in the configuration reading of the application but didn't change things in faces-config.xml or jspx files.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

枉心 2024-12-22 14:01:03

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

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(IBM 基于 JSF 的强大 RAD 工具),在我的例子中,这是因为系统想要显示一些字段验证错误消息,当我的 MessagesObject 失去焦点(或者甚至没有渲染)。

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

I got the same error message :

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

Well, I'm using XPages (IBM's powerful RAD tool based on JSF) and in my case it was because the system wanted to show some field-validation error messages, when my MessagesObject was out of focus (or not even rendered).

I solved it at the source of the problem, because the error was due to a field-validation.
In fact, I was clicking on an image that switched to other dynamic content, by a partial refresh. I selected "Do not validate or update data", so the field-validation was skipped.

夜吻♂芭芘 2024-12-22 14:01:03
java.util.MissingResourceException:找不到基本名称 javax.faces.Messages 的包,区域设置

这实际上是一个误导性的异常,也是旧版 JSF 1.2 版本错误报告中的一个错误。 真正的问题是找不到

您提到您将 Messages_de.propertiesMessages_de_DE.properties 放在 /WEB-INF/classes 文件夹中,这很好,但您应该 < em>还提供默认的Messages.properties文件。它可以保持为空。

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

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

This is actually a misleading exception and a bug in error reporting of older JSF 1.2 versions. The real problem is that the <message-bundle> cannot be found.

You mentioned that you placed Messages_de.properties and Messages_de_DE.properties in /WEB-INF/classes folder, which is fine, but you should also supply a default Messages.properties file. It can be kept empty.

Another possible cause is that you're actually developing using an IDE and that you placed it literally in the /WEB-INF/classes folder by the IDE navigator. You should not do this. This will be overriden whenever you build and deploy the WAR. Instead, you should place the .properties files in the source root of the project, there where all your Java packages also are.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文