Java agent interferes with Spring Boot executable jar classpath resolution
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- java, spring-boot
- Domain
- backend
Research direction
Start with the trivial sample Spring Boot application linked in the issue and compare the working Maven invocation with the failing java -javaagent ... -jar merlin-svc.war command. Read the attached disco.log and verify how the executable WAR resolves javax/servlet/Filter; done means the documented agent invocation starts successfully without the NoClassDefFoundError.
Written by the indexing model from the issue text.
Description
I have a trivial sample Spring Boot application that I'm attempting to run as an executable jar. The app runs fine without the agent with Jetty and Tomcat. The app also runs fine with the agent when started via Maven. However, starting the executable jar with the documented instructions for including an agent results in the error java.lang.NoClassDefFoundError: javax/servlet/Filter.
This class is definitely available:
[ssm-user@ip-10-0-146-244 merlin]$ unzip -l target/merlin-svc.war | grep javax
95806 03-17-2023 19:36 WEB-INF/lib/javax.servlet-api-3.1.0.jar
26586 03-17-2023 19:36 WEB-INF/lib/javax.annotation-api-1.3.2.jar
Working invocations:
./mvnw spring-boot:run -Dspring-boot.run.jvmArguments="-javaagent:/opt/aws/disco/disco-java-agent.jar=pluginPath=/opt/aws/disco/disco-plugins/"
# This only works with the Netty branch
java -jar merlin-svc.war
Failing invocation:
# Same behavior with and without verbose logging, see attached log below
java -javaagent:/opt/aws/disco/disco-java-agent.jar=pluginPath=/opt/aws/disco/disco-plugins/:loggerfactory=software.amazon.disco.agent.reflect.logging.StandardOutputLoggerFactory:verbose -jar /opt/xxxx/merlin/merlin-svc.war
- Dominant language
- Java
- Stars
- 46
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from aws/aws-xray-java-agent
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aws/aws-xray-java-agent#120 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
aws/aws-xray-java-agent#117 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aws/aws-xray-java-agent#111 · 1 comment ·
-
question stale
aws/aws-xray-java-agent#108 · 2 comments · 1 assignee ·
-
enhancement
Difficulty 4/5 3-5 days Newbie friendliness 35/100
aws/aws-xray-java-agent#96 ·
All issues in aws/aws-xray-java-agent
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100