You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Edney Imme <ed...@gmail.com> on 2007/04/18 21:03:11 UTC

Problem mit Spring and JSF integration

Hello everybody

I have a big  problem in a project who I work with JSF and Spring.

The problem is the integration with Spring and JSF.

I get this error Message

2007-04-18 10:10:14,051 ERROR [main ] (ContextLoader.java:205) Context
initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'articleHandler' defined in URL
[file:/C:/Documents%20and%20Settings/f0fp083/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp2/webapps/EDIWebJSF/WEB-INF/classes/applicationContext-
jsf.xml]: Error setting property values; nested exception is
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessExceptions (1) are:
PropertyAccessException 1: org.springframework.beans.TypeMismatchException:
Failed to convert property value of type [$Proxy5] to required type [
br.com.teste.logic.command.masterdata.service.MasterdataService] for
property 'masterdataService'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5]
to required type [
br.com.teste.logic.command.masterdata.service.MasterdataService] for
property 'masterdataService': no matching editors or conversion strategy
found
Caused by:
org.springframework.beans.PropertyBatchUpdateException; nested
PropertyAccessException details (1) are:
PropertyAccessException 1:
org.springframework.beans.TypeMismatchException: Failed to convert property
value of type [$Proxy5] to required type [
br.com.teste.logic.command.masterdata.service.MasterdataService] for
property 'masterdataService'; nested exception is
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5]
to required type [
br.com.teste.logic.command.masterdata.service.MasterdataService] for
property 'masterdataService': no matching editors or conversion strategy
found
Caused by:
java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5]
to required type [
br.com.teste.logic.command.masterdata.service.MasterdataService] for
property 'masterdataService': no matching editors or conversion strategy
found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(
TypeConverterDelegate.java:224)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(
TypeConverterDelegate.java:139)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(
BeanWrapperImpl.java:772)

My ContextApplication.xml is hier
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
 [url]http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"
>[/url]

<!-- ========================= GENERAL DEFINITIONS
========================= -->

<bean id="messageSource"
class="org.springframework.context.support.Resourc eBundleMessageSource">
<property name="basenames">
<list>
<value>br.com.teste.ui.resource.test_messages</value>
<value>br.com.teste.ui.resource.security_messages</value>
</list>
</property>
</bean>

<!-- ========================= Start of SERVICE DEFINITIONS
========================= -->
<bean id="loginHandler" class="br.com.teste.ui.security.SimpleLoginHandler"
/>

<bean id="articleHandler" class="br.com.teste.ui.artikeldaten.ArticleManager
">
<property name="MasterdataService">
<ref bean="MasterdataService"/>
</property>
</bean>
</beans>

And there faces-config.xml is hier. :
<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE faces-config PUBLIC
    "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
    "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">

<faces-config>
   <!-- Supported locales are german and english -->
   <application>
      <!-- <view-handler>com.sun.facelets.FaceletViewHandler
</view-handler> -->
      <view-handler>
org.apache.myfaces.tomahawk.application.jsp.JspTilesViewHandlerImpl
</view-handler>
      <variable-resolver>
org.springframework.web.jsf.DelegatingVariableResolver</variable-resolver>
      <locale-config>
         <default-locale>en</default-locale>

      </locale-config>
      <message-bundle>br.com.teste.ui.resource.test_messages
</message-bundle>
   </application>
</faces-config>


Some people said that I need to define the MasterdataService in the
contextApplication in Spring. But I already do that, and I get this error
Message again.

I change my applicationContext file to this


 <beans
 xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans[url]http://www.springframework.org/schema/beans/spring-
beans-2.0.xsd">[/url]

 <!-- ========================= GENERAL DEFINITIONS
========================= -->

 <bean id="messageSource"
 class="org.springframework.context.support.Resourc eBundleMessageSource">
 <property name="basenames">
 <list>
 <value>br.com.teste.ui.resource.test_messages</value>
 <value>br.com.teste.ui.resource.security_messages</value>
 </list>
 </property>
 </bean>

 <!-- ========================= Start of SERVICE DEFINITIONS
========================= -->
 <bean id="loginHandler" class="br.com.teste.ui.security.SimpleLoginHandler"/>


 <bean id="articleHandler" class="
