Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-119991

Portal with JBoss and Wildfly failed to startup due to ParseError at liferay-ui.tld

    Details

    • Branch Version/s:
      7.3.x
    • Backported to Branch:
      Committed
    • Fix Priority:
      5

      Description

      Problem Background

      This issue is caused by a bug in the WildFly/JBoss TldExtensionMetaDataParser.parse(XMLStreamReader) method. Specifically, the WildFly/JBoss code will only permit a Tag Library Descriptor (.tld) file to have XML elements with an id attribute. This a bug because it does not take into account that a JSP Tag Library can have a <tag-extension> element which requires a namespace attribute in order for the .tld file to be a valid XML document according to the standards-based JSP 2.1 Tag Library Descriptor XML Schema.

      The reason why this issue became a blocker is because <tag-extension namespace="..."> was added to util-taglib/src/META-INF/liferay-ui.tld as part of LPS-115019.

      Workaround

      Since the <tag-extension namespace="..."> markup added in LPS-115019 is intended to be used at build-time with a code generator, the markup is not required to be present at runtime. Therefore, the workaround is to have the Ant build process filter the util-taglib/src/META-INF/liferay-ui.tld such that the markup starting with <tag-extension and ending with </tag-extension> is removed before the jar is built.

      Steps to Reproduce

      1. Build portal on JBoss or Wildfly.
      2. Start server.

      Expected Results:
      Portal should startup successfully

      Actual Results:
      Portal failed to startup with below error:

        [waitfor] [0m[31m01:08:50,738 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-3) MSC000001: Failed to start service jboss.deployment.unit."ROOT.war".PARSE: org.jboss.msc.service.StartException in service jboss.deployment.unit."ROOT.war".PARSE: WFLYSRV0153: Failed to process phase PARSE of deployment "ROOT.war"
        [waitfor] 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:183)
        [waitfor] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1737)
        [waitfor] 	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1699)
        [waitfor] 	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1557)
        [waitfor] 	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        [waitfor] 	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
        [waitfor] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        [waitfor] 	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        [waitfor] 	at java.lang.Thread.run(Thread.java:745)
        [waitfor] Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0027: Failed to parse XML descriptor "/opt/dev/projects/github/liferay-portal/bundles/wildfly-17.0.0/standalone/deployments/ROOT.war/WEB-INF/tld/liferay-ui.tld" at [3053,3]
        [waitfor] 	at org.wildfly.extension.undertow.deployment.TldParsingDeploymentProcessor.parseTLD(TldParsingDeploymentProcessor.java:221)
        [waitfor] 	at org.wildfly.extension.undertow.deployment.TldParsingDeploymentProcessor.processTld(TldParsingDeploymentProcessor.java:185)
        [waitfor] 	at org.wildfly.extension.undertow.deployment.TldParsingDeploymentProcessor.deploy(TldParsingDeploymentProcessor.java:109)
        [waitfor] 	at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:176)
        [waitfor] 	... 8 more
        [waitfor] Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3053,3]
        [waitfor] Message: Unexpected attribute 'namespace' encountered
        [waitfor] 	at org.jboss.metadata.parser.util.MetaDataElementParser.unexpectedAttribute(MetaDataElementParser.java:126)
        [waitfor] 	at org.jboss.metadata.parser.jsp.TldExtensionMetaDataParser.parse(TldExtensionMetaDataParser.java:56)
        [waitfor] 	at org.jboss.metadata.parser.jsp.TagMetaDataParser.parse(TagMetaDataParser.java:200)
        [waitfor] 	at org.jboss.metadata.parser.jsp.TldMetaDataParser.parse(TldMetaDataParser.java:216)
        [waitfor] 	at org.wildfly.extension.undertow.deployment.TldParsingDeploymentProcessor.parseTLD(TldParsingDeploymentProcessor.java:219)
        [waitfor] 	... 11 more
        [waitfor] 
        [waitfor] [0m[31m01:08:50,748 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "ROOT.war")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"ROOT.war\".PARSE" => "WFLYSRV0153: Failed to process phase PARSE of deployment \"ROOT.war\"
        [waitfor]     Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYUT0027: Failed to parse XML descriptor \"/opt/dev/projects/github/liferay-portal/bundles/wildfly-17.0.0/standalone/deployments/ROOT.war/WEB-INF/tld/liferay-ui.tld\" at [3053,3]
        [waitfor]     Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[3053,3]
        [waitfor] Message: Unexpected attribute 'namespace' encountered"}}
      

      Reproduced on:
      JBoss 7.2 + MySQL 5.7. Portal master DXP GIT ID: e53734c0008940f9c4aa56c6d528692c7ff41944.
      Wildfly 16 + MySQL 5.7. Portal master DXP GIT ID: e53734c0008940f9c4aa56c6d528692c7ff41944.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              victor.ware Victor Ware
              Reporter:
              summer.zhang Summer Zhang
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                7 weeks, 4 days ago

                  Packages

                  Version Package
                  7.3.X
                  Master