我在SPRING BOOT可执行jar应用程序中使用SPRING AWS Cloud版本1.0.3.RELEASE包 - 即spring-cloud-aws-core,context,autoconfigure,jdbc和messaging。但是,当应用程序初始化收到错误时 - 在给定路径中找不到AWS凭证配置文件。
详细例外情况如下:
2015-12-11 08:52:45.778 DEBUG 2525 --- [ main] o.s.b.f.s.DefaultListableBeanFactory : Creating instance of bean '(inner bean)#566a55ed'
2015-12-11 08:52:45,789 8058 [main] DEBUG org.springframework.beans.BeanUtils -
- No property editor [com.amazonaws.auth.profile.ProfilesConfigFileEditor] found for type com.amazonaws.auth.profile.ProfilesConfigFile according to 'Editor' suffix convention
2015-12-11 08:52:45.789 DEBUG 2525 --- [ main] org.springframework.beans.BeanUtils : No property editor [com.amazonaws.auth.profile.ProfilesConfigFileEditor] found for type com.amazonaws.auth.profile.ProfilesConfigFile according to 'Editor' suffix convention
2015-12-11 08:52:45,793 8062 [main] DEBUG o.s.beans.TypeConverterDelegate -
- Construction via String failed for type [com.amazonaws.auth.profile.ProfilesConfigFile]
org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.amazonaws.auth.profile.ProfilesConfigFile]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: AWS credential profiles file not found in the given path: /opt/wmc/myapp/bin/default
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) ~[spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:238) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:108) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.TypeConverterSupport.doConvert(TypeConverterSupport.java:64) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.TypeConverterSupport.convertIfNecessary(TypeConverterSupport.java:47) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:704) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:185) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:299) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:129) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedList(BeanDefinitionValueResolver.java:382) [spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]
Caused by: java.lang.IllegalArgumentException: AWS credential profiles file not found in the given path: /opt/wmc/myapp/bin/default
at com.amazonaws.auth.profile.internal.ProfilesConfigFileLoader.loadProfiles(ProfilesConfigFileLoader.java:45) ~[aws-java-sdk-core-1.10.36.jar!/:na]
at com.amazonaws.auth.profile.ProfilesConfigFile.loadProfiles(ProfilesConfigFile.java:194) ~[aws-java-sdk-core-1.10.36.jar!/:na]
at com.amazonaws.auth.profile.ProfilesConfigFile.<init>(ProfilesConfigFile.java:119) ~[aws-java-sdk-core-1.10.36.jar!/:na]
at com.amazonaws.auth.profile.ProfilesConfigFile.<init>(ProfilesConfigFile.java:101) ~[aws-java-sdk-core-1.10.36.jar!/:na]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_65]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_65]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_65]
at java.lang.reflect.Constructor.newInstance(Constructor.java:422) ~[na:1.8.0_65]
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ~[spring-beans-4.2.3.RELEASE.jar!/:4.2.3.RELEASE]