br.com.teste.ui.artikeldaten.ArticleManager">
 <property name="MasterdataService">
 <ref bean="MasterdataService"/>
 </property>
 </bean>

 </beans>

And i get the same error message.

Please, I need Help.

thank you

Best regards
Edney

Re: Problem mit Spring and JSF integration

Posted by Edney Imme <ed...@gmail.com>.
hello everybody.

thanks a lot for your help.

I solve this problem doing these.

In my class ArticleManager i had a attribute masterdataService who was a
type of MasterdataService class.

To solve this problem we change it from MasterdataService to  Service

Now, it is everything ok.





2007/4/19, Jörn Zaefferer <jo...@googlemail.com>:
>
> The error message you posted indicates that there is a different error, as
> a missing bean definition gives you just that: An error about a missing bean
> definition.
>



-- 
Att.
Edney Marcel Imme

Re: Problem mit Spring and JSF integration

Posted by Jörn Zaefferer <jo...@googlemail.com>.
The error message you posted indicates that there is a different error, as a
missing bean definition gives you just that: An error about a missing bean
definition.

Re: Problem mit Spring and JSF integration

Posted by Alexey Kakunin <ak...@gmail.com>.
Not sure that only this - but you defenetly need to define masterdataService
bean - for example like you described

2007/4/19, Edney Imme <ed...@gmail.com>:
>
> Hello
>
> i need to do this?
>     <bean id="masterdataService" class="
> com.tsystems.ediweb.logic.command.masterdata.service.MasterdataService" />
>
> Only this?
>
> 2007/4/18, Alexey Kakunin <ak...@gmail.com>:
> >
> > Yes, could you show how MasterdataService bean defined?
> >
> > 2007/4/19, Jörn Zaefferer < joern.zaefferer@googlemail.com>:
> > >
> > >
> > >   <beans
> > > >  xmlns=" http://www.springframework.org/schema/beans"
> > > >  xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> > > >  xsi:schemaLocation=" http://www.springframework.org/schema/beans
> > > > [url]http://www.springframework.org/schema/beans/spring-
> > > > beans-2.0.xsd">[/url]
> > > >
> > > >  <!-- ========================= GENERAL DEFINITIONS
> > > > ========================= -->
> > > >
> > > >  <bean id="messageSource"
> > > >  class="org.springframework.context.support.ResourceBundleMessageSource">
> > > >  <property name="basenames">
> > > >  <list>
> > > >  <value>br.com.teste.ui.resource.test_messages</value>
> > > >  <value>br.com.teste.ui.resource.security_messages</value>
> > > >  </list>
> > > >  </property>
> > > >  </bean>
> > > >
> > > >  <!-- ========================= Start of SERVICE DEFINITIONS
> > > > ========================= -->
> > > >  <bean id="loginHandler" class="
> > > > br.com.teste.ui.security.SimpleLoginHandler"/>
> > > >
> > > >  <bean id="articleHandler" class="
> > > > br.com.teste.ui.artikeldaten.ArticleManager">
> > > >  <property name="MasterdataService">
> > > >  <ref bean="MasterdataService"/>
> > > >  </property>
> > > >  </bean>
> > > >
> > > >  </beans>
> > > >
> > > > And i get the same error message.
> > >
> > >
> > > I don't see MasterdataService defined anywhere. Am I missing
> > > something?
> > >
> > >
> > >
> >
> >
> > --
> > With Best Regards,
> > Alexey Kakunin, EmDev Limited
> >
> > Professional Software Development:
> > http://www.emdev.ru
>
>
>
>
> --
> Att.
> Edney Marcel Imme




-- 
With Best Regards,
Alexey Kakunin, EmDev Limited

Professional Software Development:
http://www.emdev.ru

Re: Problem mit Spring and JSF integration

Posted by Edney Imme <ed...@gmail.com>.
Hello

i need to do this?
    <bean id="masterdataService" class="
com.tsystems.ediweb.logic.command.masterdata.service.MasterdataService" />

Only this?

2007/4/18, Alexey Kakunin <ak...@gmail.com>:
>
> Yes, could you show how MasterdataService bean defined?
>
> 2007/4/19, Jörn Zaefferer <jo...@googlemail.com>:
> >
> >
> >  <beans
> > >  xmlns=" http://www.springframework.org/schema/beans"
> > >  xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> > >  xsi:schemaLocation=" http://www.springframework.org/schema/beans
> > > [url]http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">[/url]
> > >
> > >
> > >  <!-- ========================= GENERAL DEFINITIONS
> > > ========================= -->
> > >
> > >  <bean id="messageSource"
> > >  class="org.springframework.context.support.ResourceBundleMessageSource">
> > >  <property name="basenames">
> > >  <list>
> > >  <value>br.com.teste.ui.resource.test_messages</value>
> > >  <value>br.com.teste.ui.resource.security_messages</value>
> > >  </list>
> > >  </property>
> > >  </bean>
> > >
> > >  <!-- ========================= Start of SERVICE DEFINITIONS
> > > ========================= -->
> > >  <bean id="loginHandler" class="
> > > br.com.teste.ui.security.SimpleLoginHandler"/>
> > >
> > >  <bean id="articleHandler" class="
> > > br.com.teste.ui.artikeldaten.ArticleManager">
> > >  <property name="MasterdataService">
> > >  <ref bean="MasterdataService"/>
> > >  </property>
> > >  </bean>
> > >
> > >  </beans>
> > >
> > > And i get the same error message.
> >
> >
> > I don't see MasterdataService defined anywhere. Am I missing something?
> >
> >
>
>
> --
> With Best Regards,
> Alexey Kakunin, EmDev Limited
>
> Professional Software Development:
> http://www.emdev.ru




-- 
Att.
Edney Marcel Imme

Re: Problem mit Spring and JSF integration

Posted by Alexey Kakunin <ak...@gmail.com>.
Yes, could you show how MasterdataService bean defined?

2007/4/19, Jörn Zaefferer <jo...@googlemail.com>:
>
>
>  <beans
> >  xmlns=" http://www.springframework.org/schema/beans"
> >  xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
> >  xsi:schemaLocation=" http://www.springframework.org/schema/beans
> > [url]http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">[/url]
> >
> >
> >  <!-- ========================= GENERAL DEFINITIONS
> > ========================= -->
> >
> >  <bean id="messageSource"
> >  class="org.springframework.context.support.ResourceBundleMessageSource">
> >  <property name="basenames">
> >  <list>
> >  <value>br.com.teste.ui.resource.test_messages</value>
> >  <value>br.com.teste.ui.resource.security_messages</value>
> >  </list>
> >  </property>
> >  </bean>
> >
> >  <!-- ========================= Start of SERVICE DEFINITIONS
> > ========================= -->
> >  <bean id="loginHandler" class="
> > br.com.teste.ui.security.SimpleLoginHandler"/>
> >
> >  <bean id="articleHandler" class="
> > br.com.teste.ui.artikeldaten.ArticleManager">
> >  <property name="MasterdataService">
> >  <ref bean="MasterdataService"/>
> >  </property>
> >  </bean>
> >
> >  </beans>
> >
> > And i get the same error message.
>
>
> I don't see MasterdataService defined anywhere. Am I missing something?
>
>


-- 
With Best Regards,
Alexey Kakunin, EmDev Limited

Professional Software Development:
http://www.emdev.ru

Re: Problem mit Spring and JSF integration

Posted by Jörn Zaefferer <jo...@googlemail.com>.
>  <beans
>  xmlns="http://www.springframework.org/schema/beans"
>  xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://www.springframework.org/schema/beans
> [url]http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">[/url]
>
>
>  <!-- ========================= GENERAL DEFINITIONS
> ========================= -->
>
>  <bean id="messageSource"
>  class="org.springframework.context.support.ResourceBundleMessageSource">
>  <property name="basenames">
>  <list>
>  <value>br.com.teste.ui.resource.test_messages</value>
>  <value>br.com.teste.ui.resource.security_messages</value>
>  </list>
>  </property>
>  </bean>
>
>  <!-- ========================= Start of SERVICE DEFINITIONS
> ========================= -->
>  <bean id="loginHandler" class="
> br.com.teste.ui.security.SimpleLoginHandler"/>
>
>  <bean id="articleHandler" class="
> br.com.teste.ui.artikeldaten.ArticleManager">
>  <property name="MasterdataService">
>  <ref bean="MasterdataService"/>
>  </property>
>  </bean>
>
>  </beans>
>
> And i get the same error message.


I don't see MasterdataService defined anywhere. Am I missing something?