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

[infinispan-client] cache configuration not available while bootstrapping dev mode #29592

Closed
michalovjan opened this issue Nov 30, 2022 · 2 comments · Fixed by #29596
Closed
Labels
Milestone

Comments

@michalovjan
Copy link

Describe the bug

Hi,
I am trying to use infinispan cache configuration that was recently added to application yaml [1]. I am trying to use it in dev mode and this results in NPE while bootstraping. Testing with the configured cache is working well.
2022-11-30 19:47:52,653 ERROR [io.qua.run.Application] (Quarkus Main Thread) Failed to start application (with profile dev): java.lang.NullPointerException: Cannot invoke "java.net.URL.toURI()" because "configFile" is null at io.quarkus.infinispan.client.runtime.InfinispanClientProducer.builderFromProperties(InfinispanClientProducer.java:239) at io.quarkus.infinispan.client.runtime.InfinispanClientProducer.initialize(InfinispanClientProducer.java:66) at io.quarkus.infinispan.client.runtime.InfinispanClientProducer.remoteCacheManager(InfinispanClientProducer.java:367)

I debugged the issue and it looks like the classloader that is used to retrieve configuration file as a resource can't do it (Quarkus Base Runtime ClassLoader: DEV) but if I get the Thread's classLoader(Quarkus Runtime ClassLoader: DEV restart no:0) I am able to do so.

[1] https://quarkus.io/guides/infinispan-client#quarkus-infinispan-client_quarkus.infinispan-client.cache.-cache-.configuration-uri

Expected behavior

Dev mode will start correctly and Infinispan server will be configured with the cache specified in application.yaml.

Actual behavior

Starting dev mode throws NPE on failing to find resource defined in the application.yaml

How to Reproduce?

I've created a simple reproducer.

  1. git clone https://github.com/michalovjan/infinispan-bug-reproducer.git
  2. mvn clean install quarkus:dev

Output of uname -a or ver

Darwin jmichalo-mac 22.1.0 Darwin Kernel Version 22.1.0: Sun Oct 9 20:14:30 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T8103 arm64

Output of java -version

openjdk 17.0.2 2022-01-18 OpenJDK Runtime Environment Temurin-17.0.2+8 (build 17.0.2+8) OpenJDK 64-Bit Server VM Temurin-17.0.2+8 (build 17.0.2+8, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.14.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.8.6 (84538c9988a25aec085021c365c560670ad80f63) Maven home: /Users/jmichalo/.m2/wrapper/dists/apache-maven-3.8.6-bin/67568434/apache-maven-3.8.6 Java version: 17.0.2, vendor: Eclipse Adoptium, runtime: /Users/jmichalo/.sdkman/candidates/java/17.0.2-tem Default locale: en_CZ, platform encoding: UTF-8 OS name: "mac os x", version: "13.0.1", arch: "aarch64", family: "mac"

Additional information

No response

@michalovjan michalovjan added the kind/bug Something isn't working label Nov 30, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 30, 2022

/cc @gwenneg, @karesti, @wburns

@karesti
Copy link
Member

karesti commented Nov 30, 2022

Thanks for the issue, talking a look

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.

3 participants