首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为Mac指定mTurk的CLI路径

为Mac指定mTurk的CLI路径
EN

Stack Overflow用户
提问于 2015-02-16 04:06:29
回答 1查看 264关注 0票数 1

我正在一个MAC (iOS 10.9)上设置MTURK_CMD_HOME和JAVA_CMD_HOME路径,我相信我已经正确地设置了MTURK_CMD_HOME和JAVA_CMD_HOME路径。

但是,我仍然收到一个错误,在运行getBalance.sh时找不到该文件。我的代码如下:

代码语言:javascript
复制
/users/USER/Desktop/aws-mturk-clt-1.3.1/
    -bash: /users/USER/Desktop/aws-mturk-clt-1.3.1/: is a directory
/System/Library/Frameworks/JavaVM.framework/Home
    -bash: /System/Library/Frameworks/JavaVM.framework/Home: is a directory
export MTURK_CMD_HOME=/users/USER/Desktop/aws-mturk-clt-1.3.1/
export JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Home
export PATH=$PATH:/users/USER/Desktop/aws-mturk-clt-1.3.1/bin
/users/USER/Desktop/aws-mturk-clt-1.3.1/bin/getBalance.sh

返回以下错误:

代码语言:javascript
复制
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: ../log/aws-mturk-clt.log (No such file or directory)
    at java.io.FileOutputStream.openAppend(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:192)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:116)
    at org.apache.log4j.FileAppender.setFile(FileAppender.java:290)
    at org.apache.log4j.RollingFileAppender.setFile(RollingFileAppender.java:194)
    at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:164)
    at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:257)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:133)
    at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:97)
    at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:689)
    at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:647)
    at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:544)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:440)
    at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:476)
    at org.apache.log4j.helpers.OptionConverter.selectAndConfigure(OptionConverter.java:471)
    at org.apache.log4j.LogManager.<clinit>(LogManager.java:125)
    at org.apache.log4j.Logger.getLogger(Logger.java:118)
    at com.amazonaws.mturk.cmd.AbstractCmd.<clinit>(AbstractCmd.java:51)
There was a problem reading your properties file from mturk.properties
The exception was java.io.FileNotFoundException: mturk.properties (No such file or directory)
Exception in thread "main" java.lang.RuntimeException: Cannot load configuration properties file from mturk.properties
    at com.amazonaws.mturk.util.PropertiesClientConfig.<init>(PropertiesClientConfig.java:99)
    at com.amazonaws.mturk.util.PropertiesClientConfig.<init>(PropertiesClientConfig.java:72)
    at com.amazonaws.mturk.cmd.AbstractCmd.<init>(AbstractCmd.java:61)
    at com.amazonaws.mturk.cmd.GetBalance.<init>(GetBalance.java:24)
    at com.amazonaws.mturk.cmd.GetBalance.main(GetBalance.java:27)
Caused by: java.io.FileNotFoundException: mturk.properties (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at com.amazonaws.mturk.util.PropertiesClientConfig.<init>        (PropertiesClientConfig.java:95)
    ... 4 more

似乎正确地指定了目录( bin包含getBalance.sh)。我已经检查了我的访问密钥是否正确,文件路径是否正确。我做什么好?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-02-16 22:18:07

这适用于我(不需要更改任何脚本)。我在mturk.properties文件中设置了默认访问密钥和机密,并将URL更改为沙箱https地址。

代码语言:javascript
复制
$ cd /Users/me/Downloads/aws-mturk-clt-1.3.1/bin
$ ./getBalance.sh 
An error occurred while fetching your balance: Error #1 for RequestId: 75edd876-61eb-4525-8c5a-5c984e1e31f3 - AWS.NotAuthorized: The identity contained in the request is not authorized to use this AWSAccessKeyId (1424124881922 s)
com.amazonaws.mturk.service.exception.AccessKeyException: Error #1 for RequestId: 75edd876-61eb-4525-8c5a-5c984e1e31f3 - AWS.NotAuthorized: The identity contained in the request is not authorized to use this AWSAccessKeyId (1424124881922 s)
    at com.amazonaws.mturk.filter.ErrorProcessingFilter.processErrors(ErrorProcessingFilter.java:91)
    at com.amazonaws.mturk.filter.ErrorProcessingFilter.execute(ErrorProcessingFilter.java:48)
    at com.amazonaws.mturk.filter.Filter.passMessage(Filter.java:56)
    at com.amazonaws.mturk.filter.RetryFilter.execute(RetryFilter.java:115)
    at com.amazonaws.mturk.filter.Filter.passMessage(Filter.java:56)
    at com.amazonaws.mturk.util.CLTExceptionFilter.sendMessage(CLTExceptionFilter.java:77)
    at com.amazonaws.mturk.util.CLTExceptionFilter.execute(CLTExceptionFilter.java:62)
    at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequests(FilteredAWSService.java:172)
    at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequest(FilteredAWSService.java:152)
    at com.amazonaws.mturk.service.axis.FilteredAWSService.executeRequest(FilteredAWSService.java:116)
    at com.amazonaws.mturk.service.axis.RequesterServiceRaw.getAccountBalance(RequesterServiceRaw.java:1193)
    at com.amazonaws.mturk.service.axis.RequesterService.getAccountBalance(RequesterService.java:922)
    at com.amazonaws.mturk.cmd.GetBalance.getBalance(GetBalance.java:50)
    at com.amazonaws.mturk.cmd.GetBalance.runCommand(GetBalance.java:41)
    at com.amazonaws.mturk.cmd.AbstractCmd.run(AbstractCmd.java:148)
    at com.amazonaws.mturk.cmd.GetBalance.main(GetBalance.java:28)

您试过从bin dir运行它吗?实际上是cd进入目录,而不是使用完全限定的路径。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/28534369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档