Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.5.2, 2.5.8
    • Fix Version/s: 2.5.10
    • Component/s: Core, Core Results
    • Labels:
      None

      Description

      I have an issue when I am trying to generate content with xslt.

      During the processing request I have this error :

      15:37:01 ERROR [org.apache.struts2.views.xslt.XSLTResult.execute] - Unable to render XSLT Template, 'null'
      org.apache.struts2.StrutsException: Error transforming result
      	at org.apache.struts2.views.xslt.XSLTResult$1.error(XSLTResult.java:371) ~[struts2-core-2.5.8.jar:2.5.8]
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.postErrorToListener(TransformerImpl.java:811) ~[?:1.7.0_79]
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:754) ~[?:1.7.0_79]
      	at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:359) ~[?:1.7.0_79]
      	at org.apache.struts2.views.xslt.XSLTResult.execute(XSLTResult.java:355) ~[struts2-core-2.5.8.jar:2.5.8]
      	at com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionInvocation.java:366) ~[struts2-core-2.5.8.jar:2.5.8]
      	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:270) ~[struts2-core-2.5.8.jar:2.5.8]
      
      15:37:01 ERROR [org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler.sendErrorResponse] - Exception occurred during processing request: Error transforming result - [unknown location]
      
      1. struts.xml
        4 kB
        COMBEAU
      2. continentsAction.java
        3 kB
        COMBEAU
      3. continents.xslt
        0.7 kB
        COMBEAU

        Activity

        Hide
        walkn COMBEAU added a comment -

        Ok.

        Thank you

        Show
        walkn COMBEAU added a comment - Ok. Thank you
        Hide
        lukaszlenart Lukasz Lenart added a comment - - edited

        xerces isn't a Struts dependency and as I said, I have extended the factory to log errors and warns, before that warn existed as well but wasn't logged.

        Show
        lukaszlenart Lukasz Lenart added a comment - - edited xerces isn't a Struts dependency and as I said, I have extended the factory to log errors and warns, before that warn existed as well but wasn't logged.
        Hide
        walkn COMBEAU added a comment -

        The warning is caused by xerces library that I have in my classpath. xerces version 2.9.1.

        With Struts 2.3.31 no warning appears but with Struts 2.5.2, 2.5.5 and 2.5.8 warning is shown.

        Show
        walkn COMBEAU added a comment - The warning is caused by xerces library that I have in my classpath. xerces version 2.9.1. With Struts 2.3.31 no warning appears but with Struts 2.5.2, 2.5.5 and 2.5.8 warning is shown.
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK7-master #582 (See https://builds.apache.org/job/Struts-JDK7-master/582/)
        WW-4731 Adds additional test case to confirm that everything is ok (lukaszlenart: rev f48c9620fcb877d23492c6fdd3cc7f7be5cc10e7)

        • (add) core/src/test/resources/XSLTResultTest6.xsl
        • (edit) core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
        • (edit) core/src/test/resources/log4j2.xml
        • (edit) core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #582 (See https://builds.apache.org/job/Struts-JDK7-master/582/ ) WW-4731 Adds additional test case to confirm that everything is ok (lukaszlenart: rev f48c9620fcb877d23492c6fdd3cc7f7be5cc10e7) (add) core/src/test/resources/XSLTResultTest6.xsl (edit) core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java (edit) core/src/test/resources/log4j2.xml (edit) core/src/test/java/org/apache/struts2/views/xslt/XSLTResultTest.java
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        I have added additional test case based on your XSLT (it isn't exactly the same but there is a lot of dependencies) and I don't see such warning.

        Show
        lukaszlenart Lukasz Lenart added a comment - I have added additional test case based on your XSLT (it isn't exactly the same but there is a lot of dependencies) and I don't see such warning.
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit f48c9620fcb877d23492c6fdd3cc7f7be5cc10e7 in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f48c962 ]

        WW-4731 Adds additional test case to confirm that everything is ok

        Show
        jira-bot ASF subversion and git services added a comment - Commit f48c9620fcb877d23492c6fdd3cc7f7be5cc10e7 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=f48c962 ] WW-4731 Adds additional test case to confirm that everything is ok
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Nope, the change isn't about bad characters but about adding ErrorListener here factory.setErrorListener(buildErrorListener());

        Show
        lukaszlenart Lukasz Lenart added a comment - Nope, the change isn't about bad characters but about adding ErrorListener here factory.setErrorListener(buildErrorListener());
        Hide
        walkn COMBEAU added a comment -

        When does this happen ? When we have bad characters ? I have this with the xslt in attachment

        Show
        walkn COMBEAU added a comment - When does this happen ? When we have bad characters ? I have this with the xslt in attachment
        Show
        lukaszlenart Lukasz Lenart added a comment - The only change I see is this (link below) - it relates to WW-2561 https://github.com/apache/struts/commit/ef2939ffd0663f8a5d86fafa105deb7183e2ac2d#diff-451a776faf914231ae936be66c51acfdR422
        Hide
        walkn COMBEAU added a comment -

        Yes I have this warning with both Struts versions.

        In Struts 2.5.2 it's like this

        Warning:  org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
        Avertissements de compilateur :
          WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
        
        Show
        walkn COMBEAU added a comment - Yes I have this warning with both Struts versions. In Struts 2.5.2 it's like this Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized. Avertissements de compilateur : WARNING: 'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Jenkins build Struts-JDK7-master #578 (See https://builds.apache.org/job/Struts-JDK7-master/578/)
        WW-4731 Moves detailed description to wiki (lukaszlenart: rev 14d56fbb93866646eb0152c0c56b64430c8a5704)

        • (edit) core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Jenkins build Struts-JDK7-master #578 (See https://builds.apache.org/job/Struts-JDK7-master/578/ ) WW-4731 Moves detailed description to wiki (lukaszlenart: rev 14d56fbb93866646eb0152c0c56b64430c8a5704) (edit) core/src/main/java/org/apache/struts2/views/xslt/XSLTResult.java
        Hide
        jira-bot ASF subversion and git services added a comment -

        Commit 14d56fbb93866646eb0152c0c56b64430c8a5704 in struts's branch refs/heads/master from Lukasz Lenart
        [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=14d56fb ]

        WW-4731 Moves detailed description to wiki

        Show
        jira-bot ASF subversion and git services added a comment - Commit 14d56fbb93866646eb0152c0c56b64430c8a5704 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=14d56fb ] WW-4731 Moves detailed description to wiki
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Did you get this with both Struts versions, 2.5.2 & 2.5.8?

        Show
        lukaszlenart Lukasz Lenart added a comment - Did you get this with both Struts versions, 2.5.2 & 2.5.8?
        Hide
        walkn COMBEAU added a comment -

        It works but now I have this warning :

        WARN [org.apache.struts2.views.xslt.XSLTResult$1.warning] - WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
        javax.xml.transform.TransformerConfigurationException: WARNING:  'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.'
        

        How can I solve this ?

        Show
        walkn COMBEAU added a comment - It works but now I have this warning : WARN [org.apache.struts2.views.xslt.XSLTResult$1.warning] - WARNING: 'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.' javax.xml.transform.TransformerConfigurationException: WARNING: 'org.apache.xerces.jaxp.SAXParserImpl: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.' How can I solve this ?
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Stefaan Dutry yes, I did that but forgot to push

        Show
        lukaszlenart Lukasz Lenart added a comment - Stefaan Dutry yes, I did that but forgot to push
        Hide
        walkn COMBEAU added a comment -

        Thank you very much.

        Show
        walkn COMBEAU added a comment - Thank you very much.
        Hide
        sdutry Stefaan Dutry added a comment -

        Lukasz Lenart
        Don't forget to update the javadoc inside the class.

        org.apache.struts2.views.xslt.XSLTResult

        XSLTResult

        Show
        sdutry Stefaan Dutry added a comment - Lukasz Lenart Don't forget to update the javadoc inside the class. org.apache.struts2.views.xslt.XSLTResult XSLTResult
        Show
        lukaszlenart Lukasz Lenart added a comment - I have updated the docs https://cwiki.apache.org/confluence/display/WW/XSL+Result#XSLResult-Parameters
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        It's related to dropping deprecated API in WW-4518 - I'm updating the docs right now

        Show
        lukaszlenart Lukasz Lenart added a comment - It's related to dropping deprecated API in WW-4518 - I'm updating the docs right now
        Hide
        sdutry Stefaan Dutry added a comment -

        It seems to work if you specify the xsl as the value of the result node.
        Maybe this can be used as a temporary workaround.

        config with xsl location as value
            ...
            <action name="continentList" class="com.myapp.xmlList.ContinentListAction">
                <interceptor-ref name="noSessionStack"/>
                <result type="xslt" name="success">/WEB-INF/xslt/continents.xslt</result>
            </action>
            ...
        
        Show
        sdutry Stefaan Dutry added a comment - It seems to work if you specify the xsl as the value of the result node. Maybe this can be used as a temporary workaround. config with xsl location as value ... <action name= "continentList" class= "com.myapp.xmlList.ContinentListAction" > <interceptor-ref name= "noSessionStack" /> <result type= "xslt" name= "success" > /WEB-INF/xslt/continents.xslt </result> </action> ...
        Hide
        walkn COMBEAU added a comment -

        <global-allowed-methods> or <allowed-methods> has to be define in struts 2.5 ? is it mandatory ?

        Show
        walkn COMBEAU added a comment - <global-allowed-methods> or <allowed-methods> has to be define in struts 2.5 ? is it mandatory ?
        Hide
        walkn COMBEAU added a comment -

        Here is the xslt and the action struts

        Show
        walkn COMBEAU added a comment - Here is the xslt and the action struts
        Hide
        walkn COMBEAU added a comment -

        I have not read about SMI.

        Is it mandatory about xslt result type ?

        Show
        walkn COMBEAU added a comment - I have not read about SMI. Is it mandatory about xslt result type ?
        Hide
        walkn COMBEAU added a comment -

        Here is my struts.xml config file

        Show
        walkn COMBEAU added a comment - Here is my struts.xml config file
        Hide
        lukaszlenart Lukasz Lenart added a comment - - edited

        Please share more details, configuration and so on. Did you read about SMI? http://struts.apache.org/docs/action-configuration.html#ActionConfiguration-StrictMethodInvocation

        Show
        lukaszlenart Lukasz Lenart added a comment - - edited Please share more details, configuration and so on. Did you read about SMI? http://struts.apache.org/docs/action-configuration.html#ActionConfiguration-StrictMethodInvocation
        Hide
        walkn COMBEAU added a comment -

        It worked properly in Struts 2.3.30

        Show
        walkn COMBEAU added a comment - It worked properly in Struts 2.3.30
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        You have marked 2.5.2 and 2.5.8 as affected versions so in which version it worked properly?

        Show
        lukaszlenart Lukasz Lenart added a comment - You have marked 2.5.2 and 2.5.8 as affected versions so in which version it worked properly?

          People

          • Assignee:
            lukaszlenart Lukasz Lenart
            Reporter:
            walkn COMBEAU
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development