4 Replies Latest reply: Oct 3, 2007 4:54 PM by 601186 RSS

    javax.xml.transform.TransformerConfigurationException

    user555805
      Hi,

      I am deploying a bpel process and a bpel test to a remote oc4j, then running the tests via an ant build script.

      The tests are run fine and the results are created in an xml file, however the bpeltest task then try's to convert the xml to a junit report xml format and throws an exception when it can't find bpeltest-junit.xsl.

      The exception is vague and I don't know if its because it can't find the xls file our one of its dependancies.

      exception,

      [bpeltest] ERROR: 'File "" not found.'
      [bpeltest] FATAL ERROR: 'Could not compile stylesheet'
      [bpeltest] javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
      [bpeltest] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
      [bpeltest] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:619)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.doXForm(BpelTest.java:615)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.createJUnitReport(BpelTest.java:685)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.createReport(BpelTest.java:877)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.execute(BpelTest.java:1033)
      [bpeltest] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [bpeltest] at org.apache.tools.ant.Task.perform(Task.java:364)
      [bpeltest] at org.apache.tools.ant.Target.execute(Target.java:341)
      [bpeltest] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [bpeltest] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [bpeltest] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [bpeltest] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [bpeltest] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [bpeltest] at org.apache.tools.ant.Main.runBuild(Main.java:668)
      [bpeltest] at org.apache.tools.ant.Main.startAnt(Main.java:187)
      [bpeltest] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      [bpeltest] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

      My ant script invokes the test as follows,

      <bpeltest
           user="oc4jadmin"
                          password="babylon5"
           hostname="wells175732.int.rdel.co.uk"
                          httpport="80"
           domain="default"
                          process="AmazonFlow"
           rev="${rev}"
                          name="AmazonFlowTests"
           timeout="${bpeltest.timeout}"
           numWorkers="${bpeltest.numWorkers}"
           minCoverage="${bpeltest.minCoverage}"
           callHandler="${bpeltest.callHandler}"
           context="${bpel.context.properties}"
           resultsDir="${basedir}/bpel_test_results"
           resultsPropertyFile="${basedir}/bpel_test_results/AmazonFlow.properties"
                          failonerror="false"
           verbose="false"/>

      the top of my build script imports the following dependancies,

      <property file="${basedir}/conf/ant-oracle.properties"/>
      <property name="bpel.home" value="${oracle.home}/bpel"/>
      <import file="${bpel.home}/utilities/ant-orabpel.xml"/>
      <import file="${basedir}/conf/ant-oracle.xml"/>
      <property file="${bpel.home}/utilities/ant-orabpel.properties"/>
      <property file="${bpel.home}/utilities/bpel_build_template.properties"/>

      ant-oracle.xml conatins all necessary jar files including the orabpel-ant.jar where the bpeltest-junit.xsl resides under com\collaxa\cube\ant

      In the bpelTest ant task their is an attribute callHandler="${bpeltest.callHandler}"
      this property value is defined in the bpel_build_template.properties file but is empty,
      bpeltest.callHandler =

      I tried changing this to

      bpeltest.callHandler = com.collaxa.cube.ant.taskdefs.BpelTest

      and build script threw the following exception,

      [bpeltest] java.lang.ClassCastException: com.collaxa.cube.ant.taskdefs.BpelTest
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.loadHandler(BpelTest.java:425)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.runTestsOverRMI(BpelTest.java:544)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.runTests(BpelTest.java:603)
      [bpeltest] at com.collaxa.cube.ant.taskdefs.BpelTest.execute(BpelTest.java:1024)
      [bpeltest] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      [bpeltest] at org.apache.tools.ant.Task.perform(Task.java:364)
      [bpeltest] at org.apache.tools.ant.Target.execute(Target.java:341)
      [bpeltest] at org.apache.tools.ant.Target.performTasks(Target.java:369)
      [bpeltest] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1216)
      [bpeltest] at org.apache.tools.ant.Project.executeTarget(Project.java:1185)
      [bpeltest] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      [bpeltest] at org.apache.tools.ant.Project.executeTargets(Project.java:1068)
      [bpeltest] at org.apache.tools.ant.Main.runBuild(Main.java:668)
      [bpeltest] at org.apache.tools.ant.Main.startAnt(Main.java:187)
      [bpeltest] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
      [bpeltest] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)

      the xsl file looks as follows,

      <?xml version="1.0" encoding="UTF-8" ?>
      <?oracle-xsl-mapper
      <!-- SPECIFICATION OF MAP SOURCES AND TARGETS, DO NOT MODIFY. -->
      <mapSources>
      <source type="XSD">
      <schema location="UTResult.xsd"/>
      <rootElement name="testRunResults" namespace="http://xmlns.oracle.com/bpel/unittest"/>
      </source>
      </mapSources>
      <mapTargets>
      <target type="XSD">
      <schema location="JUnit.xsd"/>
      <rootElement name="testsuites" namespace=""/>
      </target>
      </mapTargets>
      <!-- GENERATED BY ORACLE XSL MAPPER 10.1.2.0.0(build 050412) AT [SUN APR 17 02:06:34 PDT 2005]. -->
      ?>
      <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:ns0="http://xmlns.oracle.com/bpel/bpeltest"
      xmlns:utd="http://xmlns.oracle.com/bpel/instancedriver"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ldap="http://schemas.oracle.com/xpath/extension/ldap"
      xmlns:xp20="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.Xpath20"
      xmlns:bpws="http://schemas.xmlsoap.org/ws/2003/03/business-process/"
      xmlns:ora="http://schemas.oracle.com/xpath/extension"
      xmlns:orcl="http://www.oracle.com/XSL/Transform/java/oracle.tip.pc.services.functions.ExtFunc"
      xmlns:java="http://xml.apache.org/xslt/java"
      exclude-result-prefixes="xsl ns0 utd xsd ldap xp20 bpws ora orcl">

      <xsl:param name="minCodeCoverage">0</xsl:param>
      <xsl:param name="minPartnerCodeCoverage">0</xsl:param>
      <xsl:param name="packageFormat"/>

      <xsl:template match="/">
      <testsuites>
      <xsl:for-each select="/ns0:testRunResults/ns0:testSuite">
      <testsuite>
      <xsl:attribute name="name">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getQualifiedSuite($packageFormat, ../@domain, ../@processName, ../@processRevision, @name)" />
      </xsl:attribute>
      <xsl:attribute name="failures">
      <xsl:value-of select="@numFailures"/>
      </xsl:attribute>
      <xsl:attribute name="time">
      <xsl:value-of select="@durationInSeconds"/>
      </xsl:attribute>
      <xsl:attribute name="tests">
      <xsl:value-of select="@numTests"/>
      </xsl:attribute>
      <xsl:attribute name="errors">
      <xsl:value-of select="0"/>
      </xsl:attribute>
      <properties>
      <xsl:for-each select="../ns0:properties/ns0:property">
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="@name"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="@value"/>
      </xsl:attribute>
      </property>
      </xsl:for-each>
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'run.start.date'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="../@startDate"/>
      </xsl:attribute>
      </property>
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'run.end.date'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="../@endDate"/>
      </xsl:attribute>
      </property>
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'suite.start.date'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="@startDate"/>
      </xsl:attribute>
      </property>
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'suite.end.date'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="@endDate"/>
      </xsl:attribute>
      </property>
      </properties>
      <xsl:for-each select=".//ns0:testResult">
      <testcase>
      <xsl:attribute name="name">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.testToClass(@testName)"/>
      </xsl:attribute>
      <xsl:attribute name="time">
      <xsl:value-of select="@durationInSeconds"/>
      </xsl:attribute>
      <xsl:attribute name="classname">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.testToQualifiedClass($packageFormat, @domain, @processName, @processRevision, @testName)"/>
      </xsl:attribute>
      <xsl:for-each select=".//ns0:executionError">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getExecutionErrorTitle()"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getExecutionErrorMessage(.)"/>
      </xsl:attribute>
      </failure>
      </xsl:for-each>
      <xsl:for-each select=".//ns0:xmlAssertion">
      <xsl:if test="(@passed = &quot;false&quot;) or (@wasExecuted = &quot;false&quot;)">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getFailureType(@wasExecuted, @fatal)"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getXMLFailureMessage(local-name(..), ../@instanceRefID, ../@testName, @wasExecuted, @fatal, utd:message, @activityName, @variableName, @partName, utd:actualPath, @iteration)"/>
      </xsl:attribute>
      </failure>
      <xsl:for-each select="ns0:xmlDiff">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getXMLDiffType()"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getXMLDiffMessage(.)"/>
      </xsl:attribute>
      </failure>
      </xsl:for-each>
      </xsl:if>
      </xsl:for-each>
      <xsl:for-each select=".//ns0:valueAssertion">
      <xsl:if test="(@passed = &quot;false&quot;) or (@wasExecuted = &quot;false&quot;)">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getFailureType(@wasExecuted, @fatal)"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getFailureMessage(local-name(..), ../@instanceRefID, ../@testName, @wasExecuted, @fatal, utd:message, @activityName, @variableName, @partName, utd:actualPath, utd:expected,ns0:actualValue, @iteration)"/>
      </xsl:attribute>
      </failure>
      </xsl:if>
      </xsl:for-each>
      <xsl:for-each select=".//ns0:activityAssertion">
      <xsl:choose>
      <xsl:when test="@passed = &quot;false&quot;">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getActivityAssertionTitle()"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getActivityAssertionMessage(local-name(..), ../@instanceRefID, ../@testName, @activityName, ns0:expectedExecutionCount, ns0:actualExecutionCount)"/>
      </xsl:attribute>
      </failure>
      </xsl:when>
      </xsl:choose>
      </xsl:for-each>
      </testcase>
      </xsl:for-each>
      </testsuite>
      </xsl:for-each>

      <!-- *************************
      begin code coverage logic
      ************************* -->
      <xsl:if test="$minCodeCoverage &gt; 0">
      <testsuite>
      <xsl:attribute name="name">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageSuiteName($packageFormat, ns0:testRunResults/@domain, ns0:testRunResults/@processName, ns0:testRunResults/@processRevision)" />
      </xsl:attribute>
      <xsl:attribute name="failures">
      <!-- count( (if the main process coverage is too low) + (number of sub process's with insufficient coverage) ) -->
      <xsl:value-of select="count(/ns0:testRunResults/ns0:codeCoverage[@processName = /ns0:testRunResults/@processName and @processRevision = /ns0:testRunResults/@processRevision and $minCodeCoverage &gt; @coverage] | /ns0:testRunResults/ns0:codeCoverage[(@processName != /ns0:testRunResults/@processName or @processRevision != /ns0:testRunResults/@processRevision) and $minPartnerCodeCoverage &gt; @coverage])"/>
      </xsl:attribute>
      <xsl:attribute name="time">
      <xsl:value-of select="'0'"/>
      </xsl:attribute>
      <xsl:attribute name="tests">
      <xsl:choose>
      <xsl:when test="$minPartnerCodeCoverage = 0">
      <xsl:value-of select="1"/>
      </xsl:when>
      <xsl:otherwise>
      <xsl:value-of select="count(/ns0:testRunResults/ns0:codeCoverage)"/>
      </xsl:otherwise>
      </xsl:choose>
      </xsl:attribute>
      <xsl:attribute name="errors">
      <xsl:value-of select="'0'"/>
      </xsl:attribute>
      <properties>
      <xsl:for-each select="/ns0:testRunResults/ns0:properties/ns0:property">
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="@name"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="@value"/>
      </xsl:attribute>
      </property>
      </xsl:for-each>
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'required.coverage'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="$minCodeCoverage"/>
      </xsl:attribute>
      </property>
      <xsl:if test="$minPartnerCodeCoverage &gt; 0">
      <property>
      <xsl:attribute name="name">
      <xsl:value-of select="'required.subprocess.coverage'"/>
      </xsl:attribute>
      <xsl:attribute name="value">
      <xsl:value-of select="$minPartnerCodeCoverage"/>
      </xsl:attribute>
      </property>
      </xsl:if>
      </properties>
      <xsl:for-each select="/ns0:testRunResults/ns0:codeCoverage">
      <xsl:choose>
      <xsl:when test="@processName = /ns0:testRunResults/@processName and @processRevision = /ns0:testRunResults/@processRevision">
      <testcase>
      <xsl:attribute name="name">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageTestName($packageFormat, @domain, @processName, @processRevision)"/>
      </xsl:attribute>
      <xsl:attribute name="time">
      <xsl:value-of select="'0'"/>
      </xsl:attribute>
      <xsl:attribute name="classname">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.coverageTestToQualifiedClass($packageFormat, @domain, @processName, @processRevision)"/>
      </xsl:attribute>
      <xsl:if test="@coverage &lt; $minCodeCoverage">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageTitle()"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageMessage($minCodeCoverage, @coverage)"/>
      </xsl:attribute>
      </failure>
      </xsl:if>
      </testcase>
      </xsl:when>
      <xsl:when test="$minPartnerCodeCoverage &gt; 0">
      <testcase>
      <xsl:attribute name="name">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageTestName($packageFormat, @domain, @processName, @processRevision)"/>
      </xsl:attribute>
      <xsl:attribute name="time">
      <xsl:value-of select="'0'"/>
      </xsl:attribute>
      <xsl:attribute name="classname">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.coverageTestToQualifiedClass($packageFormat, @domain, @processName, @processRevision)"/>
      </xsl:attribute>
      <xsl:if test="@coverage &lt; $minPartnerCodeCoverage">
      <failure>
      <xsl:attribute name="type">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageTitle()"/>
      </xsl:attribute>
      <xsl:attribute name="message">
      <xsl:value-of select="java:com.collaxa.cube.ant.taskdefs.BpelTest.getCoverageMessage($minPartnerCodeCoverage, @coverage)"/>
      </xsl:attribute>
      </failure>
      </xsl:if>
      </testcase>
      </xsl:when>
      </xsl:choose>
      </xsl:for-each>
      </testsuite>
      </xsl:if>
      </testsuites>
      </xsl:template>
      </xsl:stylesheet>

      the classloader seems to want to make callbacks to the BpelTest methods in order to generate the xml file for junit.

      any help on this would be greatly appreciated,
        • 1. Re: javax.xml.transform.TransformerConfigurationException
          583262
          Hi - I have tried to use ant test and are getting the same problem - did you get a work around?
          • 2. Re: javax.xml.transform.TransformerConfigurationException
            589706
            Im having the same issue. Is there nobody that has an update?
            • 3. Re: javax.xml.transform.TransformerConfigurationException
              534379
              Please see Here:

              http://download-uk.oracle.com/docs/cd/B31017_01/win.1013/relnotes/bpelrn.htm#BGBJGIAF

              Section 8.8.8 Creating BPEL Test Reports in Junit Format

              To run BPEL tests, download the following Apache-licensed JAR files.

              Note:
              You must rename the downloaded JAR files as described in these steps.

              1.

              Go to http://www.apache.org/dyn/closer.cgi/xml/xalan-j
              2.

              Download xalan-j_2_7_0-bin.zip from the recommended mirror site.
              3.

              Unzip the file.
              4.

              Copy unzip_dir\xalan-j_2_7_0\serializer.jar to SOA_Oracle_Home\bpel\lib\serializer_2.7.0.jar.
              5.

              Copy unzip_dir\xalan-j_2_7_0\xalan.jar to SOA_Oracle_Home\bpel\lib\xalan_2.7.0.jar.
              • 4. Re: javax.xml.transform.TransformerConfigurationException
                601186
                I'm having almost the same issue so I was hoping the xalan jars solution would resolve it, but even with the jars copied to the directory and renamed as instructed, the error still occurs when the ant bpeltest task tries to transform the test results into junit format. The error message I'm getting is slightly different but issue seems to be the same. The error message I'm getting is:

                [bpeltest] ERROR: 'null'
                [bpeltest] FATAL ERROR: 'Could not compile stylesheet'
                [bpeltest] javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet
                [bpeltest] at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:824)
                ...etc...

                BUILD FAILED
                C:\projects\jdev_user_home_10g\mywork\BPELTests\BPELTest1\build.xml:179: An error occurred while translating the test results to JUnit results.
                Could not compile stylesheet
                Please verify the XSL:
                bpeltest-junit.xsl
                The original XML results have been saved in... ...etc...

                Using filemon, I can see where the ant javaw.exe process is reading bpeltest-format.xsl but bpeltest-junit.xsl is never read from the file system (although it could be getting loaded via classloader from orabpel-ant.jar as previously mentioned.) Either way, it doesn't seem like bpeltest-junit.xsl is actually missing.

                The error message does not indicate what was null and the references passed to the TransformerFactory are controlled by the bpeltest ant task code so I don't know what's missing.

                Anyone have a clue what might be 'null'? Anyone know how to get it fixed? Anyone have a suggestion for a way to a dig up more context and figure out what's missing?

                -R