重复键org.jetbrains.jps.model.module.impl.JpsModuleImpl

时间:2019-01-03 06:56:05

标签: java intellij-idea

我的项目一直运行良好,直到我今天在intelIj中打开它并尝试运行它,但出现此错误

Error:maven-annotations-test:myapp: java.lang.IllegalStateException: Duplicate key org.jetbrains.jps.model.module.impl.JpsModuleImpl@50eac852

这不是Maven项目,所以我不知道是什么原因造成的

2 个答案:

答案 0 :(得分:1)

https://youtrack.jetbrains.com/issue/IDEA-225394相关-内部错误:(java.lang.IllegalStateException)键重复

仅在关闭Intellij并删除目录C:\Users\UserName\AppData\Local\JetBrains\IntelliJIdea2020.1

后,我设法修复了此类问题

选择Run -> Run并运行com.appointment.publishing in spring-boot-app后,项目将首次正常运行。

在项目上修改测试文件并尝试多次运行后,它将引发以下异常。

扔掉它之后,修复它的唯一方法是继续Build -> Rebuild Project

但是,如果您尝试运行项目多次(在修改测试文件之后),问题就会再次发生。

Error:Internal error: (java.lang.IllegalStateException) Duplicate key Validate JSPs in 'spring-boot-appointment-publishing:war exploded'
java.lang.IllegalStateException: Duplicate key Validate JSPs in 'spring-boot-appointment-publishing:war exploded'
    at java.util.stream.Collectors.lambda$throwingMerger$0(Collectors.java:133)
    at java.util.HashMap.merge(HashMap.java:1253)
    at java.util.stream.Collectors.lambda$toMap$58(Collectors.java:1320)
    at java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
    at java.util.Iterator.forEachRemaining(Iterator.java:116)
    at java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
    at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
    at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
    at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
    at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
    at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
    at org.jetbrains.jps.javaee.build.jspValidation.JspValidationTarget$Type.createLoader(JspValidationTarget.java:156)
    at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.load(BuildTargetTypeState.java:63)
    at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.<init>(BuildTargetTypeState.java:52)
    at org.jetbrains.jps.incremental.storage.BuildTargetsState.getTypeState(BuildTargetsState.java:122)
    at org.jetbrains.jps.incremental.storage.BuildTargetsState.getAverageBuildTime(BuildTargetsState.java:116)
    at org.jetbrains.jps.incremental.IncProjectBuilder.checkRebuildRequired(IncProjectBuilder.java:285)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:167)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:138)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:297)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:130)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:218)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:748)

IU-201.8538.31,JRE 11.0.7 + 10-b765.64x64 JetBrains s.r.o.,操作系统Windows 10(amd64)v10.0,屏幕1920x1080

在调用Build-> Build Project后,我注意到以下错误:

Error:Internal error: (java.lang.IllegalStateException) Duplicate key emdms-server (attempted merging values org.jetbrains.jps.model.module.impl.JpsModuleImpl@e8df99a and org.jetbrains.jps.model.module.impl.JpsModuleImpl@64b73e7a)
java.lang.IllegalStateException: Duplicate key emdms-server (attempted merging values org.jetbrains.jps.model.module.impl.JpsModuleImpl@e8df99a and org.jetbrains.jps.model.module.impl.JpsModuleImpl@64b73e7a)
at java.base/java.util.stream.Collectors.duplicateKeyException(Collectors.java:133)
at java.base/java.util.stream.Collectors.lambda$uniqKeysMapAccumulator$1(Collectors.java:180)
at java.base/java.util.stream.ReduceOps$3ReducingSink.accept(ReduceOps.java:169)
at java.base/java.util.AbstractList$RandomAccessSpliterator.forEachRemaining(AbstractList.java:720)
at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:484)
at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:474)
at java.base/java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:913)
at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.base/java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:578)
at org.jetbrains.jps.maven.model.impl.MavenAnnotationProcessorTargetType.createLoader(MavenAnnotationProcessorTargetType.java:50)
at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.load(BuildTargetTypeState.java:66)
at org.jetbrains.jps.incremental.storage.BuildTargetTypeState.(BuildTargetTypeState.java:55)
at org.jetbrains.jps.incremental.storage.BuildTargetsState.getTypeState(BuildTargetsState.java:110)
at org.jetbrains.jps.incremental.storage.BuildTargetsState.getAverageBuildTime(BuildTargetsState.java:104)
at org.jetbrains.jps.incremental.messages.BuildProgress.(BuildProgress.java:70)
at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:365)
at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:178)
at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:139)
at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:288)
at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:121)
at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler.lambda$channelRead0$0(BuildMain.java:228)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)

IU-192.6817.14,JRE 11.0.4 10-b304.69x64 JetBrains s.r.o,操作系统Windows 10(amd64)v10.0,屏幕1920x1080

更新:右键单击父pom.xml-> Maven->重新导入后,该异常消失了。

有时仅删除IntelliJIdea2020.1目录是不够的。我还必须删除我的C:\Users\UserName\.m2目录。

@Jet Brains团队:问题是由重复的工件配置文件引起的。为了对其进行修复,您需要从.idea / artifacts目录中删除application_name_war_exploded2.xml和application_name_war2.xml文件。 不确定为什么会产生这些重复的工件。您是否在File | File中手动编辑了工件配置?项目结构神器?

答案 1 :(得分:0)

我必须右键单击,将鼠标悬停在 Maven 上,然后单击下载源代码和文档

为我解决了