struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lukasz Lenart <lukaszlen...@apache.org>
Subject Re: s:fielderror not working in Java 8, WebSphere
Date Wed, 23 May 2018 06:07:05 GMT
You mean <s:fielderror/> ? There is no <s:fielderrors/> tag. Did you
try to use the latest Freemarker version?

I have tested the tag with Oracle Java 8 and it works without issue.
Look like incompatibility between IBM Java and Freemarker.

2018-05-22 20:24 GMT+02:00 breaux@us.ibm.com <breaux@us.ibm.com>:
> Struts 2.5.14.1, WebSphere 8.5.5.13, IBM Java 8 (level 1.8.0_161) on AIX.
>
> We have a JSP with a plain <s:fielderrors /> element that works without issue when
we switch WebSphere back to Java 7, but in Java 8 produces the following error:
>
> 2018-05-22 12:43:24,384 ERROR [freemarker.runtime]: error - Error executing FreeMarker
template
> FreeMarker template error:
> Java method "AbstractCollection.size()" threw an exception when invoked on LinkedHashMap$LinkedKeySet
object "[]"; see cause exception in the Java stack trace.
>
> ----
> FTL stack trace ("~" means nesting-related):
>         - Failed at: #assign eKeysSize = eKeys.size()  [in template "template/simple/fielderror.ftl"
at line 23, column 5]
> ----
>
> Java stack trace (for programmers):
> ----
> freemarker.core._TemplateModelException: [... Exception message was already printed;
see it above ...]
>         at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:289)
>         at freemarker.ext.beans._MethodUtil.newInvocationTemplateModelException(_MethodUtil.java:252)
>         at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:74)
>         at freemarker.core.MethodCall._eval(MethodCall.java:65)
>         at freemarker.core.Expression.eval(Expression.java:81)
>         at freemarker.core.Assignment.accept(Assignment.java:134)
>         at freemarker.core.Environment.visit(Environment.java:326)
>         at freemarker.core.Environment.visit(Environment.java:332)
>         at freemarker.core.Environment.visit(Environment.java:332)
>         at freemarker.core.Environment.process(Environment.java:305)
>         at freemarker.template.Template.process(Template.java:378)
>         at org.apache.struts2.components.template.FreemarkerTemplateEngine.renderTemplate(FreemarkerTemplateEngine.java:149)
>         at org.apache.struts2.components.UIBean.mergeTemplate(UIBean.java:579)
>         at org.apache.struts2.components.UIBean.end(UIBean.java:535)
>         at org.apache.struts2.views.jsp.ComponentTagSupport.doEndTag(ComponentTagSupport.java:39)
> .. my JSP
> ..
> Caused by: java.lang.AbstractMethodError: java/util/AbstractCollection.size()I
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
>         at java.lang.reflect.Method.invoke(Method.java:508)
>         at freemarker.ext.beans.BeansWrapper.invokeMethod(BeansWrapper.java:1487)
>         at freemarker.ext.beans.SimpleMethodModel.exec(SimpleMethodModel.java:69)
>
> Does anyone know what could be the cause of this?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message