gpt4 book ai didi

java - 如何将内存中生成的类转储到文件

转载 作者:行者123 更新时间:2023-12-01 12:46:09 24 4
gpt4 key购买 nike

我在生成的类sun.reflect.GenerateMethodAccessor1548.invoke()中遇到一些异常。是否可以将其代码转储到文件或在运行时以某种方式浏览它?它是一个非常大的应用程序的一部分,具有许多第三方库,我什至不知道哪个库首先生成了这个类。

--

最后的堆栈跟踪是:

java.lang.IllegalArgumentException: java.lang.ClassCastException@60b4bc67
at sun.reflect.GeneratedMethodAccessor1548.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_51]
at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_51]
at com.github.mustachejava.reflect.ReflectionWrapper.call(ReflectionWrapper.java:63) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.reflect.ReflectionObjectHandler.unwrap(ReflectionObjectHandler.java:34) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.reflect.guards.WrappedGuard.apply(WrappedGuard.java:33) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.reflect.GuardedWrapper.guardCall(GuardedWrapper.java:40) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.reflect.ReflectionWrapper.call(ReflectionWrapper.java:57) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.reflect.GuardedBinding.get(GuardedBinding.java:66) ~[compiler-0.8.13.jar:na]
at com.github.mustachejava.codes.DefaultCode.get(DefaultCode.java:105) ~[compiler-0.8.13.jar:na]
... 98 common frames omitted

(不再有“由”引起的痕迹)

最佳答案

该类由 JVM 生成,以优化反射的使用。这应该是错误的原因,除非 JVM 中存在错误,在这种情况下您需要升级。此方法调用的代码中更有可能存在错误。

关于java - 如何将内存中生成的类转储到文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24684547/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com