我在 OpenXava 4.6 中创建了一个 portlet。但是一旦部署在 Liferay 6.1.1 CE GA 下,它就不能正常运行。
这些是问题:
a.) OX 4.5.1 和 4.6 创建的 web.xml 无法被 Liferay 6.1 识别
15:23:28,665 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:182] Processing <..>.war. This is attempt 2.
15:23:28,673 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:77] Copying portlets for ../liferay-portal-6.1.1-ce-ga2/deploy/<..>.war
15:23:28,676 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:1674] ../liferay-portal-6.1.1-ce-ga2/deploy/<..>.war does not have a WEB-INF/liferay-plugin-package.xml or WEB-INF/liferay-plugin-package.properties
15:23:28,677 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:763] Deploying <..>.war
15:23:33,110 ERROR [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:210] com.liferay.portal.kernel.deploy.auto.AutoDeployException: com.liferay.portal.kernel.deploy.auto.AutoDeployException: web.xml must be updated to the Servlet 2.4 specification
b.) web.xml 文件需要有这个头:
<?xml version="1.0" encoding="UTF-8"?>
<web-app id=".." version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
<http://java.sun.com/xml/ns/j2ee%5C>" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance\
<http://www.w3.org/2001/XMLSchema-instance%5C>"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd\
<http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd%5C>">
<display-name>...</display-name>
...
c.) 即使在按照上述修改“web.xml”文件(并创建一个新的 WAR 文件)之后,Liferay 也能够加载 portlet,并且它出现在可用 portlet 列表中。但是 portlet 不起作用:
15:35:01,457 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:87] Portlets for ../liferay-portal-6.1.1-ce-ga2/deploy/<..>.war copied successfully. Deployment will start in a few seconds.
15:35:04,651 INFO [pool-2-thread-2][HotDeployImpl:178] Deploying <..> from queue
15:35:04,653 INFO [pool-2-thread-2][PluginPackageUtil:1033] Reading plugin package for <..>
15:35:04,653 WARN [pool-2-thread-2][PluginPackageUtil:1131] Plugin package on context <..> cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
d.) 我手动将文件“liferay-plugin-package.xml”添加到 WAR 文件中,但 Liferay 仍然没有正确显示 portlet。
欢迎任何建议。谢谢。