Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] NullPointerException with Java 9 and Tycho 1.1.0

Why are you using a specific version of jdt? It's likely Java 9 support breaks

Jeff 

Le 14 févr. 2018 14:16, "Katrin STRASSL" <Katrin.STRASSL@xxxxxxxxxxxxxxxxxxxxxxx> a écrit :
Hi,

I've started migrating our projects to Java 9 / Tycho 1.1.0 and now I get a NullPointerException during compilation.

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.1.0:compile (default-compile) on project my.project.name: Compilation failure: Compilation failure:
[ERROR] D:\workspace\parent_project\my_project\src\main\java\my\project\name\TransactionServiceImpl.java:
[ERROR] package my.project.name;
[ERROR] ^
[ERROR] Internal compiler error: java.lang.NullPointerException at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(BinaryModuleBinding.java:64)
[ERROR] java.lang.NullPointerException
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.BinaryModuleBinding.create(BinaryModuleBinding.java:64)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getModuleFromAnswer(LookupEnvironment.java:423)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForTypeFromModules(LookupEnvironment.java:363)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:224)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:105)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:215)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.PackageBinding.getTypeOrPackage(PackageBinding.java:236)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findImport(CompilationUnitScope.java:527)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.findSingleImport(CompilationUnitScope.java:586)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInImports(CompilationUnitScope.java:435)
[ERROR] at org.eclipse.jdt.internal.compiler.lookup.CompilationUnitScope.faultInTypes(CompilationUnitScope.java:501)
[ERROR] at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:878)
[ERROR] at org.eclipse.jdt.internal.compiler.ProcessTaskManager.run(ProcessTaskManager.java:141)
[ERROR] at java.base/java.lang.Thread.run(Thread.java:844)

Strangely, the project where the compilation fails is not the first submodule - the first five or six submodules compile perfectly fine and then on this module the compiler crashes.

To get closer to the source of the problem I tried the following:

- I manually forced tycho-compiler-plugin to use the previous version of JDT

<plugin>
        <groupId>org.eclipse.tycho</groupId>
        <artifactId>tycho-compiler-plugin</artifactId>
        <version>${tycho-version}</version>
        <dependencies>
                <dependency>
                        <groupId>org.eclipse.tycho</groupId>
                        <artifactId>org.eclipse.jdt.core</artifactId>
                        <version>3.13.50.v20171007-0855</version>
                </dependency>
        </dependencies>
</plugin>

I am aware that even if this had worked, it would be a suboptimal solution, but it was worth a try. When I ran the tycho build in an existing workspace, this configuration actually worked! But on a clean workspace it failed and complained about Fatal error compiling: Compliance level '1.4' is incompatible with target level '9'. A compliance level '9' or better is required because in the clean workspace there exist no .settings/org.eclipse.jdt.core.prefs. As ultimately I'd like my projects to compile with "standard" tycho anyway, I did not follow this path further.

- I discovered that the actual JDT version used by the current tycho release is 3.14.0.v20171206-0802 and downloaded a fresh eclipse that comes with exactly this JDT version.

This is the case for eclipse photon M4 (M5 already comes with JDT version 3.15), so I downloaded it and imported my projects. Eclipse does not report an error and also all JUnit-Tests that use the above mentioned project run fine.
Actually I had hoped that I could reproduce the error in that eclipse version and that I could use that to find a solution (maybe it's a project misconfiguration or similar).


I'm a bit clueless on how to progress from here and what I could try to pin down the problem further. Please remember that it's not a general problem but several submodules compile without exception. I could not find an obvious configuration difference between the working modules and the crashing one.

Does anyone have an idea how to progress? I'm asking here first because everything seemed to work fine from within eclipse itself. If you need further information to tackle the problem, I'll be glad to provide it.

Thanks,
Katrin

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user

Back to the top