upgrading to struts from 2.1.6 to 2.3.15.1
I upgraded from 2.1.6 to 2.3.15.1 because of the security fixes available
in the latest version.
In my application we are heavily using redirect action, it is impossible
to handle the redirect action in current application. But for the security
improvement it`s need to upgrade the Struts version on PROD environment.
I had upgrade below jars in application lib folder.
a. commons-io-2.0.1 b. commons-logging-1.1.3 c. freemarker-2.3.19 d.
ognl-3.0.6 e. struts2-core-2.3.15 f. struts2-dojo-plugin-2.3.15 g.
struts2-spring-plugin-2.3.15 h. struts2-tiles-plugin-2.3.15 i.
xwork-core-2.3.15 j. xwork-core-2.3.15 k. commons-lang3-3.1
Also do the changes in application to handle the Map and also done the
changes in Localization file. Because of the application is multilingual.
For handle the action mapper i have created the custom mapper (as
suggested by Apache) which is extending to DefaultActionMapper. Now see
below are the xml entries in my xml file
<action name="brand" class="brand">
<param name="loginActionIncluded">true</param>
<result name="success" type="tiles">brand</result>
<result name="SubCategory" type="tiles">searchResult</result>
<result name="noProductsFound" type="tiles">noResultPage</result>
<result name="productPage" type="redirectAction">
<param name="actionName">productInformation</param>
<param name="productCode">${searchResult.redirectParam}</param>
<param name="token">${searchResult.searchToken}</param>
</result>
</action>
<bean id="brand" class="com.rexel.web.action.catbrow.BrandAction"
parent="abstractValidableAction" scope="prototype">
<property name="model" ref="brandModel"></property>
<property name="catalogBrowsingFacade"
ref="catalogBrowsingFacade"></property>
<property name="configurationContext" ref="configurationContext"></property>
<property name="productFacade" ref="productFacade" />
<property name="authorizationFacade" ref="authorizationFacade"/>
<property name="formatStrategy" ref="formatStrategy" />
<property name="redirectHandler" ref="redirectHandler"></property>
<property name="searchModel" ref="searchModel"></property>
</bean>
Now some times it working and sometimes it is not working. See below are
the exception.
Unable to instantiate Action, brand, defined for 'brand' in namespace
'/'Error creating bean with name 'brand' defined in Servlet Context
resource [/WEB-INF/spring/rexel-actions.xml]: Error setting property
values; nested exception is
org.springframework.beans.NotWritablePropertyException: Invalid property
'model' of bean class [com.rexel.web.action.catbrow.BrandAction]: Bean
property 'model' is not writable or has an invalid setter method. Does the
parameter type of the setter match the return type of the getter?
com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:316)`
I am surprising some time it is working and some time it is not working.
The exception coming on random basis.
No comments:
Post a Comment