Skip to content

Conversation

@leeyazhou
Copy link
Contributor

fix build failure:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile (default-compile) on project apm-agent-core: Compilation failure: Compilation failure: 
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[51,31] cannot find symbol
[ERROR]   symbol:   method getTraceId()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[52,38] cannot find symbol
[ERROR]   symbol:   method getTraceSegmentId()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[53,30] cannot find symbol
[ERROR]   symbol:   method getSpanId()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[54,37] cannot find symbol
[ERROR]   symbol:   method getParentService()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[55,45] cannot find symbol
[ERROR]   symbol:   method getParentServiceInstance()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[56,38] cannot find symbol
[ERROR]   symbol:   method getParentEndpoint()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[57,43] cannot find symbol
[ERROR]   symbol:   method getAddressUsedAtClient()
[ERROR]   location: variable carrier of type org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[62,32] cannot find symbol
[ERROR]   symbol:   method getTraceId()
[ERROR]   location: variable snapshot of type org.apache.skywalking.apm.agent.core.context.ContextSnapshot
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[63,39] cannot find symbol
[ERROR]   symbol:   method getTraceSegmentId()
[ERROR]   location: variable snapshot of type org.apache.skywalking.apm.agent.core.context.ContextSnapshot
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[64,31] cannot find symbol
[ERROR]   symbol:   method getSpanId()
[ERROR]   location: variable snapshot of type org.apache.skywalking.apm.agent.core.context.ContextSnapshot
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[67,39] cannot find symbol
[ERROR]   symbol:   method getParentEndpoint()
[ERROR]   location: variable snapshot of type org.apache.skywalking.apm.agent.core.context.ContextSnapshot
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[95,23] cannot find symbol
[ERROR]   symbol:   method getExtensionContext()
[ERROR]   location: variable tracingContext of type org.apache.skywalking.apm.agent.core.context.TracingContext
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[121,21] cannot find symbol
[ERROR]   symbol: method getSpanId()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[119,35] cannot find symbol
[ERROR]   symbol: method getTraceId()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[120,35] cannot find symbol
[ERROR]   symbol: method getTraceSegmentId()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[122,35] cannot find symbol
[ERROR]   symbol: method getParentService()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[123,35] cannot find symbol
[ERROR]   symbol: method getParentServiceInstance()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[124,35] cannot find symbol
[ERROR]   symbol: method getParentEndpoint()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[125,35] cannot find symbol
[ERROR]   symbol: method getAddressUsedAtClient()
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextCarrier.java:[173,20] cannot find symbol
[ERROR]   symbol:   method getSpanId()
[ERROR]   location: class org.apache.skywalking.apm.agent.core.context.ContextCarrier
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/ContextSnapshot.java:[57,88] cannot find symbol
[ERROR]   symbol:   method getTraceSegmentId()
[ERROR]   location: class org.apache.skywalking.apm.agent.core.context.ContextSnapshot
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/CorrelationContext.java:[149,16] cannot find symbol
[ERROR]   symbol:   method getCorrelationContext()

fix build failure:

```
[ERROR] Failed to execute goal
org.apache.maven.plugins:maven-compiler-plugin:3.10.1:compile
(default-compile) on project apm-agent-core: Compilation failure:
Compilation failure:
[ERROR] /opt/code/git/skywalking-java/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/trace/TraceSegmentRef.java:[51,31]
cannot find symbol
[ERROR]   symbol:   method getTraceId()
```
@wu-sheng
Copy link
Member

Which env does you face this? The project is built successfully in local and CI env(s).

@leeyazhou
Copy link
Contributor Author

Which env does you face this? The project is built successfully in local and CI env(s).

It happens in two situations:

  1. compile failure when I import the project into eclipse
  2. build failure when I run mvn clean package -Pall in terminal.

JDK version

> java -version
openjdk version "23.0.2" 2025-01-21
OpenJDK Runtime Environment Temurin-23.0.2+7 (build 23.0.2+7)
OpenJDK 64-Bit Server VM Temurin-23.0.2+7 (build 23.0.2+7, mixed mode, sharing)

Maven version

> mvn -v
Apache Maven 3.9.4 (dfbb324ad4a7c8fb0bf182e6d91b0ae20e3d2dd9)
Maven home: /opt/soft/apache-maven-3.9.4
Java version: 23.0.2, vendor: Eclipse Adoptium, runtime: /Users/leeyazhou/Library/Java/JavaVirtualMachines/temurin-23.0.2-2/Contents/Home
Default locale: en_CN, platform encoding: UTF-8
OS name: "mac os x", version: "15.6", arch: "aarch64", family: "mac"

@wu-sheng
Copy link
Member

Ref to https://skywalking.apache.org/docs/main/next/en/setup/backend/backend-setup/#requirements-and-default-settings

We only support Java 11/17/21, and consider that you just bumped up lombok, could you recheck whether this is a JDK23-specific issue? And notice, JDK23 is not a TLS version. Do you have some specific reasons to use that?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a build failure caused by missing getter methods in Lombok-annotated classes by configuring the Maven compiler plugin to properly process Lombok annotations during compilation.

  • Adds Lombok annotation processor configuration to the Maven compiler plugin
  • Ensures getter methods are generated during compilation for classes using Lombok annotations

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

<path>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>${lombok.version}</version>
Copy link

Copilot AI Aug 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Lombok version is referenced using a property ${lombok.version} but this property may not be defined in the POM. Consider verifying that this property is declared in the properties section or use an explicit version number.

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leeyazhou I think this is a false alarm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. The property ${lombok.version} is defined in line 86 in the ROOT pom.xml

<lombok.version>1.18.30</lombok.version>

Copy link
Member

@kezhenxu94 kezhenxu94 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be good regardless which JDK version

@wu-sheng wu-sheng merged commit e070270 into apache:main Aug 15, 2025
227 of 284 checks passed
@wu-sheng wu-sheng changed the title fix: build failure for lombok fix: build failure for lombok in JDK23 Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants