Xml-parsing error in liferay 6.1.1

I am trying to deploy my application on liferay 6.1.1 and get this error (when I tested this application on 6.0.6, everything is fine). What does this mean?

Called: com.liferay.portal.kernel.xml.DocumentException: error on line 1 of the document: value following the "version" in XML The declaration must be a quoted string. Nested exception: The value of the next "version" in the XML declaration must be a quotation mark.

up: I don’t know which file gave this error. Full magazine

I do not know which file gave this error ... All logs [# | 2012-08-09T15: 12: 20,322 + 0400 | INFO | glassfish3.1.2 | javax.enterprise.system.std.com.sun.enterprise.server.logging | _ThreadID = 17; _ThreadName = Thread-3; | 15: 12: 20,321 ERROR [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner] [AutoDeployDir: 210] com.liferay.portal.kernel.deploy.auto.AutoDeployException: com.liferay.portal.kernel.xml. DocumentException: error on line 1 of the document: the value following the "version" in the XML declaration must be a quoted string. Nested exception: The value following the "version" in the XML declaration must be a quoted string. com.liferay.portal.kernel.deploy.auto.AutoDeployException: com.liferay.portal.kernel.xml.DocumentException: error on line 1 of the document: the value following the "version" in the XML declaration must be a quoted string. Nested exception: The value following the "version" in the XML declaration must be a quoted string. at com.liferay.portal.tools.deploy.BaseDeployer.autoDeploy (BaseDeployer.java:201) at com.liferay.portal.deploy.auto.PortletAutoDeployListener.deploy (PortletAutoDeployListener.java:84) at com.liferay.portal.kelel .deploy.auto.AutoDeployDir.processFile (AutoDeployDir.java:193) at com.liferay.portal.kernel.deploy.auto.AutoDeployDir.scanDirectory (AutoDeployDir.java:235) at com.liferay.portal.kernel.deploy.aut .AutoDeployScanner.run (AutoDeployScanner.java:54) Raised: com.liferay.portal.kernel.xml.DocumentException: error on line 1 of the document: the value following the "version" in the XML declaration must be a quoted string. Nested exception: The value following the "version" in the XML declaration must be a quoted string. at com.liferay.portal.xml.SAXReaderImpl.read (SAXReaderImpl.javahaps99) at com.liferay.portal.xml.SAXReaderImpl.read (SAXReaderImpl.javahaps78) at com.liferay.portal.xml.SAXReaderImpl.read (SAXReaderImpl.java:409) at com.liferay.portal.kernel.xml.SAXReaderUtil.read (SAXReaderUtil.java:155) in com.liferay.portal.tools.WebXMLBuilder.organizeWebXML (WebXMLBuilder.java:60) at. liferay.portal.tools.deploy.BaseDeployer.updateWebXml (BaseDeployer.java:2078) at com.liferay.portal.tools.deploy.BaseDeployer.deployDirectory (BaseDeployer.javahaps76) at com.liferay.portal.tools.deploy. BaseDeployer.deployFile (BaseDeployer.java:957) at com.liferay.portal.tools.deploy.BaseDeployer.deployFile (BaseDeployer.java:889) at com.liferay.portal.tools.deploy.BaseDeployer.autoDeploy (BaseDeployer.java: 198) ... 4 more Called: org.dom4j.DocumentException: error in line 1 of the document: value following the "version" in XML declaration must be a quoted string. Nested exception: The value following the "version" in the XML declaration must be a quoted string. at org.dom4j.io.SAXReader.read (SAXReader.java:482) at org.dom4j.io.SAXReader.read (SAXReader.javahaps65) at com.liferay.portal.xml.SAXReaderImpl.read (SAXReaderImpl.java : 396) ... 13 more | #]

+6
source share
3 answers

The problem may be with your web.xml file. I had a similar problem with a portlet that worked fine under 6.1GA1, but not with 6.1GA2. When Liferay deploys portlets (and intercepts, etc.), it overwrites the file and others to add filters, libraries, etc. Thus, the error is probably not in the file that was originally created, but with what Liferay generated.

In my case, Liferay changed the first part of web.xml from

<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

to something like

 <?xml version=<filters>[other stuff]</filters> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> 

So, that was the modified first line that caused the problem. I had an XML comment using <!-- --> , and deleting these sections fixed the problem. But this is a mistake IMHO.

+8
source

Pay attention to the "display-name" tag in your web.xml. Sometimes (and this is my case). The Eclipse plugin creates web.xml using the j2ee: display-name tag. Deployer tries to add the filter block configuration after the position of the "/ display-name" tag. When "j2ee: display-name" is present, the deployer adds the filter block configuration to a bad position in the file, such as the version attribute. Replacing the "j2ee: display-name" tag with the "display-name" tag solves the problem.

+1
source

If you know which plugin (hook, theme, portlet, etc.) is causing an error, then you will need to check all the XML files in this folder structure and check the first line and make sure that it:

 <?xml version="1.0"?> 

It will be a tedious task, but not much more that you can do!

If you don’t know which plugin is causing the error, deploy them one by one until you find it!

Hope this helps!

0
source

Source: https://habr.com/ru/post/922465/


All Articles