【发布时间】:2016-05-18 03:46:53
【问题描述】:
我正在使用 IVONA SpeachCloud SDK(创建语音示例):https://github.com/IvonaSoftware/ivona-speechcloud-sdk-java/blob/master/src/samples/IvonaSpeechCloudCreateSpeech/SampleIvonaSpeechCloudCreateSpeech.java
使用此代码设置类路径
private static IvonaSpeechCloudClient speechCloud;
private static void init() {
speechCloud = new IvonaSpeechCloudClient(
new ClasspathPropertiesFileCredentialsProvider("IvonaCredentials.properties"));
speechCloud.setEndpoint("https://tts.eu-west-1.ivonacloud.com");
}
以下是 ivona.properties 文件的格式。文件位于基本目录中。我在 SpeechCloud 帐户中获得的所需凭据
accessKey = mykey
secretKey = mysecretKey
以下是我遇到的异常
Exception in thread "main" com.amazonaws.AmazonClientException: Unable to load AWS credentials from the /resources/ivona.properties file on the classpath
at com.amazonaws.auth.ClasspathPropertiesFileCredentialsProvider.getCredentials(ClasspathPropertiesFileCredentialsProvider.java:81)
at com.ivona.services.tts.IvonaSpeechCloudClient.prepareRequest(IvonaSpeechCloudClient.java:279)
at com.ivona.services.tts.IvonaSpeechCloudClient.prepareRequest(IvonaSpeechCloudClient.java:272)
at com.ivona.services.tts.IvonaSpeechCloudClient.invoke(IvonaSpeechCloudClient.java:259)
at com.ivona.services.tts.IvonaSpeechCloudClient.createSpeech(IvonaSpeechCloudClient.java:148)
at SampleIvonaSpeechCloudCreateSpeech.main(SampleIvonaSpeechCloudCreateSpeech.java:45
我该如何解决这个异常,或者我如何创建一个类来解决这个问题并手动输入我的 accessKey 和 secretKey 作为字符串。 谢谢。
【问题讨论】:
标签: java amazon-web-services aws-sdk