Open miguelaferreira opened 1 day ago
sounds unrelated to this module. The error indicates the micronaut-context
module is missing which is likely a packaging issue
Thanks for the quick reply @graemerocher.
I can confirm that the micronaut-context
classes are being packaged in the docker container. I've copied all the files under /home/app
in the docker container to my localhost, and then was able to list all the libs and micronaut-context
is there.
The files I copied from the container
$ ls
application.jar
libs
resources
The micronaut-context
lib is there
$ ls libs | grep micronaut-context
micronaut-context-4.6.6.jar
micronaut-context-propagation-4.6.6.jar
The bean that the application complains is missing is in the libs/micronaut-inject-4.6.6.jar
$ jar -tf libs/micronaut-inject-4.6.6.jar | grep ApplicationEventPublisher
io/micronaut/context/event/ApplicationEventPublisher.class
io/micronaut/context/event/ApplicationEventPublisherFactory$1.class
io/micronaut/context/event/ApplicationEventPublisherFactory$2.class
io/micronaut/context/event/ApplicationEventPublisherFactory$EventLogger.class
io/micronaut/context/event/ApplicationEventPublisherFactory.class
io/micronaut/context/event/NoOpApplicationEventPublisher.class
META-INF/micronaut/io.micronaut.inject.BeanDefinitionReference/io.micronaut.context.event.ApplicationEventPublisherFactory
I've verified that these files are present on both the application version that works (without the dependency) and in the one that does not work.
If you feel like I should move this issue somewhere else, please let me know.
probably you need to upgrade to micronaut core 4.7
@graemerocher I've tried to upgrade micronaut-core to 4.7.2 and that did not help.
implementation("io.micronaut:micronaut-core:4.7.2")
implementation("io.micronaut:micronaut-core-processor:4.7.2")
implementation("io.micronaut:micronaut-context:4.7.2")
implementation("io.micronaut:micronaut-context-propagation:4.7.2")
implementation("io.micronaut:micronaut-discovery-core:4.7.2")
implementation("io.micronaut:micronaut-http:4.7.2")
implementation("io.micronaut:micronaut-http-client:4.7.2")
implementation("io.micronaut:micronaut-http-client-core:4.7.2")
implementation("io.micronaut:micronaut-http-netty:4.7.2")
implementation("io.micronaut:micronaut-http-server:4.7.2")
implementation("io.micronaut:micronaut-http-server-netty:4.7.2")
implementation("io.micronaut:micronaut-inject:4.7.2")
I've pushed a commit to my example repo with that ☝️ patch.
Expected Behavior
My expectation was that the application deployed to a k8s cluster would start just like it does locally. Producing this output:
Actual Behaviour
The application does not start and complaints about a missing bean.
Steps To Reproduce
Using the example repository I'm providing, do the following.
To verify that the application without the dependency starts, comment out the dependency (
implementation('io.micronaut.tracing:micronaut-tracing-opentelemetry-jdbc:6.9.0')
) inbuild.gradle
, then:./gradlew dockerBuild
docker push <your-docker-repository>/jdbc-tracing:latest
kubectl apply -f pod.yaml
kubectl logs <pod-name>
where you should see that the application does startTo reproduce the issue, uncomment the dependency in
build.gradle
, then:./gradlew dockerBuild
docker push <your-docker-repository>/jdbc-tracing:latest-with-bug
kubectl apply -f pod.yaml
kubectl logs <pod-name>
where you should see that the application does not startEnvironment Information
./gradlew dockerBuild
./gradlew dockerBuild
Example Application
https://github.com/miguelaferreira/micronaut-jdbc-tracing
Version
4.6.3