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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • xml

      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);
              }

            joehw Joe Wang
            fyuan Frank Yuan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: