1

I'm about to work on a Scala/SBT project that requires Mechanical Turk java API. Mturk provides instruction how to install dependency in Java with Ant. I thought I could just drop ready jar (downloaded from Maven) into the /lib and that should work in my Scala project but I get dependency errors when compiling. Is this because jar is not packaged with org.apache.commons?

Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/protocol/SecureProtocolSocketFactory

UPDATE:

Tried adding this dependency to SBT.

libraryDependencies += "net.ettinsmoor" % "java-aws-mturk" % "1.6.2"

Error:Error while importing SBT project: ... at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:235) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) [error] sbt.ResolveException: unresolved dependency: org.apache.commons#not-yet-commons-ssl;0.3.7: not found [error] unresolved dependency: apache-xerces#xercesImpl;2.9.1: not found [error] unresolved dependency: apache-xerces#resolver;2.9.1: not found [error] unresolved dependency: apache-xerces#xml-apis;2.9.1: not found [error] Use 'last' for the full log. See complete log in /Users/marcin/Library/Logs/IdeaIC14/sbt.last.log 

1 Answer 1

1

You have to add the MTurk dependency to your sbt build file (build.sbt). Like that:

libraryDependencies += "org.clojars.zaxtax" % "java-aws-mturk" % "1.6.2" 
Sign up to request clarification or add additional context in comments.

6 Comments

@marcin_koss which version of the library are you using? How is this dependency declared in your maven pom.xml?
@marcin_koss it seems to be a different artifact. Try to change the dependency like: libraryDependencies += "net.ettinsmoor" % "java-aws-mturk" % "1.6.2"
That's exactly the one I used.
@marcin_koss Hm. Seems like the resolvers problem. Add this: resolvers ++= Seq( "Typesafe" at "repo.typesafe.com/typesafe/releases", "Java.net Maven2 Repository" at "mvnsearch.org/maven2" )
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.