OKTA_CLIENT_TOKEN env var prevents Spring Boot app from starting in Docker
See original GitHub issueWhile I’m able to specify these environment variables:
OKTA_CLIENT_ORGURL
OKTA_CLIENT_PROXY_HOST
OKTA_CLIENT_PROXY_PORT
OKTA_OAUTH2_AUDIENCE
as soon as I specify OKTA_CLIENT_TOKEN
the app fails to start in Docker–here’s the log:
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v2.3.4.RELEASE)
2020-11-17 03:06:52,090 (main:[]) INFO [***] Starting *** v2020.12.0-SNAPSHOT on 5bdff47b76-rkdrd with PID 29 (/apps/apache-tomcat/web/WEB-INF/classes started by ebizrt in /apps/apache-tomcat)
2020-11-17 03:06:52,090 (main:[]) DEBUG [***] Running with Spring Boot v2.3.4.RELEASE, Spring v5.2.9.RELEASE
2020-11-17 03:06:52,090 (main:[]) INFO [***] The following profiles are active: ***,cloud,session-replication
2020-11-17 03:06:53,522 (main:[]) ERROR [org.springframework.boot.SpringApplication] Application run failed java.lang.IllegalStateException: Error processing condition on com.okta.spring.boot.sdk.OktaSdkConfig.oktaSdkClientCredentials
at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:60)
at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:184)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:144)
at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:120)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:331)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:236)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:280)
at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:96)
2020-11-17 03:06:53,527 (main:[]) WARN [org.springframework.boot.SpringApplication] Unable to close ApplicationContext java.lang.IllegalStateException: Failed to introspect Class [com.okta.spring.boot.sdk.OktaSdkConfig] from ClassLoader [ParallelWebappClassLoader
context: ROOT
delegate: false
----------> Parent Classloader:
java.net.URLClassLoader@5a8806ef
]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:481)
at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:358)
at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:414)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.lambda$getTypeForFactoryMethod$2(AbstractAutowireCapableBeanFactory.java:742)
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (7 by maintainers)
Top Results From Across the Web
Spring boot app started in docker can not access environment ...
First of all: Do not write down environment related variables to Docker file, use docker-compose on target server instead and prevent future ...
Read more >Topical Guide | Spring Boot Docker
In this guide, we aim to show you some of the choices you can make if you are faced with the prospect of...
Read more >How to Docker with Spring Boot | Okta Developer
Start by creating a Spring Boot application using Spring Boot ... need to run source .okta.env to set these values as environment variables....
Read more >Starting Spring Boot Application in Docker With Profile
4. Setting Profile Using Environment Variables ... Sometimes, it's not convenient to use a hard-coded profile in our Dockerfile. If we need more ......
Read more >Kickstart Your Spring Boot Application Development | Docker
You can run your Spring Boot artifact directly within Docker containers. This is useful when you need to quickly create microservices.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@arvindkrishnakumar-okta yes, @bdemers 2nd suggestion worked out for us (belated thanks, btw)
@garcger-blk did that help for now (until we upgrade
okta-spring-boot
)?