3

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.

Please share any information which will help me 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
Roman C
  • 49,761
  • 33
  • 66
  • 176
  • You should post also some code so we can have a context for this error – rakwaht Mar 24 '17 at 10:56
  • Thank you @rakwaht for the comment. I don't know which of the code is throwing the error too. This is like an application level error. Before opening any page on the screen this error is showing up. – ramanareddy438 Mar 24 '17 at 17:57

2 Answers2

1

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.

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
0

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.

Roman C
  • 49,761
  • 33
  • 66
  • 176