bean类的属性无效找不到属性

时间:2015-06-25 21:01:49

标签: java spring

这是一个在Prod中运行的应用程序,但我在eclipse中遇到问题。任何帮助将不胜感激。

bean qewProvider具有自动装配属性qewSqlMap

<context:annotation-config/>
<context:component-scan base-package="com.btec.recon"/>
...
  <bean id="qewProvider" class="com.btec.recon.qewProvider">
    <property name="qewSqlMap" ref="sqlMapClientTemplate"/>
  </bean>

public class qewProvider  
{  
  @Autowired  
    private SqlMapClientTemplate qewSqlMap;  
    ...  

尝试执行时出现以下异常:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'qewProvider' defined in URL [file:C:/Apps/eclipse-workspace/btc-eclipse/Juno-qew/btc-qew-recon/context.xml]: Initialization of bean failed; nested exception is org.springframework.beans.InvalidPropertyException: Invalid property 'qewSqlMap' of bean class [com.btec.recon.qewProvider]: No property 'qewSqlMap' 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:221)
  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.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
  at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:94)
  at com.btec.recon.Recon.main(Recon.java:34)
Caused by: org.springframework.beans.InvalidPropertyException: Invalid property 'qewSqlMap' of bean class [com.btec.recon.qewProvider]: No property 'qewSqlMap' found
  at org.springframework.beans.BeanWrapperImpl.convertForProperty(BeanWrapperImpl.java:382)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.convertForProperty(AbstractAutowireCapableBeanFactory.java:1288)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1249)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
  at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
  ... 14 more

0 个答案:

没有答案