问题
I am trying to use "gdata-scala-client" import google contacts using scala. I followed the instructions here, This is my sample code
import com.google.gdata.Service
import com.google.gdata.data.StdAtomFeed
object Con extends App {
println("hey")
val s = new Service("comp-test-1.0", "cp") {}
s.setUserCredentials("scalaprogrammer1@gmail.com", "xxxxxxxx")
val atomFeed = new StdAtomFeed
val f = s.query("http://www.google.com/m8/feeds/contacts/scalaprogrammer1%40gmail.com/base", atomFeed.feedPickler)
for (e <- f) println(e.title)
}
but I am getting this exception :
Exception in thread "main" java.lang.NoSuchMethodError: scala.collection.JavaConversions$.asMap(Ljava/util/Map;)Lscala/collection/mutable/Map;
at com.google.gdata.client.HttpConnection$HttpResponse.headers(HttpConnection.scala:215)
at com.google.gdata.client.ClientLoginFactory.getToken(ClientLoginFactory.scala:104)
at com.google.gdata.client.ClientLoginFactory.setUserCredentials(ClientLoginFactory.scala:59)
at com.google.gdata.Service.setUserCredentials(Service.scala:62)
at Con$delayedInit$body.apply(Con.scala:9)
at scala.Function0$class.apply$mcV$sp(Function0.scala:40)
at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.App$$anonfun$main$1.apply(App.scala:71)
at scala.collection.immutable.List.foreach(List.scala:318)
at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:32)
at scala.App$class.main(App.scala:71)
at Con$.main(Con.scala:6)
at Con.main(Con.scala)
I am new to scala , can anybody suggest where am i lacking?
来源:https://stackoverflow.com/questions/18612329/exception-in-thread-main-java-lang-nosuchmethoderror-scala-collection-javacon