You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

About the Migration guide

The intent of this page is to provide a list of issue/resolutions as encountered while migrating from Struts 2.0.x to 2.1.x. The ultimate aim is to have a proper migration guide, but as 2.1.x is still evolving, any of the issue/resolutions found in this page may become obsolete any time.
(lightbulb) Feel free to redraft material in this space! (That's why it's here!)

Migration issue/resolutions

The issues are listed in the same order as encountered after changing jars over from 2.0.x to 2.0.1. Noteworthy the migration was done under the following setup: Fedora core 6, JDK 1.6.0_2 and Tomcat 6.0.10 running from MyEclipse plugin.

Result type redirect-action is no longer supported, use redirect instead.

Problem Symptom:

SEVERE: Exception starting filter struts2
Unable to load configuration. - action - file:/home/giaz/code/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:58)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:370)
...
Caused by: Error building results for action ScheduleJob in namespace  - action - file:/home/giaz/code/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:39:98
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:372)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:461)
	... 30 more
Caused by: There is no result type defined for type 'redirect-action' mapped with name 'success' - result - file:/home/giaz/code/.metadata/.plugins/com.genuitec.eclipse.easie.tomcat.myeclipse/tomcat/webapps/webui/WEB-INF/classes/struts.xml:40:50
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.buildResults(XmlConfigurationProvider.java:616)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:370)
	... 35 more

The struts.xml before:

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect-action">
     <param name="actionName">ListDisplayOptimizationJobStatus</param>
  </result>		
  <result name="error" type="tiles">webui.requestFailed</result>
</action>   

To resolve the issue modify the struts.xml action definition to:

<action name="ScheduleJob" class="com.sag.optimizer.ui.web.action.scheduler.ScheduleJobAction">
  <result name="success" type="redirect">ListDisplayOptimizationJobStatus.action</result>
  <result name="error" type="tiles">webui.requestFailed</result>
</action>

Tiles 2.1.x plugin tiles.xml requires DOCTYPE

Problem Symptom:

Nov 22, 2007 11:38:11 AM org.apache.tiles.impl.BasicTilesContainer init
INFO: Initializing Tiles2 container. . .
Nov 22, 2007 11:38:11 AM org.apache.commons.digester.Digester error
SEVERE: Parse Error at line 2 column 19: Document is invalid: no grammar found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
	at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:131)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:384)
	at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:318)

The tiles.xml page before:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<tiles-definitions/>

To resolve the issue simply add:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE tiles-definitions PUBLIC
	"-//Apache Software Foundation//DTD Tiles Configuration 2.0//EN"
	"http://struts.apache.org/dtds/tiles-config_2_0.dtd">
<tiles-definitions/>

<s:head theme="ajax"/> is obsolete, ajax theme was moved into dojo plugin

Problem Symptom

 
  • No labels