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.

NullPointerException after Clean Build in Eclipse

See original GitHub issue

After a Clean Build, I just got the following NPE in Eclipse (see below for full error message), which caused generation of classes to fail and lead to tons of compile errors due to missing classes:

org.immutables.value.internal.$processor$.$Processor threw java.lang.NullPointerException
	at org.immutables.value.internal.$generator$.$SourceOrdering$1CollectedOrdering.compare($SourceOrdering.java:260)
	at org.immutables.value.internal.$generator$.$SourceOrdering$1CollectedOrdering.compare($SourceOrdering.java:183)
	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
	at java.util.TimSort.sort(TimSort.java:220)
	at java.util.Arrays.sort(Arrays.java:1438)
	at org.immutables.value.internal.$guava$.collect.$Ordering.immutableSortedCopy($Ordering.java:888)
	at org.immutables.value.internal.$generator$.$SourceOrdering.getAllAccessorsProvider($SourceOrdering.java:268)
...

I only noticed this after a while, as it worked fine during Incremental Build. Also javac is not affected, and works just fine.

The workaround currently is to checkout an older version of the sources, do the full build there, then checkout current version, and only use incremental compiler from now on. This is of course not a useable workaround. Another workaround might be to check in the generated sources into version control?

I have done quite a lot of changes in the last commit, and will try to figure out which specific change causes this behaviour, but that will probably take a while. In the meantime, maybe someone has seen this before?

The full error message from Eclipse:

eclipse.buildId=4.11.0.I20190307-0500
java.version=1.8.0_275
java.vendor=AdoptOpenJDK
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_DE
Framework arguments:  -product org.eclipse.epp.package.java.product -keyring /Users/ias/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -product org.eclipse.epp.package.java.product -keyring /Users/ias/.eclipse_keyring

org.eclipse.jdt.apt.pluggable.core
Info
Wed Feb 24 14:25:05 CET 2021
org.immutables.value.internal.$processor$.$Processor threw java.lang.NullPointerException
	at org.immutables.value.internal.$generator$.$SourceOrdering$1CollectedOrdering.compare($SourceOrdering.java:260)
	at org.immutables.value.internal.$generator$.$SourceOrdering$1CollectedOrdering.compare($SourceOrdering.java:183)
	at java.util.TimSort.countRunAndMakeAscending(TimSort.java:355)
	at java.util.TimSort.sort(TimSort.java:220)
	at java.util.Arrays.sort(Arrays.java:1438)
	at org.immutables.value.internal.$guava$.collect.$Ordering.immutableSortedCopy($Ordering.java:888)
	at org.immutables.value.internal.$generator$.$SourceOrdering.getAllAccessorsProvider($SourceOrdering.java:268)
	at org.immutables.value.internal.$processor$.meta.$AccessorAttributesCollector.collectGeneratedCandidateMethods($AccessorAttributesCollector.java:108)
	at org.immutables.value.internal.$processor$.meta.$AccessorAttributesCollector.collect($AccessorAttributesCollector.java:78)
	at org.immutables.value.internal.$processor$.meta.$ValueTypeComposer.compose($ValueTypeComposer.java:67)
	at org.immutables.value.internal.$processor$.meta.$Round.composeValue($Round.java:181)
	at org.immutables.value.internal.$processor$.meta.$Round.collectValues($Round.java:95)
	at org.immutables.value.internal.$processor$.$Processor.process($Processor.java:79)
	at org.immutables.value.internal.$generator$.$AbstractGenerator.process($AbstractGenerator.java:87)
	at org.immutables.processor.ProxyProcessor.process(ProxyProcessor.java:72)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.handleProcessor(RoundDispatcher.java:142)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.RoundDispatcher.round(RoundDispatcher.java:124)
	at org.eclipse.jdt.internal.compiler.apt.dispatch.BaseAnnotationProcessorManager.processAnnotations(BaseAnnotationProcessorManager.java:171)
	at org.eclipse.jdt.internal.apt.pluggable.core.dispatch.IdeAnnotationProcessorManager.processAnnotations(IdeAnnotationProcessorManager.java:138)
	at org.eclipse.jdt.internal.compiler.Compiler.processAnnotations(Compiler.java:940)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:450)
	at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:426)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:386)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.compile(BatchImageBuilder.java:214)
	at org.eclipse.jdt.internal.core.builder.AbstractImageBuilder.compile(AbstractImageBuilder.java:318)
	at org.eclipse.jdt.internal.core.builder.BatchImageBuilder.build(BatchImageBuilder.java:79)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.buildAll(JavaBuilder.java:262)
	at org.eclipse.jdt.internal.core.builder.JavaBuilder.build(JavaBuilder.java:180)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:833)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:220)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:263)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:316)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:319)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:371)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:392)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:154)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:244)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
elucashcommented, Feb 28, 2021

That’s interesting finding, that that sluggishness/oom problem is orthogonal problem potentially introduces with seemingly innocent fix, yet it may not necessarily be the case, but a good lead. @SimY4 can you please look just in case you might have any ideas of possible performance regressing in Eclipse (commit 2b9a79c), I know this might be a bit out of context and this is not a definite cause of the problem (and also some developers never use Eclipse or ECJ), just inviting any ideas on that. Thank you!

0reactions
elucashcommented, Mar 12, 2021

Agree that that could deserve another issue not directly related, maybe I’ll create one, just later

Is there a way to run ECJ from the command line?

yes, download the jdt, I’m puzzled what’s on the Maven Central, but I’ve found the good old way is a download page of JDT released, like this one https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/
under “JDT Core Batch Compiler” https://download.eclipse.org/eclipse/downloads/drops4/R-4.18-202012021800/download.php?dropFile=ecj-4.18.jar

Then you can use this jar pretty much the same way as javac command java -jar <downloaded jdt jar> <javac style command line options>

Read more comments on GitHub >

github_iconTop Results From Across the Web

java - NullPointerException in eclipse in Eclipse itself at ...
After exiting eclipse I moved .eclipse (found in the user's home ... to create a new project or import a project in eclipse...
Read more >
Get NullPointerException while creating project - Eclipse
> Any ideas what to do? Try this: - Open the error log view. (Window->Show View->Error Log) - Clean the log ( ...
Read more >
Solution for 'NullPointerException' on Eclipse Startup
And the solution we found was, it happens because some of the metadata file got corrupted during abrupt exit. So we follows the...
Read more >
Why do I get the error "java.lang.NullPointerException"? - Intel
When using Nios® II Software Build Tools for Eclipse (SBT4E), ... To clean the Eclipse cache, add -clean to the top of the...
Read more >
Application deployment NullPointerException errors in Eclipse ...
We get NullPointerException errors whenever we deploy web applications into the local WebSphere Liberty server in Eclipse. The server was installed with the ......
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