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

Class loader clash during Quarkus augmentation #22

Closed
ppalaga opened this issue Feb 27, 2020 · 4 comments
Closed

Class loader clash during Quarkus augmentation #22

ppalaga opened this issue Feb 27, 2020 · 4 comments
Labels
wontfix This will not be worked on

Comments

@ppalaga
Copy link
Contributor

ppalaga commented Feb 27, 2020

Steps to reproduce

git clone https://github.com/apache/camel-quarkus.git
cd camel-quarkus
mvnd clean install -DskipTests -e

Sometimes the following error occurs in one or more modules:

[ERROR] Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.0.Alpha2:build (default) on project camel-quarkus-integration-test-snakeyaml: Failed to build quarkus application: java.lang.IllegalStateException: Configuration already registered for the given class loader -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal io.quarkus:quarkus-maven-plugin:1.3.0.Alpha2:build (default) on project camel-quarkus-integration-test-snakeyaml: Failed to build quarkus application
        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.jboss.fuse.mvnd.builder.SmartBuilderImpl.buildProject(SmartBuilderImpl.java:176)
        at org.jboss.fuse.mvnd.builder.SmartBuilderImpl$ProjectBuildTask.run(SmartBuilderImpl.java:196)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to build quarkus application
        at io.quarkus.maven.BuildMojo.execute(BuildMojo.java:185)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210)
        ... 10 common frames omitted
Caused by: java.lang.RuntimeException: java.lang.IllegalStateException: Configuration already registered for the given class loader
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:206)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.createProductionApplication(AugmentActionImpl.java:77)
        at io.quarkus.maven.BuildMojo.execute(BuildMojo.java:172)
        ... 12 common frames omitted
Caused by: java.lang.IllegalStateException: Configuration already registered for the given class loader
        at io.smallrye.config.SmallRyeConfigProviderResolver.registerConfig(SmallRyeConfigProviderResolver.java:128)
        at io.quarkus.runtime.configuration.QuarkusConfigFactory.setConfig(QuarkusConfigFactory.java:48)
        at io.quarkus.deployment.ExtensionLoader.loadStepsFrom(ExtensionLoader.java:195)
        at io.quarkus.deployment.QuarkusAugmentor.run(QuarkusAugmentor.java:89)
        at io.quarkus.runner.bootstrap.AugmentActionImpl.runAugment(AugmentActionImpl.java:204)
        ... 14 common frames omitted

It might be a fault of the quarkus-maven-plugin but I wanted to consult here before reporting in Quarkus. WDYT @gnodet ?

@gnodet
Copy link
Contributor

gnodet commented Feb 27, 2020

At first glance, I think this is related to the #18 memory leak in some way.
I suspect the reason is that the quarkus maven plugin uses static variables and does not perform any cleaning at the end of the augmentation process, assuming the JVM won't be reused for another augmentation. This leads to those errors I think.
I'll have a quick look to see if we can do something easily.

@ppalaga
Copy link
Contributor Author

ppalaga commented Feb 28, 2020

the quarkus maven plugin uses static variables

Yes, going through the stacktrace seems to confirm your theory. There is a static config field in the QuarkusConfigFactory that is set via QuarkusConfigFactory.setConfig() that we see in the stack trace.

@ppalaga
Copy link
Contributor Author

ppalaga commented Mar 2, 2020

The issue seems to stop occurring after this change in Quarkus quarkusio/quarkus#7335

@ppalaga
Copy link
Contributor Author

ppalaga commented Mar 8, 2020

Closing, because I have not seen this for a couple of days.

@ppalaga ppalaga closed this as completed Mar 8, 2020
@ppalaga ppalaga added this to the Black hole milestone Jul 30, 2020
@gnodet gnodet added the wontfix This will not be worked on label Dec 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants