Closed ChadKillingsworth closed 7 years ago
This was definitely caused by 799ea5fe0b63f7354e9dc3428ed01ce99862f83c
Are there any compiler error messages before this exception? There should be one that contains the stack trace of the original exception, which should make it easier to diagnose what is going on.
Is there anything unusual about the JDK environment being used? The exception in question happens in code that tries to invoke a method that was introduced in Java 8, via reflection so that the code can work on Java 7. We've actually deleted that in the latest snapshot, since we no longer support running on pre-Java-8. Do you have a way of trying this with AutoValue 1.5-SNAPSHOT?
There is no other exception. All the other warnings were already present. The stack trace was produced by using the -e -X
flags with Maven. The normal build just gives this single error message:
/Users/chad/git/closure-compiler/src/com/google/javascript/refactoring/CodeReplacement.java:[29,16] error: @AutoValue processor threw an exception: java.lang.RuntimeException: exception during invocation of getAnnotationMirrors
I switched to using the 1.5-SNAPSHOT version but it still gave the error.
There is nothing unusual about my build environment. I'm using jdk1.8.0_60.
I tried cloning git@github.com:google/closure-compiler and executing mvn package
in the closure-compiler/ directory. It worked fine. java -version
reports 1.8.0_25 (I'll try again with a more recent version). mvn -version
reports 3.2.3. Is there something else I should be trying?
Incidentally the Maven dependencies on AutoValue should have <scope>provided</scope>
. AutoValue does its work at compile time and there is no need to include it in your output jars.
ETA: I also tried with Java 1.8.0_131 and Maven 3.5.0, and it still worked.
Also, it should not be possible to get the message java.lang.RuntimeException: exception during invocation of getAnnotationMirrors
when running against AutoValue 1.5-SNAPSHOT. If you get an exception, it should be a different one.
I updated both the pom-gwt.xml and pom-main.xml to have version 1.5-SNAPSHOT
and <scope>provided</scope>
. I get exactly the same error.
I ran mvn -U install
and watched as the 1.5-SNAPSHOT was downloaded. My ~/.m2/repository
only contains the 1.5-SNAPSHOT - no other versions.
Is it possible one of the other Google dependencies has bundled an older version that's conflicting?
I guess the more fundamental question is why you are getting an exception and I am not. I'm using mvn package
within the root of the source tree. Should I be doing something else?
Have other people run into the same problem?
Nobody else has reported the problem yet, but the commit only got pushed externally last Tuesday. The command you ran gives the error for me (I normally run mvn install
though).
Is there anything I can do to get more info or figure out exactly what is causing this?
Do you have anything unusual in ~/.m2/settings.xml
? Perhaps try running Maven with
-s $MVN/conf/settings.xml
, where $MVN
is the Maven install directory, to get default settings?
Perhaps there is something in ~/.m2/repository
that is causing strangeness? I tried editing ~/.m2/settings.xml
to add this immediately after <settings>
:
<localRepository>/tmp/fakerepository</localRepository>
to see whether I was succeeding because of something in my repository, but it worked fine.
It worked for me with old versions of Maven and Java and also with latest versions, so the difference probably isn't there. I'm running on MacOS Sierra (10.12.4).
Using the default settings file had no effect. I tried deleting my repository and re-downloading everything. This also had no effect.
I'm on Maven 3.3.3, with Oracle JDK 1.8.0_131-b11 (64 bit) and MacOS Sierra (10.12.4).
Is there anyway I can locally build and link Auto Value so I can potentially step through the code and figure out what is causing the exception?
although I was not able to reproduce this compiler error (I'm also on osx), one thing I've seen happen in the past on osx is that you end up with multiple java things on the PATH (e.g., a jre7 and a jdk8), which causes weird compile failures that might look like this.
@nicks Wins the prize - Thanks Nick.
For posterity, this occurred because:
$ /usr/libexec/java_home
/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home
$ java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
$ /usr/bin/javac -version
javac 1.7.0_71
To fix it, I had to remove the extensions:
$ rm -rf ~/Library/Java/Extensions
$ sudo rm -rf /Library/Java/Extensions
Thanks @nicks!
The mechanics of this failure are still a bit mysterious to me but at least we'll hopefully be able to recognize it if it happens again.
At master I'm getting the following exceptions when trying to build:
I'm assuming since travis is passing, this is specific to MacOS. Still trying to figure out what's wrong and how to fix it.