Cynosure.X International

:

Add Comment | Related Links | TrackBack
Related Content

Amazon Mechanical Turk Command Line Tools Can't Run From Any Directory

The Amazon Mechanical Turk (AMT) Command Line Tools (CLT) 1.3.0 claims that you can run it from any directory if you just set the MTURK_CMD_HOME environment variable. However, that's not true (as least it's not true on Windows). If you set the environment variable and try to run the tools, you will get the following error message:

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cli/BasicParser
Caused by: java.lang.ClassNotFoundException: org.apache.commons.cli.BasicParser
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: com.amazonaws.mturk.cmd.LoadHITs. Program will exit.

I found the reason for it is because of bugs in the "invoke.cmd" that is distributed with AMT CLT. In this batch script, it references the current directory variable (%CD%) rather than the MTURK_CMD_HOME variable.

I fixed the problem in the attached "invoke.cmd" script. The license for this script is covered under then same Amazon Software License ( http://aws.amazon.com/asl ).

With this fix, you will get another error message:

There was a problem reading your properties file from mturk.properties
The exception was java.io.FileNotFoundException: mturk.properties (The system cannot find the file specified)
Exception in thread "main" java.lang.RuntimeException: Cannot load configuration properties file from mturk.properties
at com.amazonaws.mturk.util.PropertiesClientConfig.(PropertiesClientConfig.java:99)
at com.amazonaws.mturk.util.PropertiesClientConfig.(PropertiesClientConfig.java:72)
at com.amazonaws.mturk.cmd.AbstractCmd.(AbstractCmd.java:61)
at com.amazonaws.mturk.cmd.LoadHITs.(LoadHITs.java:50)
at com.amazonaws.mturk.cmd.LoadHITs.main(LoadHITs.java:54)
Caused by: java.io.FileNotFoundException: mturk.properties (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(Unknown Source)
at com.amazonaws.mturk.util.PropertiesClientConfig.(PropertiesClientConfig.java:95)
... 4 more

It seems like a Java class file in the AMT CLT is also not reading the MTURK_CMD_HOME variable. Instead, it is probably looking for the configuration in the current working directory. But at least you can resolve that by moving the "mturk.properties" file around.

Attached File: invoke.cmd (2 KB)

Chieh Cheng
Tue, 20 Oct 2009 21:16:06 +0000

Add Comment | Related Links | TrackBack
Related Content

Did your message disappear? Read the Forums FAQ.

Add Comment

Spam Control | * indicates required field
Your Name: *
E-mail:
Remember Me!
Comment: *
File attachment is optional. Please do not attach a file to your submission unless it is relevent.
Attach File:
(20 MB Max)
Spam Protection: * Answer of 1 - 10?
Click button only once, please!

TrackBack

Send Ping | TrackBack URL | Spam Control

No TrackBacks yet. TrackBack can be used to link this thread to your weblog, or link your weblog to this thread. In addition, TrackBack can be used as a form of remote commenting. Rather than posting the comment directly on this thread, you can posts it on your own weblog. Then have your weblog sends a TrackBack ping to the TrackBack URL, so that your post would show up here.

Messages, files, and images copyright by respective owners.

Products | Services
Forums | Latest | RSS
Library | Search | Wiki
Help | Licenses

Login | Register

1645 Users Online

Hacking Digital Cameras
Fun for Photographers


Amazon Associate

Copyright © 1996 - 2017. All Rights Reserved.