[ERROR] method:org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:215)
Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chanceActionb' defined in class path resource [cfg/applicationContext-sale.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion strategy found
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
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:222)
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:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
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:4205)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4704)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1282)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1380)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:306)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1385)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1649)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1658)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1638)
at java.lang.Thread.run(Thread.java:619)
Caused by: org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion strategy found
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:391)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1289)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1250)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
... 25 more
Caused by: java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:231)
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:138)
at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:386)
... 29 more
2011-11-27 17:36:22 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'chanceActionb' defined in class path resource [cfg/applicationContext-sale.xml]: Initialization of bean failed; nested exception is org.springframework.beans.TypeMismatchException: Failed to convert property value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy9 implementing com.accp.crm.biz.IChanceBiz,org.springframework.aop.SpringProxy,org.springframework.aop.framework.Advised] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion 

解决方案 »

  1.   

    chanceActionb里的chanceBiz貌似有问题。你的chanceBiz对应的类型也进行了注入了吗?
      

  2.   

    <!-- DAO -->
    <bean id="ChanceDao" class="com.accp.crm.dao.hbnimpl.ChanceDao"
    parent="GenericDao" >
    <constructor-arg value="com.accp.crm.model.SalChance"></constructor-arg>
    </bean> <!-- BIZ -->
    <bean id="ChanceBiz" class="com.accp.crm.biz.impl.ChanceBiz">
    <property name="chanceDao" ref="ChanceDao"></property>
    </bean> <!-- ACTION -->
    <bean id="chanceActionb"
    class="com.accp.crm.web.action.ChanceAction" scope="singleton">
    <property name="chanceBiz" ref="ChanceBiz"></property>
    </bean>
      

  3.   

    <property   name= "chanceDao "   ref= "ChanceDao "> </property> 
    <property   name= "chanceBiz "   ref= "ChanceBiz "> </property> 
    这两句应该这样写吧
    <property   name= "chanceDao ">
      <ref= "ChanceDao "/> 
     </property> 
    <property   name= "chanceBiz ">
     <ref= "ChanceBiz"/>
     </property> 
      

  4.   

    javax.servlet.ServletException: Unable to instantiate Action, chanceAction,  defined for 'chance' in namespace '/'Error creating bean with name 'chanceAction' defined in class path resource [cfg/applicationContext-sale.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 [$Proxy2] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy2] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion strategy found - action - file:/D:/Tools/apache-tomcat-6.0.32/webapps/crm/WEB-INF/classes/struts.xml:13:46
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:515)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)
    root cause Unable to instantiate Action, chanceAction,  defined for 'chance' in namespace '/'Error creating bean with name 'chanceAction' defined in class path resource [cfg/applicationContext-sale.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 [$Proxy2] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz'; nested exception is java.lang.IllegalArgumentException: Cannot convert value of type [$Proxy2] to required type [com.accp.crm.biz.impl.ChanceBiz] for property 'chanceBiz': no matching editors or conversion strategy found - action - file:/D:/Tools/apache-tomcat-6.0.32/webapps/crm/WEB-INF/classes/struts.xml:13:46
    com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:294)
    com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:365)
    com.opensymphony.xwork2.DefaultActionInvocation.access$000(DefaultActionInvocation.java:38)
    com.opensymphony.xwork2.DefaultActionInvocation$1.doProfiling(DefaultActionInvocation.java:83)
    com.opensymphony.xwork2.util.profiling.UtilTimerStack.profile(UtilTimerStack.java:455)
    com.opensymphony.xwork2.DefaultActionInvocation.<init>(DefaultActionInvocation.java:74)
    com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:189)
    org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:41)
    org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:494)
    org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:419)设置action的scope为propertype 点击页面会报这种错.
      

  5.   


    <bean   id= "ChanceBiz "   class= "com.accp.crm.biz.impl.ChanceBiz ">
    <property   name= "chanceDao "   ref= "ChanceDao "> </property>
    </bean> 你的配置文件中有很多空格如id= "ChanceBiz ",name= "chanceDao "都多了一个空格。将所有的空格去掉就好了改成:如id= "ChanceBiz",  name= "chanceDao"
      

  6.   


    conversion strategy found - action - file:/D:/Tools/apache-tomcat-6.0.32/webapps/crm/WEB-INF/classes/struts.xml:13:46struts.xml中的配置有问题。。看看命令空间的配置等
      

  7.   

    楼上说的很对,你试试了,你多了空格,同时告诉你一声
    设置action的scope为propertype
    这是说每次都会创建一个action,而不是单例模式,具体什么错误你自己多看看吧,ssh设计的配置文件太多了,一下子看不过来!
      

  8.   

    已经解决,是spring aop相关的问题导致biz无法创建,把代理直接交给类来创建就好了
    http://www.husoft.org/?p=46