Systemctl文件无法获取AWS凭证

时间:2019-03-07 08:30:53

标签: java amazon-web-services systemd

  

Mar 07 13:40:51 abhishek-X555LAB java [19921]:线程“ main”中的异常java.lang.reflect.InvocationTargetException   Mar 07 13:40:51 abhishek-X555LAB java [19921]:在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)   3月7日13:40:51 abhishek-X555LAB java [19921]:在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)   3月7日13:40:51 abhishek-X555LAB Java [19921]:在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)   3月7日13:40:51 abhishek-X555LAB java [19921]:在java.lang.reflect.Method.invoke(Method.java:498)   3月7日13:40:51 abhishek-X555LAB java [19921]:在org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)   3月7日13:40:51 abhishek-X555LAB java [19921]:由以下原因引起:com.amazonaws.AmazonClientException:无法加载凭据   Mar 07 13:40:51 abhishek-X555LAB Java [19921]:在demokinesis.kinesis.demoKinesis.init(demoKinesis.java:43)   Mar 07 13:40:51 abhishek-X555LAB Java [19921]:在demokinesis.kinesis.demoKinesis.main(demoKinesis.java:48)   Mar 07 13:40:51 abhishek-X555LAB java [19921]:...还有5个   3月7日13:40:51 abhishek-X555LAB java [19921]:由以下原因引起:java.lang.IllegalArgumentException:在给定的AWS凭证配置文件中找不到   3月7日13:40:51 abhishek-X555LAB java [19921]:在com.amazonaws.auth.profile.internal.ProfilesConfigFileLoader.loadProfiles(ProfilesConfig   3月7日13:40:51 abhishek-X555LAB java [19921]:在com.amazonaws.auth.profile.ProfilesConfigFile.loadProfiles(ProfilesConfigFile.java:214)   3月7日13:40:51 abhishek-X555LAB java [19921]:位于com.amazonaws.auth.profile.ProfilesConfigFile。(ProfilesConfigFile.java:139)   3月7日13:40:51 abhishek-X555LAB java [19921]:位于com.amazonaws.auth.profile.ProfilesConfigFile。(ProfilesConfigFile.java:128)   3月7日13:40:51 abhishek-X555LAB java [19921]:位于com.amazonaws.auth.profile.ProfilesConfigFile。(ProfilesConfigFile.java:96)   3月7日13:40:51 abhishek-X555LAB java [19921]:在com.amazonaws.auth.profile.ProfileCredentialsProvider.getCredentials(ProfileCredentialsP   Mar 07 13:40:51 abhishek-X555LAB Java [19921]:在demokinesis.kinesis.demoKinesis.init(demoKinesis.java:41)   Mar 07 13:40:51 abhishek-X555LAB java [19921]:...还有6个

系统文件:

[Unit]
Description=service file description
After=syslog.target

[Service]
ExecStart=/usr/bin/java -jar /home/ubuntu/demo-0.0.1-SNAPSHOT.jar

[Install]
WantedBy=multi-user.target

Java代码:

private static AWSCredentialsProvider credentialsProvider;
credentialsProvider = new ProfileCredentialsProvider();
AWSCredentials credentials = credentialsProvider.getCredentials();

0 个答案:

没有答案