ramanareddy438
ramanareddy438

Reputation: 145

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

I am getting the below error while I am trying to login to my Struts application. This is occurring after upgrading my Struts libraries to latest release.

Please, share any information which will help me to fix this. Previous version of Struts was 2.3.10. The 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

Upvotes: 4

Views: 1820

Answers (2)

Roman C
Roman C

Reputation: 1

You have used reserved key _typeConverter. Rename your key to something else.

 RESERVED_KEYS.put(TYPE_CONVERTER_CONTEXT_KEY, null);

This code from apidocs for OgnlContext.

Upvotes: 0

Aleksandr M
Aleksandr M

Reputation: 24406

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

Upvotes: 1

Related Questions