本文主要是介绍编译报错:The class java.lang.IllegalArgumentException may be caused by the wrapped,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
java: The class java.lang.IllegalArgumentException may be caused by the wrapped ProcessingEnvironment object.Please pass the wrapped ProcessingEnvironment further to super.init().If you need to access the original ProcessingEnvironment object (e.g. for creating com.sun.source.util.Trees.instance(ProcessingEnvironment)), you may use following code in the processor implementation:ProcessingEnvironment unwrappedprocessingEnv = jbUnwrap(ProcessingEnvironment.class, processingEnv);whereprivate static <T> T jbUnwrap(Class<? extends T> iface, T wrapper) {T unwrapped = null;try {final Class<?> apiWrappers = wrapper.getClass().getClassLoader().loadClass("org.jetbrains.jps.javac.APIWrappers");final Method unwrapMethod = apiWrappers.getDeclaredMethod("unwrap", Class.class, Object.class);unwrapped = iface.cast(unwrapMethod.invoke(null, iface, wrapper));}catch (Throwable ignored) {}return unwrapped != null? unwrapped : wrapper;}
java: Workaround: to make project compile with the current annotation processor implementation, start JPS with VM option: -Djps.track.ap.dependencies=falseWhen run from IDE, the option can be set in "Compiler Settings | build process VM options"
java: java.lang.IllegalArgumentException
java: java.lang.IllegalArgumentException
java.lang.RuntimeException: java.lang.IllegalArgumentExceptionat com.sun.tools.javac.main.Main.compile(Main.java:553)at com.sun.tools.javac.api.JavacTaskImpl.doCall(JavacTaskImpl.java:129)at com.sun.tools.javac.api.JavacTaskImpl.call(JavacTaskImpl.java:138)at org.jetbrains.jps.javac.JavacMain.compile(JavacMain.java:239)at org.jetbrains.jps.javac.ExternalJavacProcess.compile(ExternalJavacProcess.java:189)at org.jetbrains.jps.javac.ExternalJavacProcess.access$400(ExternalJavacProcess.java:28)at org.jetbrains.jps.javac.ExternalJavacProcess$CompilationRequestsHandler$1.run(ExternalJavacProcess.java:262)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)
Caused by: java.lang.IllegalArgumentExceptionat com.sun.tools.javac.api.JavacTrees.instance(JavacTrees.java:143)at com.supcon.supfusion.framework.cloud.rpc.feign.FeignClientTimeoutSupportProcessor.init(FeignClientTimeoutSupportProcessor.java:61)at org.jetbrains.jps.javac.APIWrappers$ProcessorWrapper.init(APIWrappers.java:190)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.jetbrains.jps.javac.APIWrappers$1.invoke(APIWrappers.java:362)at com.sun.proxy.$Proxy7.init(Unknown Source)at com.sun.tools.javac.processing.JavacProcessingEnvironment$ProcessorState.<init>(JavacProcessingEnvironment.java:500)at com.sun.tools.javac.processing.JavacProcessingEnvironment$DiscoveredProcessors$ProcessorStateIterator.next(JavacProcessingEnvironment.java:597)at com.sun.tools.javac.processing.JavacProcessingEnvironment.discoverAndRunProcs(JavacProcessingEnvironment.java:690)at com.sun.tools.javac.processing.JavacProcessingEnvironment.access$1800(JavacProcessingEnvironment.java:91)at com.sun.tools.javac.processing.JavacProcessingEnvironment$Round.run(JavacProcessingEnvironment.java:1035)at com.sun.tools.javac.processing.JavacProcessingEnvironment.doProcessing(JavacProcessingEnvironment.java:1176)at com.sun.tools.javac.main.JavaCompiler.processAnnotations(JavaCompiler.java:1170)at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:856)at com.sun.tools.javac.main.Main.compile(Main.java:523)... 9 more
构建设置的问题,调整下图位置:
-Djps.track.ap.dependencies=false
这篇关于编译报错:The class java.lang.IllegalArgumentException may be caused by the wrapped的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!