有人可以帮我解决我在JSF上的新问题。每当我加载我的页面并提交表单时,我都会收到此错误: 这是我的代码:
@ManagedBean
@ApplicationScoped
public class CommandeController extends JSFActions {
final static Logger LOGGER = LoggerFactory.getLogger( CommandeController.class );
@ManagedProperty( value = "#{commandeBean}")
private CommandeBean commandeBean;
@ManagedProperty( value = "#{clientBean}")
private ClientBean clientBean;
@ManagedProperty( value = "#{etablissementBean}")
private EtablissementBean etablissementBean;
@ManagedProperty( value = "#{commandeFacade}")
private ICommandeFacade commandeFacade;
和我的xhtml文件看起来像
<h:outputText value="#{lbl.postRef}" />
<p:selectOneMenu value="#{commandeBean.idPoste}">
<f:selectItem itemLabel="Choisissez le poste" itemValue="-1"/>
<f:selectItems value="#{jFActions.postes.entrySet()}" var="post"
itemValue="#{post.key}" itemLabel="#{post.value}"/>
</p:selectOneMenu>
<h:outputText value="#{lbl.langUse}" />
<p:selectOneMenu value="#{commandeBean.langUtilise}">
<f:selectItem itemLabel="Choisissez la langue" itemValue="-1"/>
<f:selectItem itemValue="ar" itemLabel="Arabe"/>
<f:selectItem itemValue="en" itemLabel="Enlish"/>
<f:selectItem itemValue="fr" itemLabel="Frensh"/>
</p:selectOneMenu>
<h:outputText value="#{lbl.nbJ}" />
<p:inputText id="txtNbrJour" value="#{commandeBean.nbJour}" converterMessage="#{msg.nbrInvalid}" >
<f:convertNumber type="number" integerOnly="true" />
</p:inputText>
<h:outputText value="#{lbl.nbjMax}" />
<p:inputText id="txtNJAut" value="#{etablissementBean.nbJourAutorise}" readonly="true" />
ATTENTION: Erreur inattendue lors du traitement du bean géré «commandeController»
com.sun.faces.mgbean.ManagedBeanPreProcessingException: Erreur inattendue lors du traitement du bean géré «commandeController»
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:398)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.parser.AstValue.getTarget(AstValue.java:94)
at org.apache.el.parser.AstValue.invoke(AstValue.java:259)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:87)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
at javax.faces.component.UICommand.broadcast(UICommand.java:315)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:790)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1282)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:198)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:646)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:953)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:1852)
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)
Caused by: com.sun.faces.mgbean.ManagedBeanPreProcessingException: Erreur inattendue lors du traitement de la propriété gérée «commandeBean»
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:117)
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
... 35 more
Caused by: java.lang.IllegalArgumentException: can't parse argument number commandeBean
at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
at java.text.MessageFormat.<init>(MessageFormat.java:350)
at java.text.MessageFormat.format(MessageFormat.java:811)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:398)
at com.sun.faces.mgbean.BeanBuilder$Expression.validateLifespan(BeanBuilder.java:574)
at com.sun.faces.mgbean.BeanBuilder$Expression.<init>(BeanBuilder.java:523)
at com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:363)
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107)
... 36 more
18 févr. 2014 10:48:37 org.apache.catalina.core.StandardWrapperValve invoke
GRAVE: Servlet.service() for servlet [Faces Servlet] in context with path [/sgrp-web] threw exception [Erreur inattendue lors du traitement du bean géré «commandeController»] with root cause
java.lang.IllegalArgumentException: can't parse argument number commandeBean
at java.text.MessageFormat.makeFormat(MessageFormat.java:1339)
at java.text.MessageFormat.applyPattern(MessageFormat.java:458)
at java.text.MessageFormat.<init>(MessageFormat.java:350)
at java.text.MessageFormat.format(MessageFormat.java:811)
at com.sun.faces.util.MessageUtils.getExceptionMessageString(MessageUtils.java:398)
at com.sun.faces.mgbean.BeanBuilder$Expression.validateLifespan(BeanBuilder.java:574)
at com.sun.faces.mgbean.BeanBuilder$Expression.<init>(BeanBuilder.java:523)
at com.sun.faces.mgbean.ManagedBeanBuilder.bakeBeanProperty(ManagedBeanBuilder.java:363)
at com.sun.faces.mgbean.ManagedBeanBuilder.bake(ManagedBeanBuilder.java:107)
at com.sun.faces.mgbean.BeanManager.preProcessBean(BeanManager.java:353)
at com.sun.faces.mgbean.BeanManager.create(BeanManager.java:262)
at com.sun.faces.el.ManagedBeanELResolver.resolveBean(ManagedBeanELResolver.java:257)
at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:117)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at org.apache.el.parser.AstIdentifier.getValue(AstIdentifier.java:72)
at org.apache.el.parser.AstValue.getTarget(AstValue.java:94)
at org.apache.el.parser.AstValue.invoke(AstValue.java:259)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
at
任何帮助??
答案 0 :(得分:1)
您正在使用NumberConverter
转换对象。请改用自定义转换器。
答案 1 :(得分:0)
在我的情况下,它发生了,因为我正在记录JSON {"":{}}
输出,以及系统生成此异常的原因。 JSON在LogDebug
方法中像字符串一样对待。
使用vlogDebug("my log {0}",jsonObject)
。它现在可以在参数{0}
中使用。