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

JDK 17 Official support #2327

Merged
merged 9 commits into from Jan 10, 2022
Merged

Conversation

SylvainJuge
Copy link
Member

@SylvainJuge SylvainJuge commented Dec 8, 2021

  • remove few disabled tests on JDK 15,16 that are now working as expected thanks to system lambda jdk 16 compatibility issue #1942
  • update documentation
  • remove jdk 12,13,14 from compatibility tests for now
  • add jdk 18 to compatibility tests

What does this PR do?

fixes #1953
supersedes #2158

@elastic-apm-tech elastic-apm-tech added this to In Progress in APM-Agents (OLD) Dec 8, 2021
Jenkinsfile Outdated Show resolved Hide resolved
@apmmachine
Copy link
Collaborator

apmmachine commented Dec 8, 2021

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-01-10T12:32:35.717+0000

  • Duration: 70 min 48 sec

  • Commit: 2d37d45

Test stats 🧪

Test Results
Failed 0
Passed 2640
Skipped 21
Total 2661

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

  • run compatibility tests : Run the JDK Compatibility test.

  • run integration tests : Run the APM-ITs.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@SylvainJuge SylvainJuge marked this pull request as ready for review December 8, 2021 17:08
@MatCuk
Copy link

MatCuk commented Jan 5, 2022

Hi,

jdk17 is released now for quite some time.
We migrated to jdk 17 and we are currently blocked by elastic apm as it's not working.
Is there any timeline when will this be released?

@SylvainJuge
Copy link
Member Author

Hi @MatCuk , this PR is mostly about two things:

  • making sure that we can build and test with JDK17 on CI, including disabling a few tests that are know to fail on JDK16 and JDK18
  • document the support schedule

This PR is NOT about adding support to JDK17, which is already working as we don't have any major issue reported with it so far.

If you have any issue running the agent with JDK17 ? If so, I would suggest to:

  • open a discussion in the forum here: https://discuss.elastic.co/c/apm.
  • when (and if) the issue is confirmed open an issue with details and ideally steps to reproduce.

@MatCuk
Copy link

MatCuk commented Jan 5, 2022

Ok I see. Thanks for the reply.
I got some exception and when checking documentation I saw
https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html
only jdk11 is listed so I presumed this PR will add support.
Might be some other issue then.

@SylvainJuge SylvainJuge enabled auto-merge (squash) January 10, 2022 13:00
@SylvainJuge SylvainJuge merged commit b679c87 into elastic:master Jan 10, 2022
APM-Agents (OLD) automation moved this from In Progress to Done Jan 10, 2022
@antemo
Copy link

antemo commented Feb 3, 2022

Hi

Currently we are building our project with JDK17, but targeting JDK11 (until all apps can run with JDK17).

When running this app with JDK17 we get exception:

Failed to start agent
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at co.elastic.apm.agent.bci.AgentMain.init(AgentMain.java:119)
        at co.elastic.apm.agent.bci.AgentMain.agentmain(AgentMain.java:69)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.java:491)
        at java.instrument/sun.instrument.InstrumentationImpl.loadClassAndCallAgentmain(InstrumentationImpl.java:513)
Caused by: java.lang.IllegalArgumentException: Unsupported class file major version 61
        at co.elastic.apm.agent.shaded.asm.ClassReader.<init>(ClassReader.java:196)
        at co.elastic.apm.agent.shaded.asm.ClassReader.<init>(ClassReader.java:177)
        at co.elastic.apm.agent.shaded.asm.ClassReader.<init>(ClassReader.java:163)
        at co.elastic.apm.agent.shaded.bytebuddy.utility.OpenedClassReader.of(OpenedClassReader.java:86)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default.parse(TypePool.java:679)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default.doDescribe(TypePool.java:665)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$WithLazyResolution.access$001(TypePool.java:745)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$WithLazyResolution.doResolve(TypePool.java:843)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$WithLazyResolution$LazyResolution.isResolved(Type
Pool.java:872)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyAnnotationValue$ForTypeVa
lue.doResolve(TypePool.java:6058)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyAnnotationValue.filter(Ty
pePool.java:5995)
        at co.elastic.apm.agent.shaded.bytebuddy.description.annotation.AnnotationValue$AbstractBase.filter(AnnotationVa
lue.java:579)
        at co.elastic.apm.agent.shaded.bytebuddy.description.annotation.AnnotationDescription$AnnotationInvocationHandle
r.of(AnnotationDescription.java:253)
        at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyAnnotationDescription$Loa
dable.load(TypePool.java:5964)
        at co.elastic.apm.agent.bci.ElasticApmAgent.validateAdvice(ElasticApmAgent.java:481)
        at co.elastic.apm.agent.bci.ElasticApmAgent.getTransformer(ElasticApmAgent.java:428)
        at co.elastic.apm.agent.bci.ElasticApmAgent.applyAdvice(ElasticApmAgent.java:390)
        at co.elastic.apm.agent.bci.ElasticApmAgent.initAgentBuilder(ElasticApmAgent.java:313)
        at co.elastic.apm.agent.bci.ElasticApmAgent.initInstrumentation(ElasticApmAgent.java:260)
        at co.elastic.apm.agent.bci.ElasticApmAgent.initInstrumentation(ElasticApmAgent.java:164)
        at co.elastic.apm.agent.bci.ElasticApmAgent.initialize(ElasticApmAgent.java:150)
        ... 12 more

When running same app with JDK11 we get no issues.

Is this a known problem? And if so, is there any way to resolve this?

@SylvainJuge SylvainJuge deleted the jdk17-official-support branch February 3, 2022 14:23
@SylvainJuge
Copy link
Member Author

Hi @antemo ,

This is not expected, which version of the agent are you using here ? This error indicates an old version of the agent is used as there is still class shading used for agent dependencies thus it's pre 1.28.x (now bytebuddy and asm dependencies remain in their original packages).

Could you try with latest agent version 1.28.4 to see if the issue persists ? If yes then opening a new issue might be relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Update CI, tests & doc for Java 17 when GA
6 participants