Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10166

Xalan transformer creating invalid encoding for smiley

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Major
    • None
    • 12.0.0.Final
    • XML Frameworks
    • None
    • Hide

      1. NG case: deploy attached testappng.war and access to http://localhost:8080/testappng/xml. org.xml.sax.SAXParseException is generated in server.log.
      2. GOOD case: deploy testapp.war in a Maven project testapp.zip and access to http://localhost:8080/testapp/xml. No exceptions are generated. The only difference from testappng.war is that the workaround of META-INF/services and jboss-deployment-structure.xml.
      3. GOOD case: in the Maven project, execute mvn exec:java -Dexec.mainClass=com.example.XMLTest. No exceptions are generated because it uses JDK's implementaion.

      Show
      1. NG case: deploy attached testappng.war and access to http://localhost:8080/testappng/xml . org.xml.sax.SAXParseException is generated in server.log. 2. GOOD case: deploy testapp.war in a Maven project testapp.zip and access to http://localhost:8080/testapp/xml . No exceptions are generated. The only difference from testappng.war is that the workaround of META-INF/services and jboss-deployment-structure.xml . 3. GOOD case: in the Maven project, execute mvn exec:java -Dexec.mainClass=com.example.XMLTest . No exceptions are generated because it uses JDK's implementaion.

    Description

      An smiley face emoji, decimal code &#128513, can be parsed properly by JDK's implementation (loaded by com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl) but failed with WildFly's implementation (xercesImpl-2.11.0.SP5.jar) which throws org.xml.sax.SAXParseException.

      org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 84; Character reference "&#55357" is an invalid XML character.
              at org.apache.xerces.parsers.DOMParser.parse(DOMParser.java:245)
              at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:298)
              at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:121)
              at com.example.XMLTest.main(XMLTest.java:77)
              at com.example.XMLServlet.doRequest(XMLServlet.java:65)
              at com.example.XMLServlet.doGet(XMLServlet.java:38)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
              at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
              at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:74)
              at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
              at io.undertow.servlet.handlers.ServletChain$1.handleRequest(ServletChain.java:67)
              at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
              at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
              at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:46)
              at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:64)
              at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:60)
              at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:77)
              at io.undertow.security.handlers.NotificationReceiverHandler.handleRequest(NotificationReceiverHandler.java:50)
              at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest(AbstractSecurityContextAssociationHandler.java:43)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler.handleRequest(GlobalRequestControllerHandler.java:68)
              at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
              at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:292)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
              at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
              at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
              at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
              at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1526)
              at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
              at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
              at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:360)
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
              at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
              at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
              at java.lang.Thread.run(Thread.java:748)
      

      This means a standalone Java application suddenly stops working on WildFly and need to be addressed. There is a workaround using files under META-INF/services and jboss-deployment-structure.xml. But the workaround is too mysterious for most of users. An out-of-the-box solution is expected.

      Attachments

        1. testapp.zip
          42 kB
        2. testappng.war
          6 kB

        Issue Links

          Activity

            People

              jgreene@redhat.com Jason Greene
              rhn-support-onagano Osamu Nagano
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: