Thrown by: java.lang.IllegalArgumentException: unknown reserved key '_typeConverter'

I am getting below error while I try to login to my Struts application. This happens after updating my Struts libraries to the latest.

Please share any information that can help me fix this. The previous version of Struts was 2.3.10. A newer version is 2.5.10.1.

 Caused by: java.lang.IllegalArgumentException: unknown reserved key
 '_typeConverter'
     at ognl.OgnlContext.put(OgnlContext.java:536)
     at ognl.Ognl.setTypeConverter(Ognl.java:346)
     at com.opensymphony.xwork2.ognl.OgnlUtil.setProperty(OgnlUtil.java:225)
     at com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperty(OgnlReflectionProvider.java:90)
     at org.apache.struts2.factory.StrutsResultFactory.setParameter(StrutsResultFactory.java:67)
     at org.apache.struts2.factory.StrutsResultFactory.setParameters(StrutsResultFactory.java:52)
     at org.apache.struts2.factory.StrutsResultFactory.buildResult(StrutsResultFactory.java:41)
     at com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:220)
     at com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionInvocation.java:215)
>     ... 18 more

      

+3


source to share


2 answers


You are using the wrong version of the OGNL library. Use Maven or equivalent to manage dependencies. Or download Basic Dependencies Only to see which version of OGNL you need to use with Struts 2.5.10.1.



+1


source


You have used a reserved key _typeConverter

. Rename your key to something else.

 RESERVED_KEYS.put(TYPE_CONVERTER_CONTEXT_KEY, null);

      



This code is from apidocs forOgnlContext

.

0


source







All Articles