009-10-29 14:12:01,656 ERROR [org.springframework.web.context.ContextLoader] - <Context initialization failed>
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dateserver' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:478)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3827)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4336)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:761)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:741)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:120)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1023)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1015)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
at org.apache.catalina.core.StandardService.start(StandardService.java:448)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:552)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)

解决方案 »

  1.   

    从异常中可以看出 是applicationContext.xml这个文件里面创建dataserver时出错了 
    楼主提问关于框架整合的问题的时候  请给出各个框架的版本号
    不然问题不好解决
      

  2.   

    Failed to convert property value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO': no matching editors or conversion strategy found 跟事务有什么关系?
      

  3.   

    xml文件配置问题(注入对象类型不一致),贴代码出来
      

  4.   

    把你的applicationContext.xml贴出来看看
      

  5.   

    'dateDecompoundDAO'  创建错误
      

  6.   

    Failed to convert property value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy0] to required type [com.dao.DateDecompoundDAO] for property 'dateDecompoundDAO': no matching editors or conversion strategy found 
      

  7.   

    default-autowire="byName">
    <bean id="database" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name="driverClassName"
    value="com.microsoft.sqlserver.jdbc.SQLServerDriver">
    </property>
    <property name="url"
    value="jdbc:sqlserver://134.23.100.28;databaseName=ril">
    </property>
    <property name="username" value="sa"></property>
    <property name="password" value="qwer1234"></property>
    <property name="maxWait" value="2"></property>
    <property name="maxIdle" value="20"></property>
    <property name="maxActive" value="200"></property>
    <property name="minIdle" value="3"></property>
    <property name="initialSize" value="3"></property>
    <property name="removeAbandonedTimeout" value="500"></property>
    <property name="removeAbandoned" value="true"></property>
    <property name="logAbandoned" value="true"></property>
    </bean>
    <bean id="sessionFactory"
    class=" org.springframework.orm.hibernate3.LocalSessionFactoryBean">
    <property name="dataSource">
    <ref bean="database" />
    </property>
    <property name="hibernateProperties">
    <props>
    <prop key="hibernate.dialect">
    org.hibernate.dialect.SQLServerDialect
    </prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.format_sql">true</prop>
        <!--  <prop key="hibernate.hbm2ddl.auto">update</prop>  --> 
    </props>
    </property>
    <property name="mappingResources">
    <list>
    <value>com/dao/hbm/ProduceProjet.hbm.xml</value>
    <value>com/dao/hbm/DateDecompound.hbm.xml</value>
    <value>com/dao/hbm/Workpost.hbm.xml</value>
    <value>com/dao/hbm/Depts.hbm.xml</value>
    <value>com/dao/hbm/WorkStationInfo.hbm.xml</value>
    <value>com/dao/hbm/ProduceLineInfo.hbm.xml</value>
    <value>com/dao/hbm/Users.hbm.xml</value>
    <value>com/dao/hbm/Infoviewtbl.hbm.xml</value>
    <value>com/dao/hbm/EfficiencyInfo.hbm.xml</value>
    <value>com/dao/hbm/Productivityveiw.hbm.xml</value>
    <value>com/dao/hbm/Ordertble.hbm.xml</value>
    <value>com/dao/hbm/Product.hbm.xml</value>
    <value>com/dao/hbm/EverydayProduct.hbm.xml</value>
    <value>com/dao/hbm/Infoviewtble.hbm.xml</value>
    <value>com/dao/hbm/OrderEnforce.hbm.xml</value>
    <value>com/dao/hbm/Abnormity.hbm.xml</value>
    </list>
    </property>
    </bean>



    <bean id="transactionManager"  
            class="org.springframework.orm.hibernate3.HibernateTransactionManager">  
            <property name="sessionFactory" ref="sessionFactory" />  
        </bean>  
    <bean id="transactionInterceptor"     
            class="org.springframework.transaction.interceptor.TransactionInterceptor">     
            <property name="transactionManager" ref="transactionManager" />     
             
            <property name="transactionAttributes">     
                <props>     
                    <prop key="*">PROPAGATION_REQUIRED</prop>     
                </props>     
            </property>     
        </bean>  
        
           <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">         
            <property name="interceptorNames">     
                <list>     
                    <value>transactionInterceptor</value>  
                </list>     
            </property>   
             <property name="beanNames">     
                <list>     
                    <value>*erver</value>  
                </list>     
            </property> 
        </bean>

    <!-- 
    everydayserver   productserver
    producelinServer  imlpserver
    dateserver  deptserver
    eddiciencyserver  infoviewserver
    workpostserver  workserver
    userserver  orderserver
    ppserver  everydayServer
    orderenforeserver  abnormityservice  -->







    <!-- 定义事务管理器(声明式的事务) -->
    <!-- 
    <bean id="transactionManager"
    class="org.springframework.orm.hibernate3.HibernateTransactionManager">
    <property name="sessionFactory" ref="sessionFactory" />
    </bean> 
    <bean id="transaction"  
    class="org.springframework.transaction.interceptor.NameMatchTransactionAttributeSource"> 
    -->
    <!-- 配置事务属性 -->
    <!--  <property name="properties">  
    <props>  
    <prop key="*">PROPAGATION_REQUIRED</prop>  
    </props>  
    </property>  
    </bean>
    <bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
    <property name="transactionManager" ref="transactionManager"></property>
    <property name="transactionAttributeSource" >
    <ref local="transaction"/>
    </property>
    </bean> 
    <bean class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator">  
    <property name="beanNames">  
    <list>  
    <value>dateDecompoundDAO</value>
    </list>  
    </property>  
    <property name="interceptorNames">  
    <list>  
    <value>transactionInterceptor</value>  
    </list>  
    </property>  
    </bean> 
    <bean class="org.springframework.transaction.interceptor.TransactionAttributeSourceAdvisor">
    <property name="transactionInterceptor" ref="transactionInterceptor"></property>
    </bean>
    <bean id="datedecompound" class="com.dao.DateDecompound"></bean>
    <bean id="produceLineInfo" class="com.dao.ProduceLineInfo"></bean>
    <bean id="workpost" class="com.dao.Workpost"></bean>
    <bean id="depts" class="com.dao.Depts"></bean>

    </property>
    </bean>
    <bean id="datedecompound" class="com.dao.DateDecompound"></bean>
    <bean id="produceLineInfo" class="com.dao.ProduceLineInfo"></bean>
    <bean id="workpost" class="com.dao.Workpost"></bean>
    <bean id="depts" class="com.dao.Depts"></bean>

    <bean id="workstationInfo" class="com.dao.WorkStationInfo"></bean>
    -->

    <bean id="dateDecompoundDAO" class="com.dao.DateDecompoundDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="workpostDAO" class="com.dao.WorkpostDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="deptsDAO" class="com.dao.DeptsDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="workStationInfoDAO" class="com.dao.WorkStationInfoDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="produceLineInfoDAO" class="com.dao.ProduceLineInfoDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="usersDAO" class="com.dao.UsersDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="infoviewtblDAO" class="com.dao.InfoviewtblDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="produceProjetDAO" class="com.dao.ProduceProjetDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="efficiencyInfoDAO" class="com.dao.EfficiencyInfoDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="productivityveiwDAO"
    class="com.dao.ProductivityveiwDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="ordertbleDAO" class="com.dao.OrdertbleDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory"></ref>
    </property>
    </bean>
    <bean id="prodctdao" class="com.dao.ProductDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory"></ref>
    </property>
    </bean>
    <bean id="everydayProductDAO" class="com.dao.EverydayProductDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="infoviewtbleDAO" class="com.dao.InfoviewtbleDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="orderEnforceDAO" class="com.dao.OrderEnforceDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <bean id="abnormityDAO" class="com.dao.AbnormityDAO">
    <property name="sessionFactory">
    <ref bean="sessionFactory" />
    </property>
    </bean>
    <!-- 服务类server-->
    <bean id="everydayserver" class="com.serverbiz.Everydayserver"></bean> <bean id="productserver" class="com.serverbiz.Productserver"></bean>
    <bean id="producelinServer" class="com.biz.ProducelineServer"></bean>
    <bean id="imlpservers" class="com.show.Imlpserver"></bean>
    <bean id="dateserver" class="com.biz.DateServer"></bean>
    <bean id="deptserver" class="com.biz.Deptserver"></bean>
    <bean id="eddiciencyserver" class="com.biz.Efficiencyserver"></bean>
    <bean id="infoviewserver" class="com.biz.Infoviewserver"></bean>
    <bean id="workpostserver" class="com.biz.Workpostserver"></bean>
    <bean id="workserver" class="com.biz.WorkstationServer"></bean>
    <bean id="userserver" class="com.biz.Userserver" />

    <!-- 订单计划的业务类-->
    <bean id="orderserver" class="com.serverbiz.Orderserver"></bean>
    <bean id="ppserver" class="com.serverbiz.Ppserver"></bean>
    <bean id="everydayServer" class="com.serverbiz.Everydayserver"></bean>
    <bean id="orderenforeserver"
    class="com.serverbiz.Orderenforeserver">
    </bean>
    <bean id="abnormityservice" class="com.serverbiz.Abnormityservice"></bean>
    </beans>
      

  8.   

    什么意思我不太明白,我要在DAO里添加事务