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

RestEasy ServletConfigSourceImpl is broken #5492

Closed
dmlloyd opened this issue Nov 14, 2019 · 1 comment · Fixed by #17483
Closed

RestEasy ServletConfigSourceImpl is broken #5492

dmlloyd opened this issue Nov 14, 2019 · 1 comment · Fixed by #17483
Assignees
Labels
Milestone

Comments

@dmlloyd
Copy link
Member

dmlloyd commented Nov 14, 2019

Describe the bug
org.jboss.resteasy.microprofile.config.ServletConfigSourceImpl is essentially nonfunctional in a native image. In addition it is context-sensitive which can lead to unexpected behaviors (specifically that two reads of the same key from the same configuration object will yield the same value).

For now I've blacklisted this implementation from being registered to the native image, but it really needs to be revamped or removed.

If we want to support context-sensitive configuration then we need to add that support to Quarkus in such a way that each context gets its own Config instance.

@dmlloyd dmlloyd added the kind/bug Something isn't working label Nov 14, 2019
@huw0
Copy link

huw0 commented Jan 17, 2021

Today I added a custom ConfigSource to my app and suddenly I am getting this stack, which I believe relates to this bug...

java.lang.InstantiationException: Type `org.jboss.resteasy.microprofile.config.ServletConfigSourceImpl` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
	at java.lang.Class.newInstance(DynamicHub.java:850)
	at org.jboss.resteasy.microprofile.config.BaseServletConfigSource.<init>(BaseServletConfigSource.java:23)
	at org.jboss.resteasy.microprofile.config.ServletConfigSource.<init>(ServletConfigSource.java:21)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.util.ServiceLoader$ProviderImpl.newInstance(ServiceLoader.java:779)
	at java.util.ServiceLoader$ProviderImpl.get(ServiceLoader.java:721)
	at java.util.ServiceLoader$3.next(ServiceLoader.java:1394)
	at io.smallrye.config.SmallRyeConfigBuilder.discoverSources(SmallRyeConfigBuilder.java:89)
	at io.smallrye.config.SmallRyeConfig.buildConfigSources(SmallRyeConfig.java:79)
	at io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:62)
	at io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:359)
	at io.quarkus.runtime.generated.Config.readConfig(Config.zig:1188)
	at io.quarkus.deployment.steps.RuntimeConfigSetup.deploy(RuntimeConfigSetup.zig:42)
	at io.quarkus.runner.ApplicationImpl.doStart(ApplicationImpl.zig:389)
	at io.quarkus.runtime.Application.start(Application.java:90)
	at io.quarkus.runtime.ApplicationLifecycleManager.run(ApplicationLifecycleManager.java:97)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:62)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:38)
	at io.quarkus.runtime.Quarkus.run(Quarkus.java:104)
	at io.quarkus.runner.GeneratedMain.main(GeneratedMain.zig:29)

Possibly #9086 also relates.

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

Successfully merging a pull request may close this issue.

4 participants