shinesolutions / aem-orchestrator

Java application for orchestrating AEM infrastructure created using aem-aws-stack-builder
Apache License 2.0
12 stars 9 forks source link

Error starting Orchestrator with latest master as of 13/10/2020 #49

Closed mbloch1986 closed 3 years ago

mbloch1986 commented 4 years ago

Starting the compiled orchestrator code with the latest master of 13/10/2020 fails with the following error message:

2020-10-13 08:13:58 [main] INFO  c.s.aemorchestrator.AemOrchestrator - Starting AemOrchestrator v2.0.2-SNAPSHOT on ip-10-0-15-185.ap-southeast-2.compute.internal with PID 14082 (/opt/shinesolutions/aem-orchestrator/aem-orchestrator.jar started by aem-orchestrator in /opt/shinesolutions/aem-orchestrator)
2020-10-13 08:13:58 [main] DEBUG c.s.aemorchestrator.AemOrchestrator - Running with Spring Boot v2.1.6.RELEASE, Spring v5.1.8.RELEASE
2020-10-13 08:13:58 [main] INFO  c.s.aemorchestrator.AemOrchestrator - No active profile set, falling back to default profiles: default
2020-10-13 08:14:04 [main] DEBUG c.s.a.c.ProxyConfig$$EnhancerBySpringCGLIB$$a603fa68 - https_proxy environment variable not found, no proxy details set
2020-10-13 08:14:04 [main] ERROR o.s.b.w.e.tomcat.TomcatStarter - Error starting Tomcat context. Exception: org.springframework.beans.factory.BeanCreationException. Message: Error creating bean with name 'servletEndpointRegistrar' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/ServletEndpointManagementContextConfiguration$WebMvcServletEndpointManagementContextConfiguration.class]: Bean instantiation via factory method failed;
 nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.ServletEndpointRegistrar]: Factory method 'servletEndpointRegistrar' threw exception;
 nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'infoEndpoint' defined in class path resource [org/springframework/boot/actuate/autoconfigure/info/InfoEndpointAutoConfiguration.class]: Bean instantiation via factory method failed;
 nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.info.InfoEndpoint]: Factory method 'infoEndpoint' threw exception;
 nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'infoActuator': Injection of resource dependencies failed;
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'envValues' defined in class path resource [com/shinesolutions/aemorchestrator/config/AemConfig.class]: Unsatisfied dependency expressed through method 'envValues' parameter 0;
 nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'awsHelperService': Injection of resource dependencies failed;
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'amazonEC2Client' defined in class path resource [com/shinesolutions/aemorchestrator/config/AwsConfig.class]: Unsatisfied dependency expressed through method 'amazonEC2Client' parameter 1;
 nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'awsClientConfig' defined in class path resource [com/shinesolutions/aemorchestrator/config/AwsConfig.class]: Unsatisfied dependency expressed through method 'awsClientConfig' parameter 0;
 nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.shinesolutions.aemorchestrator.model.ProxyDetails' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {}
2020-10-13 08:14:04 [main] DEBUG c.s.a.c.ProxyConfig$$EnhancerBySpringCGLIB$$a603fa68 - https_proxy environment variable not found, no proxy details set
2020-10-13 08:14:04 [main] ERROR o.s.b.d.LoggingFailureAnalysisReporter - 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method awsClientConfig in com.shinesolutions.aemorchestrator.config.AwsConfig required a bean of type 'com.shinesolutions.aemorchestrator.model.ProxyDetails' that could not be found.

The following candidates were found but could not be injected:
    - User-defined bean method 'proxyDetails' in 'ProxyConfig' ignored as the bean value is null

Action:

Consider revisiting the entries above or defining a bean of type 'com.shinesolutions.aemorchestrator.model.ProxyDetails' in your configuration.
mbloch1986 commented 4 years ago

The issue is caused by a bean which returns the value null, which we are doing here ... https://github.com/shinesolutions/aem-orchestrator/blob/master/src/main/java/com/shinesolutions/aemorchestrator/config/ProxyConfig.java#L22

The return of value null for a bean is since spring 5 not anymore supported.

mbloch1986 commented 3 years ago

Fix included in release 3.0.0