掲示板

"Content is not allowed in prolog" upon porlet hot deploy

9年前 に Anastas Stoyanovsky によって更新されました。

"Content is not allowed in prolog" upon porlet hot deploy

New Member 投稿: 3 参加年月日: 14/02/12 最新の投稿
I am developing a simple portlet using service builder and Maven that is to fetch data from an external database. mvn liferay:build-service completes without any errors. However, upon hot deploy, I receive the following message:

19:37:53,351 ERROR [localhost-startStop-3][HotDeployImpl:211] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for msds-1.0.0-SNAPSHOTmsds-1.0.0-SNAPSHOT
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for msds-1.0.0-SNAPSHOTmsds-1.0.0-SNAPSHOT
	at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
	at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:64)
	at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:208)
	at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:95)
	at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
	at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:164)
	at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:154)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:44)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
	at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
	at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:54)
	at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:116)
	at com.liferay.portal.kernel.servlet.SecurePluginContextListener.contextInitialized(SecurePluginContextListener.java:151)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4939)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
	at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1113)
	at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1671)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
	at java.util.concurrent.FutureTask.run(FutureTask.java:262)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:744)
Caused by: com.liferay.portal.kernel.xml.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.
	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:426)
	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:404)
	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:437)
	at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
	at com.liferay.portal.plugin.PluginPackageUtil._readPluginPackageXml(PluginPackageUtil.java:1209)
	at com.liferay.portal.plugin.PluginPackageUtil._readPluginPackageServletContext(PluginPackageUtil.java:1026)
	at com.liferay.portal.plugin.PluginPackageUtil.readPluginPackageServletContext(PluginPackageUtil.java:201)
	at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.doInvokeDeploy(PluginPackageHotDeployListener.java:108)
	at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:61)
	... 24 more
Caused by: 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.dom4j.io.SAXReader.read(SAXReader.java:365)
	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:423)
	... 32 more
Jun 27, 2014 7:37:53 PM org.apache.catalina.core.ApplicationContext log


I have double-checked all of my XML files and none of them have any characters at all before the opening <?xml tag.

What could be causing this error?
thumbnail
9年前 に Sushil Patidar によって更新されました。

RE: "Content is not allowed in prolog" upon porlet hot deploy

Expert 投稿: 467 参加年月日: 11/10/31 最新の投稿
Hi,
From the error it seems "/WEB-INF/liferay-plugin-package.xml" is not formatted correctly. Can you attach this file?

Regards
9年前 に Anastas Stoyanovsky によって更新されました。

RE: "Content is not allowed in prolog" upon porlet hot deploy

New Member 投稿: 3 参加年月日: 14/02/12 最新の投稿
Based on resources such as http://docs.liferay.com/portal/6.2/propertiesdoc/liferay-plugin-package_6_2_0.properties.html it seemed to me that liferay-plugin-package.xml is deprecated in favor of liferay-plugin-package.properties, which I've attached (`mvn archetype:generate` did not create a liferay-plugin-package.xml file):

name=MSDS Search
module-group-id=liferay
module-incremental-version=1
tags=
short-description=
change-log=
page-url=http://www.website.com
author=Me
licenses=LGPL
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: "Content is not allowed in prolog" upon porlet hot deploy

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
what looks weird is that duplicated servlet context name msds-1.0.0-SNAPSHOTmsds-1.0.0-SNAPSHOT.

Could you raise the loglevel for *deploy* related loggers (go to Control Panel / Server Administration / Log Levels and search for "deploy", then set those entries to "debug". It will be reset upon the next server start. Once you've configured these components to log more, deploy again and examine the output. If you can't find the result, post it here, at least we'll have a bit more to look at.
9年前 に Oliver Bayer によって更新されました。

RE: "Content is not allowed in prolog" upon porlet hot deploy

Liferay Master 投稿: 894 参加年月日: 09/02/18 最新の投稿
Hi Anastas,

the message "Content is not allowed in prolog" is likely to occur if you use the wrong file encoding. If you check your xml files with a hex editor you will maybe see some additional but -in normal editors- invisible characters before the opening <?xml tag.

HTH Oli
9年前 に Anastas Stoyanovsky によって更新されました。

RE: "Content is not allowed in prolog" upon porlet hot deploy

New Member 投稿: 3 参加年月日: 14/02/12 最新の投稿
[anastas@arch src]$ find . -name *xml | while read -r filename; do xxd "$filename" | head -n 1; done
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <!--?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1
0000000: 3c3f 786d 6c20 7665 7273 696f 6e3d 2231  <?xml version="1</code-->
<br><br>None of my XML files have any data at all before their opening XML tags. This makes sense; otherwise, whatever build process is run by mvn liferay:build-service would complain about malformed data, rather than only upon deployment.<br><br>What else might be the source of this error?