Hi Devs!
Can anyone kindly help me out here. Am trying to pass external parameters through application.properties as below:-
server.ssl.key-store ="/keystore.jks"
server.ssl.key-store-password =openmf
server.ssl.key-password =openmf
spring.datasource.driverClassName="org.drizzle.jdbc.DrizzleDriver"
spring.datasource.url="jdbc:mysql:thin://localhost:3306/mifosplatform-tenants"
spring.datasource.username=mifos
spring.datasource.password=password@123
But i can the following errors
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ServerProperties org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration.server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties': Could not bind properties; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'ssl[key-store-password]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Cannot access indexed value in property referenced in indexed property path 'ssl[key-store-password]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'ssl[key-store-password]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Bean property 'ssl[key-store-password]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:124) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476) ~[spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:142) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481) [catalina.jar:7.0.56]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.56]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1879) [catalina.jar:7.0.56]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_74]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ServerProperties org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration.server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties': Could not bind properties; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'ssl[key-store-password]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Cannot access indexed value in property referenced in indexed property path 'ssl[key-store-password]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'ssl[key-store-password]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Bean property 'ssl[key-store-password]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
But when i make the line for server.ssl.key-store-password =openmf as a comment (by putting // )or deleting it, i get the below errors
09-04-2016 09:23:45.001 [localhost-startStop-1] ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.context.ApplicationContextException: Unable to start embedded container; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.springframework.boot.autoconfigure.web.ServerProperties org.springframework.boot.autoconfigure.web.DispatcherServletAutoConfiguration$DispatcherServletConfiguration.server; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serverProperties': Could not bind properties; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'ssl[key-store]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Cannot access indexed value in property referenced in indexed property path 'ssl[key-store]'; nested exception is org.springframework.beans.NotReadablePropertyException: Invalid property 'ssl[key-store]' of bean class [org.springframework.boot.autoconfigure.web.ServerProperties]: Bean property 'ssl[key-store]' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:124) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:476) ~[spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:142) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481) [catalina.jar:7.0.56]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.56]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1879) [catalina.jar:7.0.56]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_74]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
But when i make the lines from server.ssl.key-store-password =openmf to server.ssl.key-password =openmf as a comments (by putting // )or deleting it, i get the below errors
09-04-2016 09:44:02.246 [localhost-startStop-1] ERROR o.s.boot.SpringApplication - Application startup failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$JdbcTemplateConfiguration': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$JdbcTemplateConfiguration.dataSource; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: tenantDataSourceJndi,routingDataSource
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:301) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1186) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:475) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:228) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:706) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:762) ~[spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:482) ~[spring-context-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:109) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:691) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:320) ~[spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:142) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.createRootApplicationContext(SpringBootServletInitializer.java:89) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.boot.context.web.SpringBootServletInitializer.onStartup(SpringBootServletInitializer.java:51) [spring-boot-1.1.6.RELEASE.jar:1.1.6.RELEASE]
at org.springframework.web.SpringServletContainerInitializer.onStartup(SpringServletContainerInitializer.java:175) [spring-web-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5481) [catalina.jar:7.0.56]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.56]
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.56]
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083) [catalina.jar:7.0.56]
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1879) [catalina.jar:7.0.56]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_74]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private javax.sql.DataSource org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration$JdbcTemplateConfiguration.dataSource; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: tenantDataSourceJndi,routingDataSource
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:522) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:298) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
... 29 common frames omitted
Caused by: org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] is defined: expected single matching bean but found 2: tenantDataSourceJndi,routingDataSource
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:974) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:862) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:494) ~[spring-beans-4.0.8.RELEASE.jar:4.0.8.RELEASE]
... 31 common frames omitted
Apr 09, 2016 9:44:02 AM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/fineract-provider]]
Am not really sure how i can handle this error! Could it be that the way i pass my external parameters are wrong?
Thanks
Regards
Ippez Robert