0

I am trying to use the GCS library in my project:

val GoogleCloud = Seq(
  "com.google.appengine.tools" % "appengine-gcs-client" % "0.5"  exclude("com.google.guava", "guava-jdk5"),
  "com.google.appengine" % "appengine-api-stubs" % "1.9.28",
  "com.google.appengine" % "appengine-api-1.0-sdk" % "1.9.28",
  "com.google.guava" % "guava" % "19.0-rc2"
)

I get this error:

Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.createUnstarted()Lcom/google/common/base/Stopwatch;

I added the exclude above as suggested here but no luck.

Community
  • 1
  • 1
BAR
  • 15,909
  • 27
  • 97
  • 185

1 Answers1

0

I ran to the same problem, exclude didn't work for me. After a two days of searching and trying everything I found the following:

Somehow Eclipse didn't delete all jars from the target/MyAppWeb-1.1/WEB-INF/lib/ folder before compiling new WAR during deployment to appengine. So there was still file guava-jdk5.jar remained from my previous steps, no matter that I excluded it from dependencies. Some process was holding these jars because I had to restart windows to be able to delete all content of the target folder. After that and fresh recompiling and redeployment the error doesn't appear anymore.

So try to check your generated WAR, maybe there is guava-jdk5.jar, forgotten from any previous compilation. In that case delete all content of the target folder then recompile and redeploy.

Fipil
  • 291
  • 2
  • 5
  • 16