Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Edited the way code posted.
Source Link

I am using Intellj to run my Spring Boot application which has application.yml file with place holdersholder. The values of placeholder toshould be injected at run time depending upon the environment'senvironment configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.urlserver: ${KAFKA_SCHEMA_REGISTRY}   brokersport: ${KAFKA_BOOTSTRAP_SERVERSSERVER_PORT} 

I am trying to run the Spring Boot application from Intellij whileby passing the place holder valuesvalue in the below format:

![intellijEnvironment Variable section of application run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: **Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"** Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" 

Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}"

I am using Intellj to run my Spring Boot application which has application.yml file with place holders. The values of placeholder to be injected at run time depending upon the environment's configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.url: ${KAFKA_SCHEMA_REGISTRY}   brokers: ${KAFKA_BOOTSTRAP_SERVERS} 

I am trying to run the Spring Boot application from Intellij while passing the place holder values in the below format:

![intellij run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: **Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"** Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" 

I am using Intellj to run my Spring Boot application which has application.yml file with place holder. The values of placeholder should be injected at run time depending upon the environment configuration.

server: port: ${SERVER_PORT} 

I am trying to run the Spring Boot application from Intellij by passing the place holder value in the Environment Variable section of application run

I am getting below error while running this application:

Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'SERVER_PORT' in value "${SERVER_PORT}"

I am using Intellj to run my Spring Boot application which has application.yml file with place holders. The values of placeholder to be injected at run time depending upon the environmentsenvironment's configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.url: ${KAFKA_SCHEMA_REGISTRY} brokers: ${KAFKA_BOOTSTRAP_SERVERS} 

I am trying to run the Spring Boot application from Intellij bywhile passing the place holder values in the below format:

![intellij run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: **Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"** Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" 

I am using Intellj to run my Spring Boot application which has application.yml file with place holders. The values of placeholder to be injected at run time depending upon the environments configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.url: ${KAFKA_SCHEMA_REGISTRY} brokers: ${KAFKA_BOOTSTRAP_SERVERS} 

I am trying to run Spring Boot application from Intellij by passing the place holder values in the below format:

![intellij run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"

I am using Intellj to run my Spring Boot application which has application.yml file with place holders. The values of placeholder to be injected at run time depending upon the environment's configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.url: ${KAFKA_SCHEMA_REGISTRY} brokers: ${KAFKA_BOOTSTRAP_SERVERS} 

I am trying to run the Spring Boot application from Intellij while passing the place holder values in the below format:

![intellij run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: **Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"** Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" 
Source Link

Inject place holder values at Spring boot application.yml file using intellij at run time

I am using Intellj to run my Spring Boot application which has application.yml file with place holders. The values of placeholder to be injected at run time depending upon the environments configuration.

spring: cloud: stream: bindings: input: group: ${KAFKA_CONSUMER_GROUP} useNativeEncoding: true destination: ${KAFKA_TOPIC} content-type: application/*+avro kafka: binder: autoCreateTopics: false autoAddPartitions: false consumer-properties: key.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer value.deserializer: io.confluent.kafka.serializers.KafkaAvroDeserializer schema.registry.url: ${KAFKA_SCHEMA_REGISTRY} brokers: ${KAFKA_BOOTSTRAP_SERVERS} 

I am trying to run Spring Boot application from Intellij by passing the place holder values in the below format:

![intellij run configuration][1]

I am getting below error while running this application:

Error creating bean with name 'consumerConfig': Injection of autowired dependencies failed; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}" Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'KAFKA_SCHEMA_REGISTRY' in value "${KAFKA_SCHEMA_REGISTRY}"