org.springframework.beans.factory.BeanDefinitionStoreException

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • Also discussed here: http://forum.springframework.org/showthread.php?t=49973 A nested property in Srping config like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="false" /> <property name="location" value="classpath:org/rbram/docpublisher/changeowner/changeowner.properties" /> </bean> <bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close"> <property name="driverClassName"> <value>${${environment}.dataSource.driverClassName}</value> </property> <property name="url"> <value>${${environment}.dataSource.url}</value> </property> <property name="username"> <value>${${environment}.dataSource.username}</value> </property> <property name="password"> <value>${${environment}.dataSource.password}</value> </property> </bean> </beans> With a property file like this: # Environment: local, dev, test, svt or prod. environment=prod prod.dataSource.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=uporac01vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac02vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac03vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac04vip)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORPCORE.cmltd.net.au))) prod.dataSource.username=DOCPUBLISHER_PROD prod.dataSource.password=wescoles07 prod.dataSource.driverClassName=oracle.jdbc.driver.OracleDriver I get this stack trace: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [org/rbram/docpublisher/changeowner/changeOwnerPubApplicationContext.xml]: Could not resolve placeholder '${environment' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516)changeowner.DocumentOwnerChangerSpring(139) - Problem running Document Owner Changer. Rolling back. org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [org/rbram/docpublisher/changeowner/changeOwnerPubApplicationContext.xml]: Could not resolve placeholder '${environment' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99) But the parseStringValue() method in PropertyPlaceholderConfigurer indicates that the logic should recursively evaluate nested properties. Setting ignoreUnresolvablePlaceholders to true just leaves me with literal i.e. unresolves values ${${environment}.dataSource.driverClassName} etc..
    via by Robert Mark Bram,
  • Also discussed here: http://forum.springframework.org/showthread.php?t=49973 A nested property in Srping config like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans> <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="ignoreUnresolvablePlaceholders" value="false" /> <property name="location" value="classpath:org/rbram/docpublisher/changeowner/changeowner.properties" /> </bean> <bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource" destroy-method="close"> <property name="driverClassName"> <value>${${environment}.dataSource.driverClassName}</value> </property> <property name="url"> <value>${${environment}.dataSource.url}</value> </property> <property name="username"> <value>${${environment}.dataSource.username}</value> </property> <property name="password"> <value>${${environment}.dataSource.password}</value> </property> </bean> </beans> With a property file like this: # Environment: local, dev, test, svt or prod. environment=prod prod.dataSource.url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=uporac01vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac02vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac03vip)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=uporac04vip)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=ORPCORE.cmltd.net.au))) prod.dataSource.username=DOCPUBLISHER_PROD prod.dataSource.password=wescoles07 prod.dataSource.driverClassName=oracle.jdbc.driver.OracleDriver I get this stack trace: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [org/rbram/docpublisher/changeowner/changeOwnerPubApplicationContext.xml]: Could not resolve placeholder '${environment' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516)changeowner.DocumentOwnerChangerSpring(139) - Problem running Document Owner Changer. Rolling back. org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [org/rbram/docpublisher/changeowner/changeOwnerPubApplicationContext.xml]: Could not resolve placeholder '${environment' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99) But the parseStringValue() method in PropertyPlaceholderConfigurer indicates that the logic should recursively evaluate nested properties. Setting ignoreUnresolvablePlaceholders to true just leaves me with literal i.e. unresolves values ${${environment}.dataSource.driverClassName} etc..
    via by Robert Mark Bram,
  • Error regeristering Bean (Restlets+Spring)
    via by navneet rajput,
  • After doing a war install, running Tomcat yields the following exception: org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'archivaConfiguration' defined in null: Could not resolve placeholder 'appserver.base' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:261) 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:3727) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4162) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:603) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:535) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:470) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1118) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:310) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1020) at org.apache.catalina.core.StandardHost.start(StandardHost.java:718) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1012) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:442) at org.apache.catalina.core.StandardService.start(StandardService.java:450) at org.apache.catalina.core.StandardServer.start(StandardServer.java:700) at org.apache.catalina.startup.Catalina.start(Catalina.java:551) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:275) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
    via by Michael Mallete,
    • org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource [org/rbram/docpublisher/changeowner/changeOwnerPubApplicationContext.xml]: Could not resolve placeholder '${environment' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:252) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:542) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:516) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:348) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:123) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:66) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.run(DocumentOwnerChangerSpring.java:115) at org.rbram.docpublisher.changeowner.DocumentOwnerChangerSpring.main(DocumentOwnerChangerSpring.java:99)

    Users with the same issue

    Unknown visitor
    Unknown visitor1 times, last one,
    oddodd
    16 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    Unknown visitor
    Unknown visitor1 times, last one,
    11 more bugmates