本文介绍了字节好友1.9.x引发`java.lang.IllegalStateException:无法解析java.lang.String`错误的类型描述.这是一个已知问题吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试在Mule 4(JDK 1.8)中加载使用Byte Buddy v1.9.11检测的类时,我看到Cannot resolve type description错误. Byte Buddy是否存在已知问题,或者隔离类加载器Mule 4与Byte Buddy检测类一起使用的特定组合?任何建议表示赞赏.

I am seeing Cannot resolve type description errors when trying to load classes instrumented using Byte Buddy v1.9.11 within Mule 4 (JDK 1.8). Is there a known issue with Byte Buddy, or a particular combination of isolated classloader Mule 4 is using with Byte Buddy instrumented classes? Any suggestions are appreciated.

我正在使用Elastic Java APM代理通过其过于复杂的类加载器隔离机制来检测Mule 4,该机制似乎干扰了APM代理使用的Byte Buddy v1.9.11.

I am using Elastic Java APM agent to instrument Mule 4 with its over-complicated classloader isolation mechanism that seems to interfere with Byte Buddy v1.9.11 used by the APM agent.

java.lang.IllegalStateException: Cannot resolve type description for java.lang.String
    at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Resolution$Illegal.resolve(TypePool.java:159)
    at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$TokenizedGenericType.toErasure(TypePool.java:6505)
    at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyTypeList.get(TypePool.java:6313)
    at co.elastic.apm.agent.shaded.bytebuddy.pool.TypePool$Default$LazyTypeDescription$LazyTypeList.get(TypePool.java:6286)
    at java.util.AbstractList$Itr.next(AbstractList.java:358)
    at co.elastic.apm.agent.shaded.bytebuddy.matcher.ElementMatchers.takesArguments(ElementMatchers.java:1301)
    at co.elastic.apm.agent.shaded.bytebuddy.dynamic.scaffold.inline.InliningImplementationMatcher.of(InliningImplementationMatcher.java:71)
    at co.elastic.apm.agent.shaded.bytebuddy.dynamic.scaffold.inline.RedefinitionDynamicTypeBuilder.make(RedefinitionDynamicTypeBuilder.java:202)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$Transformation$Simple$Resolution.apply(AgentBuilder.java:10132)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.doTransform(AgentBuilder.java:10551)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10514)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.access$1500(AgentBuilder.java:10280)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10889)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer$LegacyVmDispatcher.run(AgentBuilder.java:10836)
    at java.security.AccessController.doPrivileged(Native Method)
    at co.elastic.apm.agent.shaded.bytebuddy.agent.builder.AgentBuilder$Default$ExecutingTransformer.transform(AgentBuilder.java:10437)
    at sun.instrument.TransformerManager.transform(TransformerManager.java:188)
    at sun.instrument.InstrumentationImpl.transform(InstrumentationImpl.java:428)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    at org.mule.runtime.module.artifact.api.classloader.FineGrainedControlClassLoader.findLocalClass(FineGrainedControlClassLoader.java:171)
    at org.mule.runtime.module.artifact.api.classloader.FineGrainedControlClassLoader.loadClass(FineGrainedControlClassLoader.java:88)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    at co.elastic.apm.api.NoopTransaction.startSpan(NoopTransaction.java:132)
    at co.elastic.apm.agent.utils.SpanUtils.startSpan(SpanUtils.java:34)
    at co.elastic.apm.agent.internal.ApmMessageProcessorNotificationListener.onNotification(ApmMessageProcessorNotificationListener.java:27)
    at co.elastic.apm.agent.internal.ApmMessageProcessorNotificationListener.onNotification(ApmMessageProcessorNotificationListener.java:10)
    at org.mule.runtime.core.api.context.notification.ServerNotificationManager.lambda$fireNotification$0(ServerNotificationManager.java:193)
    at org.mule.runtime.core.internal.context.notification.Sender.dispatch(Sender.java:28)
    at org.mule.runtime.core.internal.context.notification.Policy.dispatchToSenders(Policy.java:146)
    at org.mule.runtime.core.internal.context.notification.Policy.doDispatch(Policy.java:134)
    at org.mule.runtime.core.internal.context.notification.Policy.dispatch(Policy.java:106)
    at org.mule.runtime.core.api.context.notification.ServerNotificationManager.notifyListeners(ServerNotificationManager.java:211)
    at org.mule.runtime.core.api.context.notification.ServerNotificationManager.fireNotification(ServerNotificationManager.java:193)
    at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain.fireNotification(AbstractMessageProcessorChain.java:373)
    at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain.lambda$preNotification$23(AbstractMessageProcessorChain.java:339)
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:190)
    at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$1.onNext(AbstractMessageProcessorChain.java:292)
    at org.mule.runtime.core.privileged.processor.chain.AbstractMessageProcessorChain$1.onNext(AbstractMessageProcessorChain.java:285)
    at reactor.core.publisher.FluxHide$SuppressFuseableSubscriber.onNext(FluxHide.java:127)
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:204)
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:204)
    at reactor.core.publisher.FluxPeekFuseable$PeekFuseableSubscriber.onNext(FluxPeekFuseable.java:204)
    at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.runAsync(FluxPublishOn.java:398)
    at reactor.core.publisher.FluxPublishOn$PublishOnSubscriber.run(FluxPublishOn.java:484)
    at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:84)
    at reactor.core.scheduler.WorkerTask.call(WorkerTask.java:37)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.mule.service.scheduler.internal.AbstractRunnableFutureDecorator.doRun(AbstractRunnableFutureDecorator.java:111)
    at org.mule.service.scheduler.internal.RunnableFutureDecorator.run(RunnableFutureDecorator.java:54)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

推荐答案

我假设Elasticsearch代理使用的类文件解析器正在直接查询类加载器,而该特定的类加载器正在将所隐藏的类文件隐藏在这里.

I assume that the class file resolver used by the Elasticsearch agent is querying the class loader directly where this particular class loader is hiding the class files in question.

您可以说这是类加载器隐藏类文件的问题,或者是弹性搜索代理不尝试其他类加载器或重新尝试重新定义已加载类的问题.我会联系这两个实体,因为这可能会干扰不同的工具.

You can argue that this is an issue of the class loader hiding the class file or an issue of the elastic search agent not attempting other class loaders or reattempting the redefinition of the loaded class. I'd contact both entities as this can disturb different tooling.

这篇关于字节好友1.9.x引发`java.lang.IllegalStateException:无法解析java.lang.String`错误的类型描述.这是一个已知问题吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 18:01