I'm having trouble opening my main in my eclipse project. It keeps coming up with:
"content is not allowed in prolog"
I haven't altered my code or anything. I have no idea what has gone wrong, anybody seen this before?
I'm having trouble opening my main in my eclipse project. It keeps coming up with:
"content is not allowed in prolog"
I haven't altered my code or anything. I have no idea what has gone wrong, anybody seen this before?
I had the same error and figured it out.
When I tried to create a new string resource, I tried to paste the new resource value on the "Android Resources" screen. To my surprise, the paste operation (using CTRL + V) does not work on that screen, and I tried it several times.
After that I started getting the error. When I switched from the "Android Resources" screen to the raw XML screen of the Strings.xml file, I noticed that all the text that I tried to paste was at the beginning of the file, like this:
Image content description. Image content description.<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">My App</string>
</resources>
And that was causing the error for me.
Restarting Eclipse and Cleaning the problem dint help.
I opened the .xml file in a XML editor and did a Validate
on that error alone. this solved my problem. Hope this helps for people who still got the problem
This error is generated during parsing of an XML document. Here is one writeup:
http://www.mkyong.com/java/sax-error-content-is-not-allowed-in-prolog/
You didn't provide sufficient information in your question to know which file might be corrupted, but search for xml files in your project and see if they look ok.
Its most likely an encoding problem: (edit in notepad++ and select) encoding utf-8 -BOM
I had the same problem, It may be because of XML parser issue, I restarted the eclipse it started working fine.
I also had the same error.Check your Xml files.There may be syntax error in xml files.
Having incorrect encoding information might cause this.
<?xml version="1.0" encoding="utf-16"?>
at the top of an ascii or utf-8 encoded file for example.
Yeah, I had the same, and the first line in strings.xml:
<?xml version="1.0" encoding="utf-8"?>
was marked with this error. Though I also didn't alter any code, yesterday, when I closed Eclipse, everything was fine, no errors (though some warnings were present, but that doesn't matter, I think)
All I did now is Selecting this line, Ctrl+X (Cut) it, Ctrl+S to save, Ctrl+V (Paste) it back and Ctrl+S again, and the error is gone. Not sure if it will work for everybody, but it did for me 8)
Check: that you have no any additional wrong text before in the beginning of file.
In my case I was seeing those error in java classes i.e. NOT XML and, the problem was related to a hidden file called .springBeans in the main project directory. I had a section "configs" and "autoconfigs" like:
java:org.DDDDDDDDDD.config.PersistenceConfig
java:org.DDDDDDDDDD.core.Application
When i moved everything to autoconfigs it all worked for me
In my case, server.xml got corrupted.
Go to pivotal/tomcat server location.
Path : base-instance\conf File Name: server.xml
So i tried replacing below content in that file and it worked fine.
Sample content:-
<?xml version="1.0" encoding="UTF-8"?>
<Server port="${base.shutdown.port}" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/>
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/>
<Listener className="com.springsource.tcserver.serviceability.deploy.TcContainerDeployer"/>
<Listener accessFile="${catalina.base}/conf/jmxremote.access" address="127.0.0.1" authenticate="true" className="com.springsource.tcserver.serviceability.rmi.JmxSocketListener" passwordFile="${catalina.base}/conf/jmxremote.password" port="${base.jmx.port}" useSSL="false"/>
<GlobalNamingResources>
<Resource auth="Container" description="User database that can be updated and saved" factory="org.apache.catalina.users.MemoryUserDatabaseFactory" name="UserDatabase" pathname="conf/tomcat-users.xml" type="org.apache.catalina.UserDatabase"/>
</GlobalNamingResources>
<Service name="Catalina">
<Executor maxThreads="300" minSpareThreads="50" name="tomcatThreadPool" namePrefix="tomcat-http--"/>
<Engine defaultHost="localhost" name="Catalina">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/>
</Realm>
<Host appBase="webapps" autoDeploy="true" deployOnStartup="true" deployXML="true" name="localhost" unpackWARs="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" pattern="%h %l %u %t "%r" %s %b" prefix="localhost_access_log." suffix=".txt"/>
</Host>
</Engine>
<Connector acceptCount="100" connectionTimeout="20000" executor="tomcatThreadPool" maxKeepAliveRequests="15" port="${nio.http.port}" protocol="org.apache.coyote.http11.Http11NioProtocol" redirectPort="${nio.https.port}"/>
</Service>
</Server>
I had a similar issue and wanted to make a note, in case other had the same root cause that I did.
My issue was related to the xsi:schemaLocation
. The url stated was no longer being served. Via googling, I got a copy of the actual xsd file, which I included locally then updated the reference. This solved my issue.
e.g. http://dozer.sourceforge.net/schema/beanmapping.xsd
became beanmapping.xsd
in the snippet below, after adding the .xsd
file to the same folder.
<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns="http://dozer.sourceforge.net" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://dozer.sourceforge.net beanmapping.xsd">
i delete the c:/users/your_computer/appdata/.gradle/cache and it went go to normal
I fix it with a non - xml file by clearing the file in the text editor, save the empty file and paste it back. (CTRL+A, CTRL+X, CTRL+S, CTRL+V, CTRL+S)