Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No error-prone scanner registered in context #188

Closed
cushon opened this issue Oct 29, 2014 · 16 comments
Closed

No error-prone scanner registered in context #188

cushon opened this issue Oct 29, 2014 · 16 comments

Comments

@cushon
Copy link
Owner

cushon commented Oct 29, 2014

Original issue created by Arne.Osthues on 2013-09-12 at 10:18 AM


When I try to compile I get the error:

No error-prone scanner registered in context. Is annotation processing enabled? Please report bug to error-prone

I am using the maven configuration from the wiki. I using the maven-processor-plugin for annotation processing but without any luck. Did I miss something in my configuration?

Do you need more Information?
Using win 8 x64; java 1.7.0_25

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by tadas.subonis on 2013-09-12 at 10:25 AM


I am getting the same.

It prints:
An exception has occurred in the compiler (1.7.0_21). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for d
uplicates. Include your program and the following diagnostic in your report. Thank you.
java.lang.IllegalStateException: No error-prone scanner registered in context. Is annotation processing enabled? Please report bug to error-prone: http://code.google.com/p/error-pro
ne/issues/entry
at com.google.errorprone.ErrorProneAnalyzer.<init>(ErrorProneAnalyzer.java:55)
at com.google.errorprone.ErrorReportingJavaCompiler.<init>(ErrorReportingJavaCompiler.java:37)
at com.google.errorprone.ErrorReportingJavaCompiler$1.make(ErrorReportingJavaCompiler.java:53)
at com.google.errorprone.ErrorReportingJavaCompiler$1.make(ErrorReportingJavaCompiler.java:50)
at com.sun.tools.javac.util.Context.get(Context.java:147)
at com.sun.tools.javac.main.JavaCompiler.instance(JavaCompiler.java:86)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.nextContext(JavacProcessingEnvironment.java:1116)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.<init>(JavacProcessingEnvironment.java:878)
at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.next(JavacProcessingEnvironment.java:913)
at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1174)
at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1108)
at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:824)
at com.sun.tools.javac.main.Main.compile(Main.java:439)
at com.sun.tools.javac.main.Main.compile(Main.java:353)
at com.google.errorprone.ErrorProneCompiler.compile(ErrorProneCompiler.java:151)
at com.sun.tools.javac.main.Main.compile(Main.java:342)
at com.sun.tools.javac.main.Main.compile(Main.java:333)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.compiler.javac.errorprone.JavacCompilerWithErrorProne.compileInProcessWithProperClassloader(JavacCompilerWithErrorProne.java:180)
at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(JavacCompiler.java:538)
at org.codehaus.plexus.compiler.javac.JavacCompiler.performCompile(JavacCompiler.java:174)
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:785)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by tadas.subonis on 2013-09-12 at 10:27 AM


I have another project where it works fine, but this failure in particular was in a project that uses GAE maven setup (https://code.google.com/p/appengine-maven-plugin/)

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-09-23 at 03:45 AM


(No comment entered for this change.)


Status: Accepted
Owner: alexeagle@google.com

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-09-23 at 03:55 AM


Pretty easy to repro. Added an annotation processor to my build with Kohsuke's
http://metainf-services.kohsuke.org/
and that breaks the same way.
I think error-prone needs to detect that we're in an annotation processing round and not hook into the compilation phase.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-09-23 at 03:59 AM


This issue was updated by revision 7de7f24eb75b.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-09-23 at 05:47 PM


Eddie, it's probably better for you to take this one over; you know a lot more about the way annotation processing is wired in javac.


Owner: eaftan@google.com

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by supertri@google.com on 2013-11-20 at 01:40 AM


(No comment entered for this change.)


Labels: -Type-NewCheck, Type-Defect

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-11-22 at 12:23 AM


Issue #190 has been merged into this issue.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by alexeagle@google.com on 2013-11-22 at 12:23 AM


Issue #175 has been merged into this issue.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by jkuhnert on 2013-11-22 at 12:40 AM


You guys might also think about asking cgruber (at your normal internal adddress) for some brief help or ideas on this since I'd be surprised if #175 didn't pique his interest at minimum and have a few easily-at-and likely resources to ask at best to thoroughly stomp on issue..As much as it can be stomped.

(See https://github.com/square/dagger/commits/master for reason I suspect cgruber (https://github.com/cgruber) may be easily seduced into some quick help )

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by jkuhnert on 2013-11-22 at 12:44 AM


https://github.com/google/compile-testing

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by husayt on 2013-11-25 at 03:28 AM


I have the same problem in two projects, both of which use lombok and hibernate validator annotations.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by mark.mclaren on 2013-12-04 at 09:19 AM


I also saw this issue when using hibernate-validator-annotation-processor, I found if I set the scope in the pom.xml for this artifact to runtime the issue went away (more of a workaround than a solution)

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by eaftan@google.com on 2013-12-31 at 12:55 AM


I've got a fix out for review here:
https://codereview.appspot.com/37830044/

After the review, I'll have to merge this, do an error-prone release, and then update the version of error-prone used by the plexus-compiler-javac-errorprone plugin.

Sorry for the long delay.


Status: Started
CC: cushon@google.com

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by eaftan@google.com on 2014-01-10 at 09:43 PM


Fix is committed. Will do a release and do the followup work with the maven error-prone plugin. I'll update this bug when the maven plugin works out of the box.

@cushon
Copy link
Owner Author

cushon commented Oct 29, 2014

Original comment posted by eaftan@google.com on 2014-02-22 at 12:36 AM


FYI, in lieu of getting plexus-compiler-javac-errorprone updated to depend on the new version of error-prone, you can override the default in your own POM file. See https://github.com/cushon/issues-import/wiki/InstallingErrorProne#Maven for how to add an explicit dependency on error-prone-core 1.1.1.

I'm closing this since it works from our end. Will still send a pull request to plexus-compiler-javac-errorprone.


Status: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant