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

Cannot invoke IExtensionRegistry.getExtensionPoint because Platform.getExtensionRegistry()" is null #656

Closed
dpalic opened this issue Sep 3, 2022 · 2 comments
Labels

Comments

@dpalic
Copy link

dpalic commented Sep 3, 2022

Describe the bug
getting exception on running

[ERROR] Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.20.0:format (Formatting Sources Java) on project email-forwarders: Execution Formatting Sources Java of goal net.revelc.code.formatter:formatter-maven-plugin:2.20.
0:format failed: Cannot invoke "org.eclipse.core.runtime.IExtensionRegistry.getExtensionPoint(String, String)" because the return value of "org.eclipse.core.runtime.Platform.getExtensionRegistry()" is null -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal net.revelc.code.formatter:formatter-maven-plugin:2.20.0:format (Formatting Sources Java) on project email-forwarders: Execution Formatting Sources Java of goal net.re
velc.code.formatter:formatter-maven-plugin:2.20.0:format failed: Cannot invoke "org.eclipse.core.runtime.IExtensionRegistry.getExtensionPoint(String, String)" because the return value of "org.eclipse.core.runtime.Platform.getExtensionRegistry()"
 is null
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:215)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution Formatting Sources Java of goal net.revelc.code.formatter:formatter-maven-plugin:2.20.0:format failed: Cannot invoke "org.eclipse.core.runtime.IExtensionRegistry.getExtension
Point(String, String)" because the return value of "org.eclipse.core.runtime.Platform.getExtensionRegistry()" is null
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:148)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: java.lang.NullPointerException: Cannot invoke "org.eclipse.core.runtime.IExtensionRegistry.getExtensionPoint(String, String)" because the return value of "org.eclipse.core.runtime.Platform.getExtensionRegistry()" is null
    at org.eclipse.jdt.core.ToolFactory.createCodeFormatter (ToolFactory.java:190)
    at net.revelc.code.formatter.java.JavaFormatter.init (JavaFormatter.java:51)
    at net.revelc.code.formatter.FormatterMojo.createCodeFormatter (FormatterMojo.java:810)
    at net.revelc.code.formatter.FormatterMojo.execute (FormatterMojo.java:422)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:210)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:156)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:148)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:305)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:972)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:568)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Versions (OS, Maven, Java, and others, as appropriate):

  • Affected version(s) of this project: 2.18.0 and 2.20.0
  • OS: Ubuntu 20.04

To Reproduce
Steps to reproduce the behavior (or a link to an example repository that reproduces the problem):

  1. mvn clean package

Expected behavior
Executes the formatting via maven

Additional context

<plugin>
   <groupId>net.revelc.code.formatter</groupId>
   <artifactId>formatter-maven-plugin</artifactId>
   <version>2.20.0</version>
   <configuration>
      <encoding>${project.build.sourceEncoding}</encoding>
      <lineEnding>${project.build.lineEnding}</lineEnding>
      <removeTrailingWhitespace>true</removeTrailingWhitespace>
      <!-- <skipJavaFormatting>true</skipJavaFormatting> -->
      <configFile>${project.basedir}/src/main/config/eclipse-java-formatter.xml</configFile>
      <skipXmlFormatting>false</skipXmlFormatting>
      <configXmlFile>${project.basedir}/src/main/config/xml-format.properties</configXmlFile>
      <includes>
         <include>${project.basedir}/**/*.xml</include>
         <include>**/*.java</include>
      </includes>
   </configuration>
   <executions>
      <execution>
         <id>Formatting Sources Java</id>
         <goals>
            <!-- runs at process-sources phase by default -->
            <goal>format</goal>
         </goals>
         <configuration>
            <skipJavaFormatting>false</skipJavaFormatting>
            <configFile>${project.basedir}/src/main/config/eclipse-java-formatter.xml</configFile>
            <skipXmlFormatting>true</skipXmlFormatting>
         </configuration>
      </execution>
      <execution>
         <id>Formatting Sources XML</id>
         <goals>
            <!-- runs at process-sources phase by default -->
            <goal>format</goal>
         </goals>
         <phase>prepare-package</phase>
         <configuration>
            <skipJavaFormatting>true</skipJavaFormatting>
            <skipXmlFormatting>false</skipXmlFormatting>
            <configXmlFile>${project.basedir}/src/main/config/xml-format.properties</configXmlFile>
            <includes>
               <include>**/*.xml</include>
            </includes>
         </configuration>
      </execution>
   </executions>
</plugin>
@dpalic dpalic added the bug label Sep 3, 2022
@dpalic
Copy link
Author

dpalic commented Sep 4, 2022

issue fixed with this too:
#621

I recommend to leave this issue open, so google will index it and other users can find it too

@ctubbsii
Copy link
Member

ctubbsii commented Sep 6, 2022

issue fixed with this too: #621

I recommend to leave this issue open, so google will index it and other users can find it too

There's not enough information in this to reproduce. However, it looks like you're saying that it's already fixed in #621. So, there's no reason to leave this open. Google can index closed issues just fine.

@ctubbsii ctubbsii closed this as completed Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants