Coder Social home page Coder Social logo

Comments (5)

oldratlee avatar oldratlee commented on July 26, 2024

@wangshiyu13 会不会加其它Java Agent(自动加bootclasspath)也有这个问题?

显式加上-Xbootclasspath/a:path/to/transmittable-thread-local-2.x.y.jar试试

from transmittable-thread-local.

CodeWeaver13 avatar CodeWeaver13 commented on July 26, 2024

@wangshiyu13 会不会加其它java agent(会自动加bootclasspath)也有这个问题?

显式加上-Xbootclasspath/a:path/to/transmittable-thread-local-2.x.y.jar试试

测试过 otel 或者 skywalking 的 agent 没有冲突
显式加上 bootclasspath 会出现加载两次的问题,最后一样会报classpath mismatch

from transmittable-thread-local.

oldratlee avatar oldratlee commented on July 26, 2024

@wangshiyu13

  • 请提供一个 极简、可运行、复现问题的 代码Demo工程。
  • 包含 otel 或者 skywalking Agent 没有冲突。

推荐提供成一个单独的工程(GitHub repo)。这样可以:

  • 方便大家能排查分析;只提供片段代码、运行问题概述,排查信息不足
  • 方便分离不相关的业务实现内容,以及排除可能的业务使用问题
    如使用配置问题、其它业务代码的意外影响

from transmittable-thread-local.

CodeWeaver13 avatar CodeWeaver13 commented on July 26, 2024

测试 demo 在这:https://github.com/wangshiyu13/ttl-dw-agent-demo

dragonwell-8.18.19文件夹内是 dw-jvm

java 启动参数
java -javaagent:/transmittable-thread-local-2.14.5.jar=ttl.agent.logger:STDOUT -javaagent:/agent-1.0-SNAPSHOT-all.jar -Xbootclasspath/a:/transmittable-thread-local-2.14.5.jar -XX:-OmitStackTraceInFastThrow -XX:+TraceClassPaths -Xquickstart:path=/root/alibaba.quickstart.sharedcache -Xquickstart:verbose -jar /ttl-agent-demo-1.0.0-SNAPSHOT.jar

报错内容如下:
root@common-ops-7b69b56c5f-sbjp2:/# java -javaagent:/transmittable-thread-local-2.14.5.jar=ttl.agent.logger:STDOUT -javaagent:/agent-1.0-SNAPSHOT-all.jar -Xbootclasspath/a:/transmittable-thread-local-2.14.5.jar -XX:-OmitStackTraceInFastThrow -XX:+TraceClassPaths -Xquickstart:path=/root/alibaba.quickstart.sharedcache -Xquickstart:verbose -jar /ttl-agent-demo-1.0.0-SNAPSHOT.jar [classpath: /ttl-agent-demo-1.0.0-SNAPSHOT.jar] cache path is set from -Xquickstart:path=/root/alibaba.quickstart.sharedcache Running as replayer [Bootstrap loader class path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.14.5.jar] [type=BOOT Expecting -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar] [BOOT classpath mismatch, actual: -Dsun.boot.class.path=/jw/dragonwell-8.18.19/jre/lib/resources.jar:/jw/dragonwell-8.18.19/jre/lib/rt.jar:/jw/dragonwell-8.18.19/jre/lib/sunrsasign.jar:/jw/dragonwell-8.18.19/jre/lib/jsse.jar:/jw/dragonwell-8.18.19/jre/lib/jce.jar:/jw/dragonwell-8.18.19/jre/lib/charsets.jar:/jw/dragonwell-8.18.19/jre/lib/jfr.jar:/jw/dragonwell-8.18.19/jre/classes:/transmittable-thread-local-2.14.5.jar:/jw/dragonwell-8.18.19/jre/lib/amd64/serverless/serverless-adapter.jar:/transmittable-thread-local-2.14.5.jar] An error has occurred while processing the shared archive file. shared class paths mismatch (hint: enable -XX:+TraceClassPaths to diagnose the failure) Error occurred during initialization of VM Unable to use shared archive.

如果在 ttl 的 jar 包打包时去掉Boot-Class-Path,则可以指定 bootclasspath 运行,但是 agent 貌似未成功

from transmittable-thread-local.

CodeWeaver13 avatar CodeWeaver13 commented on July 26, 2024

@oldratlee demo 已提供,地址https://github.com/wangshiyu13/ttl-dw-agent-demo

from transmittable-thread-local.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.