You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Attempt to call any S3Client method on instance injected as
@Inject
Instance<S3Client> s3ClientInstance;
results in NPE:
java.lang.NullPointerException
at io.quarkus.amazon.s3.runtime.S3ClientProducer.client(S3ClientProducer.java:23)
at io.quarkus.amazon.s3.runtime.S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_Bean.create(S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_Bean.zig:202)
at io.quarkus.amazon.s3.runtime.S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_Bean.create(S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_Bean.zig:233)
at io.quarkus.arc.impl.AbstractSharedContext.createInstanceHandle(AbstractSharedContext.java:96)
at io.quarkus.arc.impl.AbstractSharedContext.access$000(AbstractSharedContext.java:14)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:29)
at io.quarkus.arc.impl.AbstractSharedContext$1.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.LazyValue.get(LazyValue.java:26)
at io.quarkus.arc.impl.ComputingCache.computeIfAbsent(ComputingCache.java:69)
at io.quarkus.arc.impl.AbstractSharedContext.get(AbstractSharedContext.java:26)
at io.quarkus.arc.impl.ClientProxies.getApplicationScopedDelegate(ClientProxies.java:17)
at io.quarkus.amazon.s3.runtime.S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_ClientProxy.arc$delegate(S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_ClientProxy.zig:86)
at io.quarkus.amazon.s3.runtime.S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_ClientProxy.createBucket(S3ClientProducer_ProducerMethod_client_c3e44358d8bba829ee2f6ae63d6f9ef0b4609f3a_ClientProxy.zig:2153)
at S3ClientHolder.doSomethingIndirectly(S3ClientHolder.java:21)
S3Client injected directly as
@Inject
S3Client s3Client;
works without such NPE.
Expected behavior
Instance injected as
@Inject
Instance<S3Client> s3ClientInstance;
should work.
Actual behavior
Currently it throws NPE.
To Reproduce
Application bean:
import software.amazon.awssdk.services.s3.S3Client;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class S3ClientHolder {
@Inject
Instance<S3Client> s3ClientInstance;
public void doSomethingIndirectly() {
s3ClientInstance.get().createBucket(b -> b.bucket("foobar"));
}
}
Describe the bug
Attempt to call any S3Client method on instance injected as
results in NPE:
S3Client injected directly as
works without such NPE.
Expected behavior
Instance injected as
should work.
Actual behavior
Currently it throws NPE.
To Reproduce
Application bean:
Test:
pom.xml:
Steps to reproduce the behavior:
Configuration
Environment (please complete the following information):
uname -a
:Linux 5.4.48-gentoo #2 SMP Wed Oct 7 20:15:36 MSK 2020 x86_64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz GenuineIntel GNU/Linux
java -version
:openjdk version "11.0.9.1" 2020-11-04 LTS
1.11.3.Final
mvnw --version
):Apache Maven 3.6.3
The text was updated successfully, but these errors were encountered: