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

JAVA_OPTS is overriden during instrumentation #1130

Open
esara opened this issue Apr 20, 2024 · 0 comments · May be fixed by #1133
Open

JAVA_OPTS is overriden during instrumentation #1130

esara opened this issue Apr 20, 2024 · 0 comments · May be fixed by #1133

Comments

@esara
Copy link

esara commented Apr 20, 2024

Describe the bug
Somewhat similar to #1083 but for JAVA

To Reproduce
Steps to reproduce the behavior:

Prior to the instrumentation, we had in the entrypoint.sh

  JAVA_OPTS="$JAVA_OPTS
            --add-opens java.base/java.time=ALL-UNNAMED

which is needed for packages like java.time based on https://openjdk.org/jeps/396 with java17

but after the instrumentation

$ set|grep JAVA
JAVA_OPTS='-javaagent:/var/odigos/java/javaagent.jar -Dotel.traces.sampler=always_on -Dotel.logs.exporter=none -Dotel.exporter.otlp.protocol=grpc -Dotel.exporter.otlp.endpoint=http://192.168.1.112:4317/'
JAVA_TOOL_OPTIONS='-javaagent:/var/odigos/java/javaagent.jar -Dotel.traces.sampler=always_on -Dotel.logs.exporter=none -Dotel.exporter.otlp.protocol=grpc -Dotel.exporter.otlp.endpoint=http://192.168.1.112:4317/'

which results in

2024-04-18 13:33:58,966  WARN [qtp1662844977-6748] [DefaultHandlerExceptionResolver]   : Resolved [org.springframework.http.converter.HttpMessageNotWritableException: Could not write JSON: Unable to make field private final java.time.LocalDate java.time.LocalDateTime.date accessible: module java.base does not "opens java.time" to unnamed module @d453a986; nested exception is java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.time.LocalDate java.time.LocalDateTime.date accessible: module java.base does not "opens java.time" to unnamed module @d453a986]

Expected behavior
It would be preferable to either append the JAVA_OPTS or have the options of not settings it

Additional context
JAVA_OPTS maybe set in the dockerfile again and not in the deployment/container env variables, unfortunate, but again, we may need to find a way to discover it from the process, similar to PYPATH

@RonFed RonFed linked a pull request May 24, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant