Announcement

Collapse
No announcement yet.

Fehler bei Spring und JSF

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Fehler bei Spring und JSF

    Hallo

    In mein projekt wie arbeiten mit Spring und JSF.
    Wir haben diese fehler bei unsere integration.

    2007-04-18 10:10:14,051 ERROR [main ] (ContextLoader.java:205) Context initialization failed org.springframework.beans.factory.BeanCreationExce ption: 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/Projekt/WEB-INF/classes/applicationContext-jsf.xml]: Error setting property values; nested exception is org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessExceptions (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [com.teste.logic.command.masterdata.service.Masterd ataService] for property 'masterdataService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5] to required type [com.teste.logic.command.masterdata.service.Masterd ataService] for property 'masterdataService': no matching editors or conversion strategy found Caused by: org.springframework.beans.PropertyBatchUpdateExcep tion; nested PropertyAccessException details (1) are: PropertyAccessException 1: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy5] to required type [com.teste.logic.command.masterdata.service.Masterd ataService] for property 'masterdataService'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5] to required type [com.teste.logic.command.masterdata.service.Masterd ataService] for property 'masterdataService': no matching editors or conversion strategy found Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy5] to required type [com.teste.logic.command.masterdata.service.Masterd ataService] for property 'masterdataService': no matching editors or conversion strategy found at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:224) at org.springframework.beans.TypeConverterDelegate.co nvertIfNecessary(TypeConverterDelegate.java:139) at org.springframework.beans.BeanWrapperImpl.setPrope rtyValue(BeanWrapperImpl.java:772)


    Mein datei applicationContext-jsf.xml ist so.


    <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 http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

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

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

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

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

    <bean id="userList" class="com.test.ui.usermanagement.UserListManager" >
    <property name="MasterdataService">
    <ref bean="MasterdataService"/>
    </property>
    </bean>

    </beans>

  • #2
    Und hier ist mein faces-config.xml

    <?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.js p.JspTilesViewHandlerImpl</view-handler>
    <variable-resolver>org.springframework.web.jsf.DelegatingVar iableResolver</variable-resolver>
    <locale-config>
    <default-locale>en</default-locale>

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

    Comment


    • #3
      Das ist ein reines Spring-Context-Problem und hat nichts mit JSF zu tun, da die PropertyAccessException schon beim Laden des Spring-Context auftritt.

      Sie tritt auf, weil Du in articleHandler eine Bean injezierst, deren Typ nicht zur Methodensignatur von public void setMasterDataService(MasterDataService mds) passt. Es sieht so aus, als wäre die Bean MasterDataService ein (möglicherweise nicht richtig konfigurierter) dynamischer Proxy auf die eigentliche Bean. Leider hast Du die zugehörigen Definitionen nicht gepostet (Gibt es noch weitere Spring-Context-XML-Dateien?), so dass ich viel mehr dazu nicht sagen kann.

      Gruß
      Hendrik

      PS: 1x posten reicht!

      Comment

      Working...
      X