Monday, June 4, 2018

Intellij IDEA crashed, and then throws an error [Content is not allowed in prolog]

Question Details:
I am using IntelliJ Idea 2017.2. And my project is a multi-module project built by gradle. I have given a build of my project. Then it crashed. I have started IntelliJ again and got the following message
Cannot load settings from file '.../config/options/code.style.schemes.xml': java.lang.AssertionError: Unexpected content storage modification File content will be recreated.
Then I have thought, it may be cache related issue. And then I restarted my PC again and do the following,
File -> Invalidate Caches / Restart
This time I got another error.
Error:Internal error: (org.jdom.input.JDOMParseException) Error on line 1: Content is not allowed in prolog.
org.jdom.input.JDOMParseException: Error on line 1: Content is not allowed in prolog.
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:533)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
    at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:364)
    at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:342)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:69)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:40)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadComponents(JpsLoaderBase.java:52)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:119)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:98)
    at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
    at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:71)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:198)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:745)
Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203)
    at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:177)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:441)
    at com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:368)
    at com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1436)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:999)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
    at org.jdom.input.SAXBuilder.build(SAXBuilder.java:946)
    at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:364)
    at com.intellij.openapi.util.JDOMUtil.loadDocument(JDOMUtil.java:342)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:69)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadRootElement(JpsLoaderBase.java:40)
    at org.jetbrains.jps.model.serialization.JpsLoaderBase.loadComponents(JpsLoaderBase.java:52)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadFromDirectory(JpsProjectLoader.java:119)
    at org.jetbrains.jps.model.serialization.JpsProjectLoader.loadProject(JpsProjectLoader.java:98)
    at org.jetbrains.jps.model.serialization.impl.JpsSerializationManagerImpl.loadModel(JpsSerializationManagerImpl.java:41)
    at org.jetbrains.jps.cmdline.JpsModelLoaderImpl.loadModel(JpsModelLoaderImpl.java:45)
    at org.jetbrains.jps.cmdline.BuildRunner.load(BuildRunner.java:71)
    at org.jetbrains.jps.cmdline.BuildSession.runBuild(BuildSession.java:198)
    at org.jetbrains.jps.cmdline.BuildSession.run(BuildSession.java:113)
    at org.jetbrains.jps.cmdline.BuildMain$MyMessageHandler$1.run(BuildMain.java:133)
    at org.jetbrains.jps.service.impl.SharedThreadPoolImpl$1.run(SharedThreadPoolImpl.java:41)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    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:745)
I have again tried to clean/build the project. But getting same error always. I have searched throguh internet and got the following issues.
But No LUCK. Any kind of help will be highly appreciated.

Answer:

At last I have solved this issue by deleting the [caches] folder in the following path.
/home/<username>/.IntelliJIdea2017.2/system/caches (Linux)
/Users/<username>/.IntelliJIdea2017.2/system/caches (Mac)
C:\Users\<username>\.IntelliJIdea2017.2\system\caches (Windows)
Then restarted IntelliJ Idea again and it works fine.

No comments:

Post a Comment