java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.ProcessEnvironment$Variable (java.lang.String and java.lang.ProcessEnvironment$Variable are in module java.base of loader 'bootstrap') #5699
Replies: 3 comments 1 reply
-
What do your dependencies look like? Are you sure that all of your versions are aligned to the same thing? |
Beta Was this translation helpful? Give feedback.
-
Good to hear back from you :). We noticed that this was caused due to a hack we added in our integration tests which was setting null map in our environment variables and it resulted in iterating through System.getenv() entries throwing this error. It will be worth making the code independent of such system environment variables. We had null key in our environment variable and it was throwing above exception in Or probably worth making this code more defensive to avoid such weird exceptions in future while we will also make changes at our end. |
Beta Was this translation helpful? Give feedback.
-
@pragativ-splunk I'm not convinced that the otel code should be updated to guard against such an edge case. There's really no practical way using normal, non-reflection APIs to get nulls into the environment nor system properties. If you do find a way, please provide a code example. Otherwise, I think it's completely reasonable for the otel code to assume that there are not nulls in the environment or system properties as it iterates. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I currently upgraded otel from 1.13 to 1.27 version. There seems to be some wierd exceptions while creating LongHistogram
The error I see is:
I have spent considerable time troubleshooting this but no luck!
Beta Was this translation helpful? Give feedback.
All reactions