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

NPE in PDEState.querySystemPackages() #721

Closed
yuzawa-san opened this issue Aug 24, 2023 · 7 comments · Fixed by #722
Closed

NPE in PDEState.querySystemPackages() #721

yuzawa-san opened this issue Aug 24, 2023 · 7 comments · Fixed by #722

Comments

@yuzawa-san
Copy link

yuzawa-san commented Aug 24, 2023

I have been trying to build https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/ using the instructions in its readme which matches https://www.vogella.com/tutorials/EclipsePlatformDevelopment/article.html#creating-a-custom-eclipse-ide-build as well.

It fails in

[INFO] --- tycho-eclipserun:4.0.2:eclipse-run (dont_skip_me) @ org.eclipse.jdt.doc.isv ---

with this following error:

Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.jdt.launching.IVMInstall.getLibraryLocations()" because "vm" is null
	at org.eclipse.jdt.launching.JavaRuntime.getLibraryLocations(JavaRuntime.java:2144)
	at org.eclipse.pde.internal.build.site.PDEState.querySystemPackages(PDEState.java:649)
	at org.eclipse.pde.internal.build.site.PDEState.lambda$5(PDEState.java:540)
	at java.base/java.util.Optional.orElseGet(Optional.java:364)
	at org.eclipse.pde.internal.build.site.PDEState.querySystemPackages(PDEState.java:523)
	at org.eclipse.pde.internal.build.site.PDEState.getSystemPackages(PDEState.java:493)
	at org.eclipse.pde.internal.core.TargetPlatformHelper.getSystemPackages(TargetPlatformHelper.java:391)
	at org.eclipse.pde.internal.core.TargetPlatformHelper.addEnvironmentProperties(TargetPlatformHelper.java:378)
	at org.eclipse.pde.internal.core.TargetPlatformHelper.getPlatformProperties(TargetPlatformHelper.java:365)
	at org.eclipse.pde.internal.core.MinimalState.initializePlatformProperties(MinimalState.java:251)
	at org.eclipse.pde.internal.core.PDEState.<init>(PDEState.java:70)
	at org.eclipse.pde.internal.core.PluginModelManager.initializeTable(PluginModelManager.java:617)
	at org.eclipse.pde.internal.core.PluginModelManager.getEntryTable(PluginModelManager.java:554)
	at org.eclipse.pde.internal.core.PluginModelManager.findEntry(PluginModelManager.java:1031)
	at org.eclipse.pde.core.plugin.PluginRegistry.findEntry(PluginRegistry.java:77)
	at org.eclipse.pde.internal.core.schema.SchemaRegistry.getSchemaURL(SchemaRegistry.java:130)
	at org.eclipse.pde.internal.core.schema.IncludedSchemaDescriptor.getPluginRelativePath(IncludedSchemaDescriptor.java:75)
	at org.eclipse.pde.internal.core.schema.IncludedSchemaDescriptor.computeURL(IncludedSchemaDescriptor.java:48)
	at org.eclipse.pde.internal.core.schema.SchemaInclude.createInternalSchema(SchemaInclude.java:107)
	at org.eclipse.pde.internal.core.schema.SchemaInclude.getIncludedSchema(SchemaInclude.java:100)
	at org.eclipse.pde.internal.core.ant.ConvertSchemaToHTML.execute(ConvertSchemaToHTML.java:110)

details:

  • I am on a Mac
  • Java 17 set via JAVA_HOME environment variable, but it appears to fail as well when my default Java 19 is used.
  • According the full debug logs (available upon request), the build appears to be currently using org.eclipse.pde.build-3.12.100.v20230823-0822.jar but I was having problems with org.eclipse.pde.build.source_3.12.100.v20230818-2110.jar earlier
  • Is this related to Query others suitable VMs for system-packages if one cannot be read #714 @HannesWell or any of your other recent changes?
@HannesWell
Copy link
Member

Thanks for this report.
According to the StackTrace you probably don't have a default VM selected in the preferences under Installed JREs, do you?

@yuzawa-san
Copy link
Author

@HannesWell thanks for the quick fix. my build is working again as expected

@HannesWell
Copy link
Member

HannesWell commented Aug 24, 2023

@HannesWell thanks for the quick fix. my build is working again as expected

Thanks for reporting back.

Could you please check your default VM as mentioned in my previous comment?

@yuzawa-san
Copy link
Author

@HannesWell I was running from the command line per the instructions linked in the original issue report above, so there was no place to set default VM selected in the preferences under Installed JREs. I was using the JAVA_HOME environment variable. And even if there was no JAVA_HOME set, the java -version still properly finds my last installed JDK. Is there a parameter/property I should be passing into my mvn command? Is this is a Mac quirk?

@laeubi
Copy link
Contributor

laeubi commented Aug 25, 2023

Is this is a Mac quirk?

Mac requires special handling in finding JVMs and I think the isv builds are not really optimized for this case so I think the code can not rely on any "default" selections as most likely there is no VM beside the running one (and even this will not be listed) anyways in that setup.

@HannesWell
Copy link
Member

I would have expected that at least by default JDT sets a default VM and among the know ones.
At least on Windows/Linux when I use a freshly installed/unzipped Eclipse there is always a default set (by default usually the running one).

@laeubi
Copy link
Contributor

laeubi commented Aug 26, 2023

As said for mac it only works if a special bundle is additionally pulled in:

https://github.com/eclipse-jdt/eclipse.jdt.debug/tree/master/org.eclipse.jdt.launching.macosx

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

Successfully merging a pull request may close this issue.

3 participants