Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8161454

Fails to Load external Java method from inside of a XSL stylesheet if SecurityManager is present

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: xml
    • Labels:

      Description

      javax/xml/jaxp/unittest/transform/XSLTFunctionsTest.java failed with the following error if security manager is present:
      javax.xml.transform.TransformerConfigurationException: Cannot find external method 'transform.DocumentExtFunc.test' (must be public).
               at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(java.xml@9-internal/TransformerFactoryImpl.java:1026)
               at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(java.xml@9-internal/TransformerFactoryImpl.java:797)
               at transform.XSLTFunctionsTest.testDocument(XSLTFunctionsTest.java:70)

       
      xlan doesn’t use TCCL if sm is present, and then it can’t load the customized class with bootstrap loader.

      The test failed even when enabling feature ENABLE_EXTENSION_FUNCTIONS. It may be related to
      the following code in TransformerFactoryImpl.java
              if (System.getSecurityManager() != null) {
                  _isSecureMode = true;
                  _isNotSecureProcessing = false;
                  _featureManager.setValue(FeatureManager.Feature.ORACLE_ENABLE_EXTENSION_FUNCTION,
                          FeaturePropertyBase.State.FSP, XalanConstants.FEATURE_FALSE);
              }

        Attachments

          Activity

            People

            • Assignee:
              joehw Joe Wang
              Reporter:
              fyuan Frank Yuan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: