日期:2014-05-20  浏览次数:20868 次

spring bean 无法创建,以前都是正常的,这次搞了一个下午,帮看看
[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

------解决方案--------------------
chanceActionb里的chanceBiz貌似有问题。你的chanceBiz对应的类型也进行了注入了吗?
------解决方案--------------------
Java code

conversion strategy found - action - file:/D:/Tools/apache-tomcat-6.0.32/webapps/crm/WEB-INF/classes/struts.xml:13:46

struts.xml中的配置有问题。。看看命令空间的配置。。。等。。。

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