[opencms-dev] SOLVED: Migration from 6.0.4 to 7.5.2 : Error on line 1 of document : Content is not allowed in prolog : SOLVED

Vroonen Julien Julien.Vroonen at nsi-sa.be
Tue Feb 16 11:30:16 CET 2010


SOLVED: Migration from 6.0.4 to 7.5.2 : Error on line 1 of document  : Content is not allowed in prolog


Hi List,

With those 2 classes (see attachments), and with “log4j.rootLogger=ERROR, OC, CONSOLE” in “log4j.properties”, I have been able to determine on which file the OpenCMS upgrade assistant was saying “org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.” !!!


Could anybody at OpenCMS integrate this patch (in a cleaner form) in the next version ?

-          org.opencms.setup.xml.A_CmsSetupXmlUpdate modified from line 92 to 98
-          org.opencms.setup.xml.CmsSetupXmlHelper modified from line 378 to 383

Maybe only one patch is needed (instead of 2 classes) but, in my multiple researches, I erased my log files … so I cannot say which one was really useful.
And anyway, too much log is better than nothing ;)


And, BTW, it was indeed the “UTF-8 BOM character”, just needed to know in which file ;)
It was in “opencms-search.xml” ;)


   Julien.





Julien Vroonen - j.vroonen at nsi-sa.be<mailto:j.vroonen at nsi-sa.be>
Business Analyst

NSI IT Software & Services
Chaussée de Bruxelles, 174 A
B-4340 Awans
Tél : +32 (0)4 239 91 50
Fax : +32 (0)4 246 13 08
www.nsi-sa.be<http://www.nsi-sa.be/>





________________________________
De : Vroonen Julien
Envoyé : mardi 9 février 2010 13:25
À : 'opencms-dev at opencms.org'
Objet : Migration from 6.0.4 to 7.5.2 : Error on line 1 of document : Content is not allowed in prolog

Hi List,

I have a little problem on step 3 (http://localhost:8080/opencms/update/step_3_xmlupdate.jsp) during the migration of an OpenCms 6.0.4 to a 7.5.2 version.

I did everything that was specified in the “readme.txt” of the “opencms_upgrade_to_7.5.2.zip” archive (including the specific point at the end concerning “6.x updates”) but the error is still there.


=> Questions :
            1) Could it be a problem of library (xerces ?)

            2) Could it be a problem of file encoding (UTF-8 “BOM character”) ?
                        I tried to add the option “file.encoding=UTF-8” at the “opencms.properties” and this one : “-Dfile.encoding=UTF-8” at the startup of tomcat but it did not solved the problem

            3) How could I know which document is causing the problem, the error specifies the line number, but the document name seems to be empty…
                        If anyone has a modified class of OpenCms to catch the exception and add some information concerning the name and path of the problematic document, I think it would help many people (the mailing list archive has many hits with the “content is not allowed in prolog” exception).


Any suggestion is welcome…



My environment is :
- Windows
- Oracle 10
- Tomcat 6.0
- JDK 1.5.0


09-févr.-2010 12:21:35 org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: "Servlet.service()" pour la servlet jsp a généré une exception
org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
            at org.dom4j.io.SAXReader.read(SAXReader.java:482)
            at org.opencms.xml.CmsXmlUtils.unmarshalHelper(CmsXmlUtils.java:652)
            at org.opencms.xml.CmsXmlUtils.unmarshalHelper(CmsXmlUtils.java:617)
            at org.opencms.setup.xml.CmsSetupXmlHelper.getDocument(CmsSetupXmlHelper.java:371)
            at org.opencms.setup.xml.A_CmsSetupXmlUpdate.getCodeToChange(A_CmsSetupXmlUpdate.java:84)
            at org.opencms.setup.xml.A_CmsSetupXmlUpdate.validate(A_CmsSetupXmlUpdate.java:161)
            at org.opencms.setup.xml.CmsSetupXmlManager.htmlAvailablePlugins(CmsSetupXmlManager.java:188)
            at org.apache.jsp.update.step_005f3_005fxmlupdate_jsp._jspService(step_005f3_005fxmlupdate_jsp.java:89)
            at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
            at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:337)
            at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
            at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
            at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
            at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
            at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
            at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
            at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
            at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
            at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
            at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
            at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
            at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
            at java.lang.Thread.run(Thread.java:595)

Thanks a lot,
   Julien.
PS : This exception was also occuring with a migration to a 7.5.1 version.






Julien Vroonen - j.vroonen at nsi-sa.be<mailto:j.vroonen at nsi-sa.be>
Business Analyst

NSI IT Software & Services
Chaussée de Bruxelles, 174 A
B-4340 Awans
Tél : +32 (0)4 239 91 50
Fax : +32 (0)4 246 13 08
www.nsi-sa.be<http://www.nsi-sa.be/>





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100216/7db28bc2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: A_CmsSetupXmlUpdate.java
Type: application/octet-stream
Size: 7805 bytes
Desc: A_CmsSetupXmlUpdate.java
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100216/7db28bc2/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CmsSetupXmlHelper.java
Type: application/octet-stream
Size: 18483 bytes
Desc: CmsSetupXmlHelper.java
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20100216/7db28bc2/attachment-0001.obj>


More information about the opencms-dev mailing list