【发布时间】:2012-07-19 10:44:28
【问题描述】:
升级到 JSF2(可能)后,.xhtml 文件中的一个特殊访问器会生成 IllegalArgumentExceptions,但我真的不知道为什么。在我的本地 JBoss (4.2.2) 上运行应用程序不会生成此异常,但这可能与调试数据和实时数据之间的差异有关。
以下堆栈跟踪生成,我可以从生产服务器日志中提取:
Caused by: javax.el.ELException: /xy/xy-subtemplate1.xhtml @131,45 value="#{someClass.someProperty}": java.lang.IllegalArgumentException
at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:101)
at javax.faces.component.UIInput.updateModel(UIInput.java:818)
... 36 more
Caused by: java.lang.IllegalArgumentException
at sun.reflect.GeneratedMethodAccessor1134.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at javax.el.BeanELResolver.setValue(BeanELResolver.java:108)
at com.sun.faces.el.DemuxCompositeELResolver._setValue(DemuxCompositeELResolver.java:255)
at com.sun.faces.el.DemuxCompositeELResolver.setValue(DemuxCompositeELResolver.java:281)
at org.apache.el.parser.AstValue.setValue(AstValue.java:114)
at org.apache.el.ValueExpressionImpl.setValue(ValueExpressionImpl.java:249)
at com.sun.facelets.el.TagValueExpression.setValue(TagValueExpression.java:93)
... 37 more
someClass 正在列表中被迭代,并具有以下访问someProperty 的方法:
public int getSomeProperty() {
return this.getSomeRelatedEnum().ordinal();
}
public void setSomeProperty( final int index) {
this.setSomeRelatedEnum( SomeRelatedEnum.fromOrdinal( index) );
}
这怎么会导致上面提到的IllegalArgumentException?
【问题讨论】:
-
你能把迭代的xhtml或jsp的片段贴出来,这个属性在哪里被调用?
标签: jsf-2 el illegalargumentexception