I am using Intellij and Maven for my GAE Java project. I have some strange issues with calling createOrReplace
from GcsService in Google Cloud Storage, that is dependent on me editing a single file in my project. Here is what happens:
I have a stable revision on Github. I checkout that revision and use an intellij configuration to deploy the app. My deployment looks like this: After the clean install and build, this is the command that gets executed:
/Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home/bin/java -Dfile.encoding=UTF-8 -classpath /Users/me/.m2/repository/com/google/appengine/appengine-java-sdk/1.9.15/appengine-java-sdk/appengine-java-sdk-1.9.15/lib/appengine-tools-api.jar com.google.appengine.tools.admin.AppCfg --email=me@gmail.com --passin --no_cookies update /Users/me/git/blunka/harry-gcp/module-ear/target/module-ear-1.0
I then add a comment to a specific source file. I redeploy and I notice a bunch of output files under /target
have changed. My app is now broken with this error:
java.lang.NoSuchMethodError: com.google.common.base.Stopwatch.createUnstarted()Lcom/google/common/base/Stopwatch;
at com.google.appengine.tools.cloudstorage.RetryHelper.runWithRetries(RetryHelper.java:156)
at com.google.appengine.tools.cloudstorage.GcsServiceImpl.createOrReplace(GcsServiceImpl.java:70)
I now delete that comment and deploy again. I do a git status
and notice that some of the changed files under /target
are no longer there. My app works fine again.
When I look at the decompiled .class files of the modified class, they are identical. Here is my dep tree for the module that is throwing the error:
[INFO] +- com.google.api-client:google-api-client-appengine:jar:1.19.0:compile
[INFO] | \- com.google.api-client:google-api-client:jar:1.19.0:compile
[INFO] | \- com.google.guava:guava-jdk5:jar:13.0:compile
[INFO] +- com.google.appengine.tools:appengine-gcs-client:jar:RELEASE:compile
[INFO] | \- (com.google.guava:guava:jar:18.0:compile - omitted for duplicate)
[INFO] +- com.google.guava:guava:jar:18.0:compile
[INFO] \- com.googlecode.objectify:objectify:jar:5.1.1:compile
[INFO] \- (com.google.guava:guava:jar:17.0:compile - omitted for conflict with 18.0)
I have a few questions:
- Why does a comment cause my output files to change?
- Why do changed output files from a comment cause a change in behavior of the app, even though the decompiled source is the same?
- If guava (google.common.base) has collisions, how can I fix them?
- How can I prevent something like this from happening in the future?