0

I have a spring application with multiple profile like dev,prod. application running on external tomcat.profile are setting in the pom.xml file

pom.xml

<profiles>
        <profile>
            <id>dev</id>
            <properties>
            <repoManager>Manager1</repoManager>
             ..........
            </properties>
        </profile>
</profiles>

Project have applicationContext.xml file. One of the bean definition, we are taking repoManager the value from dev profile. when i run the application, throwing the following error

rg.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name '<Class name>' defined in class path resource [applicationContext.xml]: Circular placeholder reference 'repoManager' in property definitions

How to run spring web application with profile dev

I have done following changes

  • Added spring.profiles.active=dev in catalina.properties file enter image description here

  • Added setenv.sh in tomcat bin folder enter image
description here

  • Added spring.profiles.active=dev on STS run configuration

Above 3 solution are not working.

How to solve this problem.

Thanks in advance.

arj
  • 887
  • 1
  • 15
  • 37
  • Your exception is complaining about a "Circular placeholder reference". So maybe this answer will help you. https://stackoverflow.com/a/61232758/7454336 I don't think that this is a problem with different profiles. – Thomas Meinhart Mar 04 '22 at 11:40
  • @ThomasMeinhart ,similar kind of error.am trying to taking value from profile.am bit confused – arj Mar 04 '22 at 11:48

1 Answers1

0

I Got the answer

Right click on the project -> Maven -> Select Maven Profiles... and pickup your profile. enter image description here No Need to do above steps.

arj
  • 887
  • 1
  • 15
  • 37