To whom it may concern, 
my struts+spring+hibernate+mysql works fine, but try to embed the rest service 
in the application and failed to start.
my adding/change is the following
WEB-INF/lib  (add the following jar)    json-lib-2.3-jdk15.jar
    struts2-rest-plugin-2.3.32.jar

WEB-INF/classes/struts.xml (add the following line with red font)
<struts>
  <include file="struts-default.xml"/>
  <constant name="struts.action.extension" value="xhtml,,xml,json,action"/>  
<constant name="struts.mapper.class" 
value="org.apache.struts2.dispatcher.mapper.PrefixBasedActionMapper" />  
<constant name="struts.mapper.prefixMapping" value="/rest:rest,:struts"/>  
<constant name="struts.convention.action.suffix" value="Controller"/>  
<constant name="struts.convention.action.mapAllMatches" value="true"/>  
<constant name="struts.convention.default.parent.package" 
value="rest-default"/>  <constant name="struts.convention.package.locators" 
value="example"/>
<constant name="struts.objectFactory" 
value="org.apache.struts2.spring.StrutsSpringObjectFactory" />
  <package name="default" extends="json-default">
after start application, but in catalina.out see the following error, i did 
copy struts-plugin.xml into WEB-INF/classes/.
thanks in advance
john

*******************************************************************
SEVERE: Exception starting filter struts2Unable to load configuration. - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:504)   
     at 
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
        at 
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
        at 
org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
        Caused by: Unable to load configuration. - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
        at 
org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:978)      
  at 
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
        at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)   
     ... 15 moreCaused by: Unable to load bean: 
type:com.opensymphony.xwork2.ActionProxyFactory 
class:org.apache.struts2.rest.RestActionProxyFactory - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:247)
        at 
org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
        at 
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:240)
        at 
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
        ... 18 moreCaused by: Bean type interface 
com.opensymphony.xwork2.ActionProxyFactory with the name rest has already been 
loaded by bean - 
file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/classes/struts-plugin.xml:30:130
 - bean - 
jar:file:/var/apache-tomcat-7.0.34/webapps/ecommerce/WEB-INF/lib/struts2-rest-plugin-2.3.32.jar!/struts-plugin.xml:30:130
        at 
com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:231)
        ... 21 more

Reply via email to