getBalance in Amazon Turk gives error [closed]

橙三吉。 提交于 2019-12-11 09:30:14

问题


Do you know why the following executable gives error and how to fix it?

aaron@aaron-desktop:~/Desktop/aws-mona/aws-mturk-clt-1.3.1/bin$ echo $JAVA_HOME 
/usr
aaron@aaron-desktop:~/Desktop/aws-mona/aws-mturk-clt-1.3.1/bin$ chmod 755 getBalance.sh 
aaron@aaron-desktop:~/Desktop/aws-mona/aws-mturk-clt-1.3.1/bin$ ./getBalance.sh 
An error occurred while fetching your balance: This request must be made over a secure channel. You must use 'https' rather than 'http'.
com.amazonaws.mturk.service.exception.InternalServiceException: This request must be made over a secure channel. You must use 'https' rather than 'http'.
    at com.amazonaws.mturk.service.axis.AWSService.executeRequestMessage(AWSService.java:243)
    at com.amazonaws.mturk.filter.FinalFilter.execute(FinalFilter.java:38)
    at com.amazonaws.mturk.filter.Filter.passMessage(Filter.java:56)
    at com.amazonaws.mturk.filter.ErrorProcessingFilter.execute(ErrorProcessingFilter.java:46)
    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)
Caused by: This request must be made over a secure channel. You must use 'https' rather than 'http'.
    at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
    at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
    at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
    at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.amazonaws.mturk.requester.AWSMechanicalTurkRequesterBindingStub.getAccountBalance(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:616)
    at com.amazonaws.mturk.service.axis.AWSService.executeRequestMessage(AWSService.java:220)
    ... 17 more

EDIT: here's the getBalance.sh in the bin folder:

#!/usr/bin/env sh
#
# Copyright 2012 Amazon Technologies, Inc.
# 
# Licensed under the Amazon Software License (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at:
# 
# http://aws.amazon.com/asl
# 
# This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
# OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and
# limitations under the License.


MTURK_CMD_HOME=${MTURK_CMD_HOME:-$(dirname "$0")/..}
export MTURK_CMD_HOME
exec "$MTURK_CMD_HOME"/bin/invoke.sh GetBalance "$@"

回答1:


I fixed it by changing the http in mturk.properties to https:

~/Desktop/aws-mona/aws-mturk-clt-1.3.1/bin$ vim mturk.properties 

to

# use the service_url defined below:
service_url=https://mechanicalturk.amazonaws.com/?Service=AWSMechanicalTurkRequester

~/Desktop/aws-mona/aws-mturk-clt-1.3.1/bin$ ./getBalance.sh 
Your account balance: $2.20


来源:https://stackoverflow.com/questions/23921598/getbalance-in-amazon-turk-gives-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!