gpt4 book ai didi

java.lang.LinkageError : loader constraint violation: when resolving method "com. sun.tools.javac.api.JavacTool.getTask

转载 作者:行者123 更新时间:2023-12-01 22:11:26 25 4
gpt4 key购买 nike

当我们在构建服务器上从 jenkins 运行构建时,出现以下异常:

java.lang.LinkageError: loader constraint violation: when resolving method "com.sun.tools.javac.api.JavacTool.getTask(Ljava/io/Writer;Ljavax/tools/JavaFileManager;Ljavax/tools/DiagnosticListener;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;)Lcom/sun/source/util/JavacTask;" the class loader (instance of java/net/URLClassLoader) of the current class, com/bea/util/jam/internal/javadoc/JavadocClassBuilder, and the class loader (instance of sun/misc/Launcher$AppClassLoader) for the method's defining class, com/sun/tools/javac/api/JavacTool, have different Class objects for the type com/sun/source/util/JavacTask used in the signature
[exec] at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.getImports(JavadocClassBuilder.java:212)
[exec] at com.bea.util.jam.internal.javadoc.JavadocClassBuilder.build(JavadocClassBuilder.java:140)
[exec] at com.bea.util.jam.provider.CompositeJamClassBuilder.build(CompositeJamClassBuilder.java:51)
[exec] at com.bea.util.jam.internal.JamClassLoaderImpl.loadClass(JamClassLoaderImpl.java:128)
[exec] at com.bea.util.jam.internal.JamServiceImpl.getAllClasses(JamServiceImpl.java:65)
[exec] at weblogic.wsee.util.JamUtil.parseSource(JamUtil.java:168)
[exec] at weblogic.wsee.util.JamUtil.parseSource(JamUtil.java:136)
[exec] at weblogic.wsee.tools.anttasks.JwsLoader.loadJClasses(JwsLoader.java:187)
[exec] at weblogic.wsee.tools.anttasks.JwsLoader.load(JwsLoader.java:75)
[exec] at weblogic.wsee.tools.anttasks.JwsModule.loadWebServices(JwsModule.java:631)
[exec] at weblogic.wsee.tools.anttasks.JwsModule.generate(JwsModule.java:432)
[exec] at weblogic.wsee.tools.anttasks.JwsModule.build(JwsModule.java:306)
[exec] at weblogic.wsee.tools.anttasks.JwscTask.execute(JwscTask.java:242)
[exec] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[exec] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:498)
[exec] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[exec] at org.apache.tools.ant.Task.perform(Task.java:348)
[exec] at org.apache.tools.ant.Target.execute(Target.java:435)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[exec] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[exec] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[exec] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[exec] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
[exec] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[exec] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:498)
[exec] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[exec] at org.apache.tools.ant.Task.perform(Task.java:348)
[exec] at org.apache.tools.ant.Target.execute(Target.java:435)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[exec] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[exec] at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
[exec] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[exec] at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:441)
[exec] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
[exec] at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:498)
[exec] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[exec] at org.apache.tools.ant.Task.perform(Task.java:348)
[exec] at org.apache.tools.ant.Target.execute(Target.java:435)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:456)
[exec] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
[exec] at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
[exec] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[exec] at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
[exec] at org.apache.tools.ant.Main.runBuild(Main.java:857)
[exec] at org.apache.tools.ant.Main.startAnt(Main.java:236)
[exec] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
[exec] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)

我们正在使用 Weblogic 12 和 Java 8。请帮忙。

最佳答案

您正在尝试使用两个类加载器(java/net/URLClassLoader 和 sun/misc/Launcher$AppClassLoader)加载一个类。但是两个加载器对定义的类不一致。

您需要确保该类仅位于一个类加载器的类路径上。

由于我们不知道为什么该类位于多个类加载器的类路径中,因此我无法真正给出如何解决该问题的答案,但以下来源可能会有所帮助:

How do I resolve this Weblogic intermittent java.lang.LinkageError? What are the steps to understanding what it means and fix it?

The java.lang.LinkageError: loader constraint violation" demystified

关于java.lang.LinkageError : loader constraint violation: when resolving method "com. sun.tools.javac.api.JavacTool.getTask,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58659018/

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