Skip to content

NullPointerException on RemoteProject #1283

@jacek187

Description

@jacek187

GroovyClassLoader is not bootstraped on Remote Project (created with Remote System Explorer plugin) with included libraries.
When project is opened (or Groovy COmpiler poperty tab is opened) exception is thrown:

Steps to reproduce error:

  1. Environemnt:
    Eclipse 4.20
    Remote System Explorer (latest 3.5.0)
    GroovyEclipse (latest 4.2.0.RELEASE)
  2. Create new connection in Remote Systems View
  3. Create new folder on remote system.
  4. Create Remote Project on this folder
  5. Create new subfolder and place any jar file into subfolder
  6. Add Java Nature and Groovy Nature to project
  7. Add file from lib subdirectory as java library
  8. Restart Eclipse (or close/Open project)

There are 2 errors:

  1. When project is opened GroovyClassLoader for this project is not bootsraped and failed with error in .metadata/logs:
java.lang.RuntimeException: Failed to bootstrap GroovyClassLoaders for project 'dev_test-groovy'
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:203)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getGroovyClassLoaders(GroovyClassLoaderFactory.java:122)
	at org.codehaus.jdt.groovy.integration.internal.GroovyLanguageSupport.newGroovyClassLoader(GroovyLanguageSupport.java:289)
	at org.codehaus.groovy.eclipse.dsl.script.DSLDScriptExecutor.getGroovyClassLoader(DSLDScriptExecutor.java:136)
	at org.codehaus.groovy.eclipse.dsl.script.DSLDScriptExecutor.executeScript(DSLDScriptExecutor.java:72)
	at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.refreshProject(RefreshDSLDJob.java:189)
	at org.codehaus.groovy.eclipse.dsl.RefreshDSLDJob.run(RefreshDSLDJob.java:118)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
Caused by: java.lang.RuntimeException: java.lang.NullPointerException
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:240)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.lambda$2(GroovyClassLoaderFactory.java:159)
	at java.base/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getProjectGroovyClassLoaders(GroovyClassLoaderFactory.java:157)
	... 7 more
Caused by: java.lang.NullPointerException
	at java.base/java.io.File.<init>(File.java:278)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.getAbsoluteLocation(GroovyClassLoaderFactory.java:260)
	at org.codehaus.jdt.groovy.internal.compiler.GroovyClassLoaderFactory.calculateClasspath(GroovyClassLoaderFactory.java:234)
	... 10 more
  1. It's not possible to display Groovy Compiler project preference page.
java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.IPath.toFile()" because the return value of "org.eclipse.core.resources.IProject.getLocation()" is null
	at org.codehaus.groovy.eclipse.preferences.CompilerPreferencesPage.createProjectCompilerSection(CompilerPreferencesPage.java:212)
	at org.codehaus.groovy.eclipse.preferences.CompilerPreferencesPage.createDescriptionLabel(CompilerPreferencesPage.java:99)
	at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:238)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1433)
	at org.eclipse.jface.preference.PreferenceDialog$8.run(PreferenceDialog.java:1196)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45)
	at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:174)
	at org.eclipse.jface.preference.PreferenceDialog.showPage(PreferenceDialog.java:1188)
	at org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(FilteredPreferenceDialog.java:630)
	

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions