The system is Windows11 ( for the development of the project ).
In the application.properties
there are references to keys of a .env
file which is located on the root folder of the project :
application.properties :
[email protected]@
api.url = ${APP_API_URL}
api.site.url = ${APP_SITE_URL}/api
signup.url = ${APP_SITE_URL}
server.port=9000
BALANCE_PLATFORM_API_KEY = ${ADYEN_BALANCE_PLATFORM_API_KEY}
BALANCE_PLATFORM = Multimicro
SCOPE_COMPANY_KEY = ${ADYEN_SCOPE_COMPANY_KEY}
ONBOARDING = ${ADYEN_ONBOARDING}
thermal.printer.url = ${APP_PRINT_URL}
ADYEN_MERCHANT_ACCOUNT=MultimicroECOM
ADYEN_MERCHANT_ACCOUNT_POS=MultimicroPOS
HMAC_KEY=ieruoweriugdfkjgwoieruh
ADYEN_API_KEY=${ADYEN_API_KEY}
KEY_TERMINAL=${ADYEN_KEY_TERMINAL}
the .env file :
APP_API_URL=http://localhost:8000/api
APP_SITE_URL=http://localhost:7000/api
ADYEN_BALANCE_PLATFORM_API_KEY=AQE0hmfxJorGbBBCw0ixnmU2pOGrRIpZC5xYVSt703S/l2tCndV593sKXCu5xgXDNJ49YvvXeRDBXVsNvuR83LVYjEgiTGAH-RTfKXigvYhOkCNqt/beyhhj+Ua2cIDLxXv+OjBr/b0E=-8HK}[KvQ)<Q%%=hQ
ADYEN_SCOPE_COMPANY_KEY = AQEyhmfxKYjPaBxFw1mznXQ96ceURZtMA4p1dXBa0nGml2VZkTuQOBID/JW0OqJo9lyYXX8QwV1bDb7kfNy1WIxIIkxgBw==-IEWOvIxf76rN+RRPZp8jEzDXHH+eQX5CWkxtHt9QYaI=-~}2y^XLzsm6e8gDq
ADYEN_ONBOARDING=ONBT422JV223224T5JWN6NN55G2THF
APP_PRINT_URL=http://localhost:5000
ADYEN_API_KEY=AQEshmfxLYnMbxNFw0m/n3Q5qf3VZZ5BGZpHUWZEyVyGZVU6i/zTs9/RFhFFItcQwV1bDb7kfNy1WIxIIkxgBw==-HQJWKhwnsPiRuKYE9fuMQ7sJhWxeIO0O11RyirK5Vmw=-xTy}.Tk5~)g>ZC@S
ADYEN_KEY_TERMINAL=AQEshmfxLonPbhdAw0m/n3Q5qf3VZZ5BGZpHUWZEycwmaIP0kqHo35UJAG9zgAMQwV1bDb7kfNy1WIxIIkxgBw==-iO75bqUlM12NVqjnnChweWrDIp0M8SfYKe8TFvvOOdk=-KY_5.>a=Dw4#_sHT
APP_FRONT_URL=http://localhost:8080
When I run the project then I get this on the terminal :
PS C:ProjetsMAT V2> & 'C:Program FilesJavajdk-17binjava.exe' '@C:UsersandyAppDataLocalTempcp_5s8gfzxhmneufsrwjzfgbhzwn.argfile' 'com.fnptechnologies.backend.BackendApplication'
. ____ _ __ _ _
/\ / ___'_ __ _ _(_)_ __ __ _
( ( )___ | '_ | '_| | '_ / _` |
\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v3.1.2)
2024-06-20T15:33:39.278+03:00 INFO 12820 --- [ restartedMain] c.f.backend.BackendApplication : Starting BackendApplication using Java 17.0.10 with PID 12820 (C:ProjetsMAT V2backend-uitargetclasses started by andy in C:ProjetsMAT V2)
2024-06-20T15:33:39.281+03:00 INFO 12820 --- [ restartedMain] c.f.backend.BackendApplication : No active profile set, falling back to 1 default profile: "default"
2024-06-20T15:33:39.363+03:00 INFO 12820 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2024-06-20T15:33:39.366+03:00 INFO 12820 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2024-06-20T15:33:41.384+03:00 INFO 12820 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 9000 (http)
2024-06-20T15:33:41.419+03:00 INFO 12820 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2024-06-20T15:33:41.420+03:00 INFO 12820 --- [ restartedMain] o.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/10.1.11]
2024-06-20T15:33:41.595+03:00 INFO 12820 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2024-06-20T15:33:41.595+03:00 INFO 12820 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 2228 ms
2024-06-20T15:33:41.717+03:00 WARN 12820 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config': Injection of autowired dependencies failed
2024-06-20T15:33:41.722+03:00 INFO 12820 --- [ restartedMain] o.apache.catalina.core.StandardService : Stopping service [Tomcat]
2024-06-20T15:33:41.758+03:00 INFO 12820 --- [ restartedMain] .s.b.a.l.ConditionEvaluationReportLogger :
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled.
2024-06-20T15:33:41.801+03:00 ERROR 12820 --- [ restartedMain] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'config': Injection of autowired dependencies failed
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:489) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1416) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:597) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:520) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:973) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:942) ~[spring-context-6.0.11.jar:6.0.11]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:608) ~[spring-context-6.0.11.jar:6.0.11]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:734) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:436) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1306) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1295) ~[spring-boot-3.1.2.jar:3.1.2]
at com.fnptechnologies.backend.BackendApplication.main(BackendApplication.java:12) ~[classes/:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:568) ~[na:na]
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50) ~[spring-boot-devtools-3.1.2.jar:3.1.2]
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'APP_API_URL' in value "${APP_API_URL}"
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:180) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.AbstractPropertyResolver.resolveNestedPlaceholders(AbstractPropertyResolver.java:230) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:79) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.getProperty(ConfigurationPropertySourcesPropertyResolver.java:60) ~[spring-boot-3.1.2.jar:3.1.2]
at org.springframework.core.env.AbstractEnvironment.getProperty(AbstractEnvironment.java:552) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:153) ~[spring-context-6.0.11.jar:6.0.11]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer$1.getProperty(PropertySourcesPlaceholderConfigurer.java:149) ~[spring-context-6.0.11.jar:6.0.11]
at org.springframework.core.env.PropertySourcesPropertyResolver.getProperty(PropertySourcesPropertyResolver.java:85) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.PropertySourcesPropertyResolver.getPropertyAsRawString(PropertySourcesPropertyResolver.java:74) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.util.PropertyPlaceholderHelper.parseStringValue(PropertyPlaceholderHelper.java:153) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.util.PropertyPlaceholderHelper.replacePlaceholders(PropertyPlaceholderHelper.java:126) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.AbstractPropertyResolver.doResolvePlaceholders(AbstractPropertyResolver.java:239) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.core.env.AbstractPropertyResolver.resolveRequiredPlaceholders(AbstractPropertyResolver.java:210) ~[spring-core-6.0.11.jar:6.0.11]
at org.springframework.context.support.PropertySourcesPlaceholderConfigurer.lambda$processProperties$0(PropertySourcesPlaceholderConfigurer.java:191) ~[spring-context-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveEmbeddedValue(AbstractBeanFactory.java:920) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1358) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1337) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:713) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:696) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.0.11.jar:6.0.11]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:483) ~[spring-beans-6.0.11.jar:6.0.11]
... 22 common frames omitted
PS C:ProjetsMAT V2>
So how to fix it ?