org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language'

Spring JIRA | Bernd Kolb | 10 years ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    Tested with M2 and M3 20070801.023929-78 My metadata description looks as follows: <?xml version="1.0" encoding="UTF-8"?> <metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> <OCD id="spring.helloworld.translation.metadata" name="TranslationService-Konfiguration" description="Die Konfiguration des TranslationService"> <AD id="translation.language" type="String" default="de" name="Sprache" description="Der Sprach-Code des TranslationService" cardinality="0"> <Option label="deutsch" value="de" /> <Option label="english" value="en" /> </AD> <AD id="translation.country" type="String" default="DE" name="Land" description="Der Laender-Code des TranslationService" cardinality="0"> <Option label="Deutschland" value="DE" /> <Option label="USA" value="US" /> </AD> </OCD> <Designate pid="spring.helloworld.translation.MetadataProvider"> <Object ocdref="spring.helloworld.translation.metadata" /> </Designate> </metatype:MetaData> The bean.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.0-m3.xsd"> <osgi:property-placeholder persistent-id="spring.helloworld.translation.metadata" /> <bean id="translationService" class="spring.helloworld.internal.translation.TranslationServiceImpl"> <constructor-arg value="${translation.language}"></constructor-arg> <constructor-arg value="${translation.country}"></constructor-arg> </bean> <osgi:service ref="translationService" interface="spring.helloworld.translation.TranslationService"> </osgi:service> <osgi:config id="myAppProperties" persistent-id="spring.helloworld.translation.metadata"> <osgi:config-listener ref="translationService" update-method="updateProperties" /> </osgi:config> </beans> osgi:config is working OK, but osgi:property-placeholder does not work. I am getting the following stack trace: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:249) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:467) at org.springframework.osgi.context.support.AbstractRefreshableOsgiBundleApplicationContext.preRefresh(AbstractRefreshableOsgiBundleApplicationContext.java:404) at org.springframework.osgi.extender.support.ServiceDependentOsgiBundleXmlApplicationContext.refresh(ServiceDependentOsgiBundleXmlApplicationContext.java:81) at org.springframework.osgi.extender.ContextLoaderListener$1.run(ContextLoaderListener.java:408) at java.lang.Thread.run(Unknown Source) Kind regards, Bernd

    Spring JIRA | 10 years ago | Bernd Kolb
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language'
  2. 0

    Tested with M2 and M3 20070801.023929-78 My metadata description looks as follows: <?xml version="1.0" encoding="UTF-8"?> <metatype:MetaData xmlns:metatype="http://www.osgi.org/xmlns/metatype/v1.0.0"> <OCD id="spring.helloworld.translation.metadata" name="TranslationService-Konfiguration" description="Die Konfiguration des TranslationService"> <AD id="translation.language" type="String" default="de" name="Sprache" description="Der Sprach-Code des TranslationService" cardinality="0"> <Option label="deutsch" value="de" /> <Option label="english" value="en" /> </AD> <AD id="translation.country" type="String" default="DE" name="Land" description="Der Laender-Code des TranslationService" cardinality="0"> <Option label="Deutschland" value="DE" /> <Option label="USA" value="US" /> </AD> </OCD> <Designate pid="spring.helloworld.translation.MetadataProvider"> <Object ocdref="spring.helloworld.translation.metadata" /> </Designate> </metatype:MetaData> The bean.xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/osgi http://www.springframework.org/schema/osgi/spring-osgi-1.0-m3.xsd"> <osgi:property-placeholder persistent-id="spring.helloworld.translation.metadata" /> <bean id="translationService" class="spring.helloworld.internal.translation.TranslationServiceImpl"> <constructor-arg value="${translation.language}"></constructor-arg> <constructor-arg value="${translation.country}"></constructor-arg> </bean> <osgi:service ref="translationService" interface="spring.helloworld.translation.TranslationService"> </osgi:service> <osgi:config id="myAppProperties" persistent-id="spring.helloworld.translation.metadata"> <osgi:config-listener ref="translationService" update-method="updateProperties" /> </osgi:config> </beans> osgi:config is working OK, but osgi:property-placeholder does not work. I am getting the following stack trace: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language' at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:249) at org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:467) at org.springframework.osgi.context.support.AbstractRefreshableOsgiBundleApplicationContext.preRefresh(AbstractRefreshableOsgiBundleApplicationContext.java:404) at org.springframework.osgi.extender.support.ServiceDependentOsgiBundleXmlApplicationContext.refresh(ServiceDependentOsgiBundleXmlApplicationContext.java:81) at org.springframework.osgi.extender.ContextLoaderListener$1.run(ContextLoaderListener.java:408) at java.lang.Thread.run(Unknown Source) Kind regards, Bernd

    Spring JIRA | 10 years ago | Bernd Kolb
    org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language'
  3. 0

    Could not resolve properties placeholder, when the properties internally have a placeholders

    Stack Overflow | 4 years ago | Rishi
    org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'MyQueryBuilder' defined in URL [jar:file:/C:/apache-tomcat-6.0.35/webapps/my-service/WEB-INF/lib/my-app-1.0.2.RC8-SNAPSHOT.jar!/META-INF/spring/config/app-context.xml]: Could not resolve placeholder 'marketId'
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    View topic - issue integrating broadleaf, when running standalone • Broadleaf Commerce Discussion Forums

    broadleafcommerce.org | 1 year ago
    org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'blUploadUrlMapping' defined in class path resource [applicationContext-servlet-cms-contentClient.xml]: Could not resolve placeholder 'asset.server.url.prefix'
  6. 0

    [SPR-4477] PropertyPlaceholderConfigurer - nested placeholders don't work in placeholder keys - Spring JIRA

    spring.io | 1 year ago
    org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in class path resource : Could not resolve placeholder '${environment'

    15 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.springframework.beans.factory.BeanDefinitionStoreException

      Error registering bean with name 'translationService' defined in OSGi res[/META-INF/spring/beans.xml|id=23|symName=spring.helloworld.translation]: Could not resolve placeholder 'translation.language'

      at org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties()
    2. Spring Beans
      PropertyResourceConfigurer.postProcessBeanFactory
      1. org.springframework.beans.factory.config.PropertyPlaceholderConfigurer.processProperties(PropertyPlaceholderConfigurer.java:249)
      2. org.springframework.beans.factory.config.PropertyResourceConfigurer.postProcessBeanFactory(PropertyResourceConfigurer.java:75)
      2 frames
    3. Spring Context
      AbstractApplicationContext.invokeBeanFactoryPostProcessors
      1. org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:467)
      1 frame
    4. Spring OSGi Core
      AbstractRefreshableOsgiBundleApplicationContext.preRefresh
      1. org.springframework.osgi.context.support.AbstractRefreshableOsgiBundleApplicationContext.preRefresh(AbstractRefreshableOsgiBundleApplicationContext.java:404)
      1 frame
    5. org.springframework.osgi
      ContextLoaderListener$1.run
      1. org.springframework.osgi.extender.support.ServiceDependentOsgiBundleXmlApplicationContext.refresh(ServiceDependentOsgiBundleXmlApplicationContext.java:81)
      2. org.springframework.osgi.extender.ContextLoaderListener$1.run(ContextLoaderListener.java:408)
      2 frames
    6. Java RT
      Thread.run
      1. java.lang.Thread.run(Unknown Source)
      1 frame