-
Notifications
You must be signed in to change notification settings - Fork 855
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
ClassCastException in OpenTelemetrySdk.getTracerProvider() #1305
Comments
|
I ran |
Which application server are you using? |
I was using https://github.com/OpenLiberty/open-liberty. I added the code block at the top of this issue to a servlet filter. If I packaged the servlet filter in a WAR file and ran it on OpenLiberty, I didn't get the However, if I packaged the servlet filter inside a OSGi bundle, it always resulted in |
Can you include more of the stack trace? I'd like to know where in the code this is actually being invoked. |
@fmhwong there hasn't been any activity on this in a while. Is this still an issue? Can we close it? |
Let me dig it up. |
I investigated a bit more. This line is trying to load the implementation of
and therefore It failed at
with a |
I'm not very familiar with OSGI. Would this be resolved by #768? |
Should the |
It would just throw at the cast to |
I don't think that I'm not clear how this would solve your problem, since that would just make the |
From some cursory searching on the internet, it seems like OSGI and SPI don't work particularly well together. I would assume, therefore, that #768 would fix your issue. |
Given that this will require #768, I'm downgrading this to release:after-ga. |
I'm closing this as a duplicate of #768. Please re-open if that is not the case. |
Describe the bug
ClassCastException
was thrown when running this code snippetException:
Steps to reproduce
The above code was fine when running in a Java main program. When it was running inside an application server, the
ClassCastException
was encountered.What did you expect to see?
No exception is thrown.
What did you see instead?
ClassCastException
was thrown.What version and what artifacts are you using?
Artifacts: (e.g.,
opentelemetry-api
,opentelemetry-sdk
, which exporters, etc)Version: (e.g.,
v0.4.0
,1eb551b
, etc)How did you reference these artifacts? (excerpt from your
build.gradle
,pom.xml
, etc)opentelemetry-api and sdk 0.5.0-SNAPSHOT
Environment
Compiler: (e.g., "AdoptOpenJDK 11.0.6")
OS: (e.g., "Ubuntu 20.04")
Runtime (if different from JDK above): (e.g., "Oracle JRE 8u251")
OS (if different from OS compiled on): (e.g., "Windows Server 2019")
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: