Vote count:
0
i am creating a bean in a Java class using @Bean(name="query") annotation and using this to set a property of another in apllicationContext.xml like below :
<beans:property name="dataSource" ref="dataSource" />
<beans:property name="sql" value="#{query.selectClause}"/>
<beans:property name="rowMapper">
Its working fine if I execute this spring batch program directly in unix or eclipse using build.xml but when i run the same using autosys job its not able to find that bean, givng below error :
2015-02-04 05:09:01,765 ERROR [org.springframework.batch.core.step.AbstractStep] - Encountered an error executing the step org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'lazyBindingProxy.viewReader#sysinit' defined in class path resource [config/appl icationContext.xml]: Initialization of bean failed; nested exception is java.lang.IllegalStateException: Cannot bind to placeholder: query.selectClause 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$2.getObject(AbstractBeanFactory.java:302) at org.springframework.batch.core.scope.StepScope.get(StepScope.java:150) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) 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.batch.core.scope.util.PlaceholderTargetSource.getTarget(PlaceholderTargetSource.java:185) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:184) at $Proxy9.open(Unknown Source)
PLEASE SUGGEST WHAT TO DO ......
java.lang.IllegalStateException: Cannot bind to placeholder: query.selectClause
Aucun commentaire:
Enregistrer un commentaire