question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Code generation in Eclipse is broken.

See original GitHub issue

Code generation doesn’t complete. The Dagger_XXX Files are missing

Dagger Version 2.12

Eclipse Version: Oxygen.1 Release (4.7.1)

Log:

org.eclipse.jdt.apt.pluggable.core
Error
Tue Oct 24 17:18:29 CEST 2017
Exception thrown by Java annotation processor dagger.internal.codegen.ComponentProcessor@79160e13

java.lang.Exception: java.util.NoSuchElementException: No value present
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:169)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:121)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:159)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:135)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:915)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:437)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:417)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:368)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:187)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:305)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:61)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:256)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:175)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:735)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:301)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:304)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:360)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:383)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:142)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:232)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
Caused by: java.util.NoSuchElementException: No value present
	at java.util.Optional.get(Optional.java:135)
	at dagger.internal.codegen.SubcomponentDeclaration$Factory.forModule(SubcomponentDeclaration.java:65)
	at dagger.internal.codegen.ModuleDescriptor$Factory.create(ModuleDescriptor.java:197)
	at dagger.internal.codegen.ComponentDescriptor$Factory.create(ComponentDescriptor.java:503)
	at dagger.internal.codegen.ComponentDescriptor$Factory.create(ComponentDescriptor.java:554)
	at dagger.internal.codegen.ComponentDescriptor$Factory.forComponent(ComponentDescriptor.java:474)
	at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:132)
	at dagger.internal.codegen.ComponentProcessingStep.process(ComponentProcessingStep.java:47)
	at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:329)
	at dagger.shaded.auto.common.BasicAnnotationProcessor.process(BasicAnnotationProcessor.java:182)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:139)
	... 24 more

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:15

github_iconTop GitHub Comments

1reaction
brychcycommented, Nov 20, 2017

I’ve been able to track down the other issue, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=527530

1reaction
brychcycommented, Nov 19, 2017

Thanks, based on https://github.com/AndreasMager/eclipse-dagger-test if found another bug in eclipse: https://bugs.eclipse.org/bugs/show_bug.cgi?id=527462. Unfortunately, this alone doesn’t allow to compile your test project, their is another bug either in dagger 2 or eclipse. BTW: I tried to set up dagger 2 as source project in eclipse to allow efficient debugging, but failed (the bazel eclipse plugin doesn’t allow importing it ( even the master version) and it has too many dependencies to manually configure the classpath)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Code Generator broken in EMF 2.8.x and Eclipse 3.8 / 4.2?
We have a problem with the EMF Tooling Code Generator that we first noticed in Eclipse 3.8/4.2. The code generation process does not...
Read more >
Eclipse comment auto-generation not working when code ...
Normally when I type /** right before a class or method definition and then hit return, then Eclipse will automatically generate some ...
Read more >
Using the Eclipse IDE for Java programming - Tutorial
Other IDE tools are also re-using components like the powerful code editor Visual Studio Code (Code) from Microsoft uses the Eclipse Java ...
Read more >
Migrate from Eclipse to IntelliJ IDEA - JetBrains
Moving from Eclipse;Exporting IntelliJ IDEA Project to Eclipse;Migration from ... The key action for generating code is Code | Generate, ...
Read more >
Capella code generation
My primary question is how to generate code from a capella project? But that can be broken down into - Can any of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found