我一直在开发Java Jersey RESTful Web应用程序,并且一切正常,直到我再次编译并得到以下编译器错误。

我已经用Google搜索了这个问题,许多人建议做File->Invalidate Caches/Restart...,但这没有用。

我还尝试手动删除Mac OS X目录:/Libary/Caches/IntellijIdea14中的文件。这也没有用。

以前有没有人经历过?我很困惑为什么会出现此错误,以及到底是什么原因引起的。这肯定拖延了我的发展!

堆栈跟踪:

Information:Internal caches are corrupted or have outdated format, forcing project rebuild: java.io.FileNotFoundException: /Users/grantmcgovern/Dropbox/Developer/Projects/1834Software/GymAPI/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/.idea/libraries/Maven__org_glassfish_jersey_test_framework_providers_jersey_test_framework_provider_grizzly2_2_17.xml (File name too long)
Information:4/5/15, 10:39 PM - Compilation completed with 1 error and 0 warnings in 29 sec
Error:Internal error: (java.io.FileNotFoundException) /Users/grantmcgovern/Dropbox/Developer/Projects/1834Software/GymAPI/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/.idea/libraries/Maven__org_glassfish_jersey_test_framework_providers_jersey_test_framework_provider_grizzly2_2_17.xml (File name too long)
java.io.FileNotFoundException: /Users/grantmcgovern/Dropbox/Developer/Projects/1834Software/GymAPI/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/target/classes/target/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/out/artifacts/GymAPI_war_exploded/WEB-INF/classes/.idea/libraries/Maven__org_glassfish_jersey_test_framework_providers_jersey_test_framework_provider_grizzly2_2_17.xml (File name too long)
    at java.io.FileOutputStream.open(Native Method)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:221)
    at java.io.FileOutputStream.<init>(FileOutputStream.java:171)
    at com.intellij.openapi.util.io.FileUtil.openOutputStream(FileUtil.java:508)
    at com.intellij.openapi.util.io.FileUtil.performCopy(FileUtil.java:460)
    at com.intellij.openapi.util.io.FileUtil.copyContent(FileUtil.java:454)
    at org.jetbrains.jps.incremental.artifacts.instructions.FilterCopyHandler.copyFile(FilterCopyHandler.java:40)
    at org.jetbrains.jps.incremental.artifacts.instructions.FileBasedArtifactRootDescriptor.copyFromRoot(FileBasedArtifactRootDescriptor.java:100)
    at org.jetbrains.jps.incremental.artifacts.IncArtifactBuilder.build(IncArtifactBuilder.java:159)
    at org.jetbrains.jps.incremental.artifacts.IncArtifactBuilder.build(IncArtifactBuilder.java:50)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTarget(IncProjectBuilder.java:855)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuildersForChunk(IncProjectBuilder.java:836)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildTargetsChunk(IncProjectBuilder.java:894)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunkIfAffected(IncProjectBuilder.java:789)
    at org.jetbrains.jps.incremental.IncProjectBuilder.buildChunks(IncProjectBuilder.java:612)
    at org.jetbrains.jps.incremental.IncProjectBuilder.runBuild(IncProjectBuilder.java:352)
    at org.jetbrains.jps.incremental.IncProjectBuilder.build(IncProjectBuilder.java:191)
    at org.jetbrains.jps.cmdline.BuildRunner.runBuild(BuildRunner.java:137)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:289)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:124)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:238)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)

最佳答案

奇怪的是,以下代码有效(因为这是一个Maven项目):

$ mvn clean


我想清洁模块一定要做些什么,因为此后构建就很好了。我必须相信这是某种Intellij错误。

07-28 03:36