-
Notifications
You must be signed in to change notification settings - Fork 599
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
ReactiveMessaging "CDI container is not available" #26342
Comments
CDI depends on application metadata held in the Thread to know which application a request is coming from. The IllegalStateException from AbstractCDIRuntime is telling me that this metadata is absent, which usually happens when a new thread is created without the state being transferred over from its parent. Am I correct in assuming you are bundling the smallrye library directly into your application? I see that we have code to set that state when creating a new thread in the I'm afraid there is no workaround to use OpenTelemerty without CDI. OpenTelmetry is depending on CDI to tell it which application the current Thread is working in, if it didn't use CDI it would have to aquire this information itself and it would do so using the exact same MetaData. In the meanwhile I will write a FAT test based on your code. |
Yes, you are correct about bundling, here is extract from my pom.xml
I've tried the latest nightly and it still complains loudly, but it actually seems to work (I'm able to consume the messages and use RestClient from within the channel) Log:
Trace:
Please let me know if I can provide more info. |
I have a suspicion that's a known bug where the fix is delivered but hasn't made it into the nightly builds. To help me confirm please could you provide the file ffdc_23.09.21_14.37.35.0.log and any other files in the ffdc directory. Thank you. |
Requested file attached: |
Unfortunately that is not the issue I previously dealt with. Looking at your FFDC there is nothing in that stack which will register a J2EEName onto the thread context. And since you get this error its safe to assume there's nothing in the previous thread propagating it. How are you spawning new threads? Using the ManagedExecutorService provided by our concurrent feature is a safe option. |
Hello again. It has been a while since you replied, I hope this means all is well on your end? When an issue is over I like to create a test to ensure Liberty doesn't regress, would it be possible for you to share your code or a dummy version which I can use to base the test on? |
Hello, real life interferes, please leave this open for a few days more so I can create another repeatable text with an executor (since that was the whole idea). |
Real life happens to us all, see you in a few days more. |
Hello, I just want to report that everything seems to work as expected in the current beta (23.0.0.11-beta), e.g. something simple like reading payloads from Kafka and using (blocking) Rest client from within the channel consumer. This time I'm using
Thank you for the help and support, you can close the issue. |
Describe the bug
When trying to inject
RestClient
into Bean which contains reactive messaging channel, I get "CDI container is not available", and application fails on startup.The error seems to be related to OpenTelemetry feature (see trace bellow), but I'd really like to avoid removing that totally from the app, since we use it heavily.
Steps to Reproduce
From OpenLiberty starter template with MicroProfile 6.0, and following sample classes:
The channel is configured for Kafka in
microprofile-config.properties
Expected behavior
Application starting and being able to use RestClient from within
consume()
method (as you can see we haven't even come to that).My current workaround is to use Java 11 async http client, which is slightly too involved for my taste.
Diagnostic information:
Trace:
The text was updated successfully, but these errors were encountered: