<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Últimas mensagens do tópico "[Erro] Criação de Interface usando Struts 2 - Help"]]></title>
		<link>http://www.guj.com.br/posts/list/6.java</link>
		<description><![CDATA[Últimas mensagens enviadas no tópico "[Erro] Criação de Interface usando Struts 2 - Help"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>[Erro] Criação de Interface usando Struts 2 - Help</title>
				<description><![CDATA[ Olá a todos.. estou com oseguinte probleminha a ser resolvido usando o STRUTS 2.<br /> Instancio uma Interface :<br /> [code]<br /> public interface GenericAction {<br />     public String init();<br />     public String save();<br />     public String edit();<br />     public String remove();<br />     }<br /> }[/code]<br /> <br /> logo tento utiliza-la em minha Action:<br /> [code]<br /> public class PaisAction extends ActionSupport implements Preparable, GenericAction{<br />         private PaisService paisService;<br /> 	public PaisAction(PaisService paisService) {<br /> 		super();<br /> 		this.paisService = paisService;<br /> 	}<br /> ...<br /> <br /> }[/code]<br /> Logo crio tambem uma interface para o service .. <br /> [code]<br /> public interface GenericService&lt;Reg extends Identifiable&lt;ID&gt;, ID extends Serializable&gt; {<br />     public void save(Reg row);<br />     public List&lt;Reg&gt; findAll();<br />     public List&lt;Reg&gt; findAllByName();<br />     public void delete(Reg row);<br />     public void merge(Reg row);<br />     public Long count();<br /> }<br /> [/code]<br /> A referencia a ela no codigo:<br /> [code]<br /> public class PaisService implements GenericService&lt;Pais, Integer&gt;{<br /> ...<br /> }<br /> [/code]<br /> Segue o applicationContext.xml:<br /> [code]<br />     &lt;bean id="paisService" class="service.config.PaisService" scope="prototype"/&gt;<br />     &lt;bean id="paisAction" scope="prototype" class="action.config.PaisAction"&gt;<br />          &lt;constructor-arg ref="paisService" /&gt;<br />     &lt;/bean&gt;<br /> [/code]<br /> <br /> quando tento chamar uma action da o seguinte erro:<br /> [code]<br />  Struts has detected an unhandled exception:<br /> Messages: 	<br /> <br />    1. Error creating bean with name 'paisAction' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [service.config.PaisService]: Could not convert constructor argument value of type [$Proxy17] to required type [service.config.PaisService]: Failed to convert value of type [$Proxy17] to required type [service.config.PaisService]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy17] to required type [service.config.PaisService]: no matching editors or conversion strategy found<br />    2. Unable to instantiate Action, paisAction, defined for 'initPais' in namespace ''Error creating bean with name 'paisAction' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Unsatisfied dependency expressed through constructor argument with index 0 of type [service.config.PaisService]: Could not convert constructor argument value of type [$Proxy17] to required type [service.config.PaisService]: Failed to convert value of type [$Proxy17] to required type [service.config.PaisService]; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy17] to required type [service.config.PaisService]: no matching editors or conversion strategy found<br /> <br /> File: 	org/springframework/beans/factory/support/ConstructorResolver.java<br /> Line number: 	544<br /> [/code]<br /> <br /> alguem sab como lidar com esse "problema" (ou soluçao)???????<br /> Ja tentei instanciar o metodo GenericService no construtor de PaisAction e receboi a mensagem de erro dizendo que o metodo nao pode ser instanciado por ser uma interface (logica).. mas foi soh uma tentativa sem sucesso..<br /> <br /> At.. Agradeço desde ja!]]></description>
				<guid isPermaLink="true">http://www.guj.com.br/prepost/131512/708332/erro-criacao-de-interface-usando-struts-2---help
</guid>
				<link>http://www.guj.com.br/prepost/131512/708332/erro-criacao-de-interface-usando-struts-2---help
</link>
				<pubDate><![CDATA[Sat, 4 Jul 2009 08:03:55]]> GMT</pubDate>
				<author><![CDATA[ agcp123]]></author>
			</item>
	</channel>
</rss>
