2015-02-11 67 views
0

我想將現有的Android應用程序連接到谷歌App Engine。我已經建立了一個端點。問題是,每當我嘗試啓動後端時,我都會遇到異常。我嘗試清除我的主文件夾中的緩存文件,不起作用。例外情況如下:org.jdom.input.JDOMParseException當啓動谷歌應用程序引擎Java後端

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:157) 
    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) 
    ... 20 more 
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:157) 
    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) 
+0

[org.xml.sax.SAXParseException:內容不允許在序言中允許可能的重複](http://stackoverflow.com/questions/7569089/org-xml-sax-saxparseexception-content-is-not-allowed -in-prolog) – 2015-02-11 15:51:15

+0

看到了一個。我的堆棧跟蹤沒有提到造成這種情況的XML文件。即使如此,我在我的項目中打開了每個xml,然後再對其進行檢查。他們都是爲了。 – 2015-02-11 19:58:47

回答

1

已解決!

刪除workspace.xml位於在我的項目命名爲「.idea」文件夾中。

1

您給JDOM(並且反過來Xerces)的流不包含XML,它包含其他內容。

此典型原因是:

  1. 要從發送一個URL/HTTP服務器拉取數據的壓縮數據
  2. Base64編碼數據
  3. 含有非200響應諸如頁面重定向或某些(如此),不打算將其解析爲XML,而是打算在您的HTTP協議級別進行處理。
  4. 你沒有通過流你以爲你是路過

你的行動建議的做法是採取實際的流內容,而不是試圖解析它作爲XML轉儲,並看看它是你正在喂解析器(並確定爲什麼可能是這種情況)。

+0

我該如何在谷歌應用程序引擎中做到這一點?我剛剛創建了一個帶有Google端點的新模塊,並且希望將其部署到本地主機。在教程中沒有提及xml或jdom – 2015-02-11 13:36:42

+0

對不起,我無法幫助你。我可以告訴你爲什麼你會得到這個錯誤,但是我不能告訴你是什麼數據導致它,或者你從哪裏得到數據。請注意,我維護JDOM庫。這是JDOM用錯誤的輸入數據做正確的事情。 – rolfl 2015-02-11 13:52:54

+0

好的。感謝您的時間 – 2015-02-11 14:17:06