Spring autowiring

ghostflash

New Member
I have a Spring 3.0 project that I'm trying to wire up that has a dependency on a library project (also Spring 3.0) which has several classes that have properties being injected via org.springframework.beans.factory.annotation.Value. I do not need the classes with injected properties to be loaded nor the properties to be injected. I only need one specific class to be autowired from the library project.I keep getting the following exception:\[code\]Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String com.example.library.controller.App.dir; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'app.achDir'at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:502)at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:84)at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:282)... 38 moreCaused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'app.achDir' at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:173) at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:125) at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer$PlaceholderResolvingStringValueResolver.resolveStringValue(PropertyPlaceholderConfigurer.java:403) at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:736) at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:713) at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:703) at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:474) ... 40 more\[/code\]Here is the snippet of my applicationContext.xml. I have tried several versions of the following but the exclusions/inclusion filters do not appear to work.\[code\]<context:component-scan base-package="com.example.library" > <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Service"/> </context:component-scan>\[/code\]
 
Back
Top