在 Liferay 中部署应用程序(Liferay 运行 作为 war 文件在 JBOSS EAP 6.4 上)

Deploying application in Liferay (Liferay running as a war file on JBOSS EAP 6.4)

当 Liferay 在 JBoss EAP 6.4 上 运行 时,我在 Liferay 中部署应用程序时遇到问题。设置是必要的,因为这是我们通过 WSRP 生成的 portlet(我们也尝试过 JBoss Portal/Gatein 但它不适用于我们的设置)。 采取的步骤:

server.log:

12:49:38,979 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."MyApp.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."MyApp.war".PARSE: JBAS018733: Failed to process phase PARSE of deployment "MyApp.war"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1980) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1913) [jboss-msc-1.1.5.Final-redhat-1.jar:1.1.5.Final-redhat-1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_45]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor "/C:/Users/580085/Desktop/jboss-eap-6.4/standalone/deployments/MyApp.war/WEB-INF/web.xml" at [154,3]
at org.jboss.as.web.deployment.WebParsingDeploymentProcessor.deploy(WebParsingDeploymentProcessor.java:116)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [jboss-as-server-7.5.0.Final-redhat-21.jar:7.5.0.Final-redhat-21]
... 5 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[154,3]
Message: Unexpected element '{http://java.sun.com/xml/ns/j2ee}filter' encountered
at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedElement(MetaDataElementParser.java:109)
at org.jboss.metadata.parser.servlet.ServletMetaDataParser.parse(ServletMetaDataParser.java:126)
at org.jboss.metadata.parser.servlet.WebCommonMetaDataParser.parse(WebCommonMetaDataParser.java:102)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaDataParser.java:175)
at org.jboss.metadata.parser.servlet.WebMetaDataParser.parse(WebMetaDataParser.java:55)
at org.jboss.as.web.deployment.WebParsingDeploymentProcessor.deploy(WebParsingDeploymentProcessor.java:91)
... 6 more
12:49:38,995 ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) JBAS014612: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"MyApp.war\".PARSE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"MyApp.war\".PARSE: JBAS018733: Failed to process phase PARSE of deployment \"MyApp.war\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS018014: Failed to parse XML descriptor \"/C:/Users/1234/Desktop/jboss-eap-6.4/standalone/deployments/MyApp.war/WEB-INF/web.xml\" at [154,3]
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[154,3]
Message: Unexpected element '{http://java.sun.com/xml/ns/j2ee}filter' encountered"}}
12:49:39,026 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-9) JBAS015877: Stopped deployment MyApp.war (runtime-name: MyApp.war) in 27ms
12:49:39,026 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 1)
JBAS014774: Service status report
JBAS014777:   Services which failed to start:      service jboss.deployment.unit."MyApp.war".PARSE

我的web.xmlheader:

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" 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">
<display-name>MyApp</display-name>

web.xml 的第 154 行:

<init-param> <param-name>property-name</param-name> <param-value>ApplicationResources.properties</param-value> </init-param>

即使我删除了 <init-param> 定义,解析错误仍然存​​在。我怀疑这可能是 schema-related 问题。任何提示表示赞赏。

编辑:此外,此 portlet 应用程序 运行 之前在 Websphere 上正确。

我的 web.xml 中显然缺少 <filter> 标签。我有 none。我从附带的 liferay web.xml 中复制了它们并将它们粘贴到我的 <context-param> 定义下。

<filter> <filter-name>Invoker Filter - ERROR</filter-name> <filter-class>com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter</filter-class> <init-param> <param-name>dispatcher</param-name> <param-value>ERROR</param-value> </init-param> </filter> <filter> <filter-name>Invoker Filter - FORWARD</filter-name> <filter-class>com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter</filter-class> <init-param> <param-name>dispatcher</param-name> <param-value>FORWARD</param-value> </init-param> </filter> <filter> <filter-name>Invoker Filter - INCLUDE</filter-name> <filter-class>com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter</filter-class> <init-param> <param-name>dispatcher</param-name> <param-value>INCLUDE</param-value> </init-param> </filter> <filter> <filter-name>Invoker Filter - REQUEST</filter-name> <filter-class>com.liferay.portal.kernel.servlet.filters.invoker.InvokerFilter</filter-class> <init-param> <param-name>dispatcher</param-name> <param-value>REQUEST</param-value> </init-param> </filter> <filter-mapping> <filter-name>Invoker Filter - ERROR</filter-name> <url-pattern>/*</url-pattern> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>Invoker Filter - FORWARD</filter-name> <url-pattern>/*</url-pattern> <dispatcher>FORWARD</dispatcher> </filter-mapping> <filter-mapping> <filter-name>Invoker Filter - INCLUDE</filter-name> <url-pattern>/*</url-pattern> <dispatcher>INCLUDE</dispatcher> </filter-mapping> <filter-mapping> <filter-name>Invoker Filter - REQUEST</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> </filter-mapping> <servlet>