java 在 IntelliJ 中,workspace.xml 文件已损坏(第 1 行错误:序言中不允许内容),我该如何修复?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29604148/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
workspace.xml file corrupted (Error on line 1: Content is not allowed in prolog) in IntelliJ, how can I fix it?
提问by AndreaNobili
I am experimenting a very annoying issue using IntelliJ.
我正在使用 IntelliJ 试验一个非常烦人的问题。
I was working on my project (a webapp deployed on a local instance of BEA weblogic application server) and suddenly my PC crash and I restarted it.
我正在处理我的项目(部署在 BEA weblogic 应用程序服务器的本地实例上的 web 应用程序),突然我的 PC 崩溃了,我重新启动了它。
Coming back to my project I obtained this error:
回到我的项目,我收到了这个错误:
Cannot convert project: C:\projects\Main\MyProject\workspace.xml: Error on line 1: Content is not allowed in prolog.
无法转换项目:C:\projects\Main\MyProject\workspace.xml:第 1 行错误:prolog 中不允许使用内容。
and looking inside the workspace.xmlfile of my project it contains something like it:
并查看我的项目的workspace.xml文件,它包含类似的内容:
nulnulnulnulnul....
So, I delete it and I restart IntelliJ (I read onlyne that I have to do in this way) so IntelliJ create it and I can open my project again inside IntelliJ but now the problem is that I can't run it (the Run and Debug icons are disabled).
所以,我删除它并重新启动 IntelliJ(我只阅读了我必须以这种方式执行的操作)所以 IntelliJ 创建它,我可以在 IntelliJ 中再次打开我的项目,但现在问题是我无法运行它(运行和调试图标被禁用)。
What could be the problem? and how can I try to solve this issue?
可能是什么问题呢?我该如何尝试解决这个问题?
Tnx
田纳西州
回答by 0x44656e6e795279616e
I experienced the same error. I deleted the workspace.xml and started 'Invalid Caches/Restart" under "File". Then I had to recreate my Run/Debug Configuration. Then everything works like before.
我遇到了同样的错误。我删除了workspace.xml并在“文件”下启动了“无效缓存/重启”。然后我不得不重新创建我的运行/调试配置。然后一切都像以前一样。
回答by Siddharth Patel
I experienced same problem.you can solve it by deleting ant.xml, then everything will be fine.
我遇到了同样的问题。你可以通过删除ant.xml来解决它,然后一切都会好起来的。
回答by s4pfyr
In my case the file encoding of the workspace.xmlfile was wrong. Converting it back to UTF-8 solved it for me.
在我的情况下,workspace.xml文件的文件编码是错误的。将其转换回 UTF-8 为我解决了这个问题。