An internal error occurred during: "Building": jakarta.json.spi.JsonProvider: org.apache.johnzon.core.JsonProviderImpl not a subtype
rombert opened this issue · 0 comments
rombert commented
A project that I'm working has a module that keeps failing to build in Eclipse + m2e . The error that is reported is java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: org.apache.johnzon.core.JsonProviderImpl not a subtype ,
Full stack trace below
``` java.util.ServiceConfigurationError: jakarta.json.spi.JsonProvider: org.apache.johnzon.core.JsonProviderImpl not a subtype at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:593) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1244) at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1273) at java.base/java.util.ServiceLoader$2.hasNext(ServiceLoader.java:1309) at java.base/java.util.ServiceLoader$3.hasNext(ServiceLoader.java:1393) at jakarta.json.spi.JsonProvider.provider(JsonProvider.java:69) at jakarta.json.Json.createReader(Json.java:189) at org.apache.sling.feature.maven.JSONFeatures.read(JSONFeatures.java:64) at org.apache.sling.feature.maven.ProjectHelper.readFeatureFile(ProjectHelper.java:619) at org.apache.sling.feature.maven.Preprocessor.readProjectFeatures(Preprocessor.java:304) at org.apache.sling.feature.maven.Preprocessor.process(Preprocessor.java:145) at org.apache.sling.feature.maven.Preprocessor.process(Preprocessor.java:110) at org.apache.sling.feature.maven.mojos.DependencyLifecycleParticipant.afterProjectsRead(DependencyLifecycleParticipant.java:79) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.executeParticipants(ProjectRegistryManager.java:825) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$15(ProjectRegistryManager.java:792) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$14(ProjectRegistryManager.java:791) at java.base/java.util.HashMap$Values.forEach(HashMap.java:1065) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.lambda$11(ProjectRegistryManager.java:789) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.readMavenProjectFacades(ProjectRegistryManager.java:761) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:393) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:367) at org.eclipse.m2e.core.internal.project.registry.ProjectRegistryManager.refresh(ProjectRegistryManager.java:319) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.getProjectFacade(MavenBuilder.java:146) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.lambda$0(MavenBuilder.java:84) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:394) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:275) at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:214) at org.eclipse.m2e.core.internal.builder.MavenBuilder$BuildMethod.execute(MavenBuilder.java:83) at org.eclipse.m2e.core.internal.builder.MavenBuilder.build(MavenBuilder.java:192) at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:1079) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:296) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:352) at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:441) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:45) at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:444) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:555) at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:503) at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:585) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:207) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:300) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63) ```This obviously comes from the slingfeature-maven-plugin that the project uses, but I don't know how to fix it:
- it's not a goal, so I can't ignore it
- the error does not appear with the CLI
- I have no idea what classloaders are set up for Maven extensions inside Eclipse
I can reproduce this on an empty workspace by importing https://github.com/rombert/pospai , which points to 4c3ef57084f55fc7ef0ae816613e66d1bedaf482 at this moment.
I'm also open to suggestions for fixes in the plugin, if you see any.