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

fastjson不兼容,导致attach到JDK1.6运行的进程后发送http请求报错 java.lang.ClassNotFoundException: java.time.LocalDateTime #1619

Closed
programmerlc opened this issue Dec 13, 2020 · 6 comments
Labels
bug Something isn't working
Milestone

Comments

@programmerlc
Copy link

programmerlc commented Dec 13, 2020

  • [*] 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.4.3
  • Arthas 版本: 3.4.3
  • 操作系统版本: AIX 7.1
  • 目标进程的JVM版本: IBM JDK1.6
  • 执行arthas-boot的版本: IBM JDK1.8

重现问题的步骤

  1. 在AIX7.1的系统上使用IBM JDK1.8执行java -jar命令运行arthas-boot包attach到IBM JDK1.6运行的进程
  2. attach成功,在操作系统窗口执行arthas命令(如dashboard、thread等)正常
  3. 发送http请求,arthas日志中报错:NoClassDefException:java.time.LocalDateTime

期望的结果

arthas响应http请求,返回正确结果(如"state" : "SUCCEEDED"),而不是"error"

实际运行的结果

arthas.log中打印错误日志:NoClassDefExpection:java.time.LocalDateTime、ClassNotFoundExpection:java.time.LocalDateTime.
http请求响应报文state为error

java.lang.NoClassDefFoundError: java.time.LocalDateTime
        at java.lang.J9VMInternals.verifyImpl(Native Method)
        at java.lang.J9VMInternals.verify(J9VMInternals.java:94)
        at java.lang.J9VMInternals.verify(J9VMInternals.java:92)
        at java.lang.J9VMInternals.prepare(J9VMInternals.java:514)
        at java.lang.Class.getConstructor(Class.java:446)
        at com.alibaba.fastjson.parser.deserializer.ASMDeserializerFactory.createJavaBeanDeserializer(ASMDeserializerFactory.java:90)
        at com.alibaba.fastjson.parser.ParserConfig.createJavaBeanDeserializer(ParserConfig.java:1075)
        at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:882)
        at com.alibaba.fastjson.parser.ParserConfig.getDeserializer(ParserConfig.java:592)
        at com.alibaba.fastjson.parser.DefaultJSONParser.parseObject(DefaultJSONParser.java:679)
        at com.alibaba.fastjson.JSON.parseObject(JSON.java:396)
        at com.alibaba.fastjson.JSON.parseObject(JSON.java:300)
        at com.alibaba.fastjson.JSON.parseObject(JSON.java:573)
        at com.taobao.arthas.core.shell.term.impl.http.api.HttpApiHandler.parseRequest(HttpApiHandler.java:188)
        at com.taobao.arthas.core.shell.term.impl.http.api.HttpApiHandler.handle(HttpApiHandler.java:93)
        at com.taobao.arthas.core.shell.term.impl.http.HttpRequestHandler.channelRead0(HttpRequestHandler.java:75)
        at com.taobao.arthas.core.shell.term.impl.http.HttpRequestHandler.channelRead0(HttpRequestHandler.java:40)
        at com.alibaba.arthas.deps.io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:99)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:377)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:59)
        at com.alibaba.arthas.deps.io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:368)
        at com.alibaba.arthas.deps.io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
        at com.alibaba.arthas.deps.io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
        at com.alibaba.arthas.deps.io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
        at com.alibaba.arthas.deps.io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at com.alibaba.arthas.deps.io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at com.alibaba.arthas.deps.io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:790)
Caused by: java.lang.ClassNotFoundException: java.time.LocalDateTime
        at java.net.URLClassLoader.findClass(URLClassLoader.java:457)
        at java.lang.ClassLoader.loadClassHelper(ClassLoader.java:701)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:680)
        at com.taobao.arthas.agent.ArthasClassloader.loadClass(ArthasClassloader.java:23)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:663)
        ... 28 common frames omitted
@hengyunabc
Copy link
Collaborator

感觉异常栈不完整,把完整的贴出来

@programmerlc
Copy link
Author

感觉异常栈不完整,把完整的贴出来

已更新

@hengyunabc
Copy link
Collaborator

具体发送的http请求是什么?

@programmerlc
Copy link
Author

具体发送的http请求是什么?

action:exec,command:version,execTimeout:5000

@programmerlc
Copy link
Author

具体发送的http请求是什么?

action:exec,command:version,execTimeout:5000

有办法解决吗

@hengyunabc
Copy link
Collaborator

是 fastjson问题,issue: alibaba/fastjson#3280

@hengyunabc hengyunabc added the bug Something isn't working label Dec 16, 2020
@hengyunabc hengyunabc added this to the 3.4.6 milestone Dec 16, 2020
@hengyunabc hengyunabc changed the title attach到IBM JDK1.6运行的进程后发送http请求报错 fastjson不兼容,导致attach到JDK1.6运行的进程后发送http请求报错 java.lang.ClassNotFoundException: java.time.LocalDateTime Dec 16, 2020
hengyunabc added a commit that referenced this issue Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants