7 Replies Latest reply on Apr 9, 2009 6:29 AM by Harshit Kapoor

    TransformerConfigurationException: Could not compile stylesheet

    Harshit Kapoor Newbie

      Hi,

       

      I have a bean that translates XML messages from one format to another. Among other dependencies I have included the following in the dependency as well,

       

           

       

      When I deploy the created package and send request to the service I get the following error:

       

      ERROR:  'Error checking type of the expression 'funcall(exists, [AbsoluteLocationPath(ParentLocationPath(ParentLocationPath(step("child", 14), step("child", 15)), step("child"

      , 22)))])'.'

      FATAL ERROR:  'Could not compile stylesheet'

      javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet

              at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:864)

              at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:653)

              at GEIP.MessageTransformer.transformMessage(MessageTransformer.java:38)

              at GEIP.MyBean.onMessageExchange(MyBean.java:64)

              at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:226)

              at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:212)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:621)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:575)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:477)

              at org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

              at java.lang.Thread.run(Thread.java:595)

      java.lang.StringIndexOutOfBoundsException: String index out of range: -37

              at java.lang.String.substring(String.java:1768)

              at java.lang.String.substring(String.java:1735)

              at GEIP.MyBean.onMessageExchange(MyBean.java:65)

              at org.apache.servicemix.bean.BeanEndpoint.onProviderExchange(BeanEndpoint.java:226)

              at org.apache.servicemix.bean.BeanEndpoint.process(BeanEndpoint.java:212)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.doProcess(AsyncBaseLifeCycle.java:621)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchange(AsyncBaseLifeCycle.java:575)

              at org.apache.servicemix.common.AsyncBaseLifeCycle.processExchangeInTx(AsyncBaseLifeCycle.java:477)

              at org.apache.servicemix.common.AsyncBaseLifeCycle$2.run(AsyncBaseLifeCycle.java:347)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)

              at java.lang.Thread.run(Thread.java:595)

       

       

      Is because the jars that are getting downloaded do not have XSLT 2.0 Processor.

      The message indicates that there as problem with  "exists" function. I removed it then is started complaining about other functions in the XSLT.

      I have also tested by including only net.sf.saxon and not servicemix-saxon, then too it gave same error.

       

      Please note that the above dependency worked with Serviceix 3.2.2 (I used net.sf.saxon only an not servicemix-saxon from iona).

       

      Please Help!!

       

      -Harshit

        • 1. Re: TransformerConfigurationException: Could not compile stylesheet
          Sean O'Callaghan Newbie

          Hi,

          The version of the component you are using looks to be a rather old one, in the latest ESB 3.4.0.1, the components version is:

           

          2008.01.0.3-fuse

           

           

          Please try:

           

           

           

          Regards,

           

          Seán.

          • 2. Re: TransformerConfigurationException: Could not compile stylesheet
            Harshit Kapoor Newbie

            using

             

             

             

            gives the following error:

             

             

            Offending resource: file

            Bean ''; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.bean.BeanEndpoint in classloader org.apache.servicemix.bean.BeanEndpoint

            22:09:03,026 | INFO  | Timer-1          | FileSystemXmlApplicationContext  | pport.AbstractApplicationContext  816 | Closing org.apache.xbean.spring.context.FileSystemXmlApplicationContext@67d193: display name ; startup date ; root of context hierarchy

            22:09:03,026 | ERROR | Timer-1          | FileSystemXmlApplicationContext  | pport.AbstractApplicationContext  823 | Exception thrown from ApplicationListener handling ContextClosedEvent

            java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call 'refresh' before multicasting events via the context: org.apache.xbean.spring.context.FileSystemXmlApplicationContext@67d193: display name ; startup date ; root of conte

                    at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:288)

                    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:275)

                    at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:820)

                    at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:795)

                    at org.springframework.context.support.AbstractApplicationContext.destroy(AbstractApplicationContext.java:783)

                    at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:105)

                    at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)

                    at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

                    at org.apache.servicemix.jbi.deployer.impl.ServiceUnitImpl.deploy(ServiceUnitImpl.java:89)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.deployServiceAssembly(Deployer.java:325)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.register(Deployer.java:188)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.onBundleStarted(AbstractBundleWatcher.java:80)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.access$000(AbstractBundleWatcher.java:34)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher$1.bundleChanged(AbstractBundleWatcher.java:53)

                    at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:690)

                    at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:619)

                    at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:532)

                    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3586)

                    at org.apache.felix.framework.Felix._startBundle(Felix.java:1613)

                    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)

                    at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4025)

                    at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3271)

                    at org.apache.felix.framework.Felix._updateBundle(Felix.java:1903)

                    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1745)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:394)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:381)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:533)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:290)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor$1.filesChanged(FileMonitor.java:143)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportBulkChanges(Scanner.java:433)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportDifferences(Scanner.java:322)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.scan(Scanner.java:254)

                    at org.apache.servicemix.kernel.filemonitor.Scanner$1.run(Scanner.java:214)

                    at java.util.TimerThread.mainLoop(Timer.java:512)

                    at java.util.TimerThread.run(Timer.java:462)

            22:09:03,026 | ERROR | Timer-1          | SaxonComponent                   | mmon.xbean.AbstractXBeanDeployer  107 | java.lang.IllegalStateException: BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext

            22:09:03,042 | ERROR | Timer-1          | Deployer                         | cemix.jbi.deployer.impl.Deployer  329 | Error deploying SU CTSBeanProcessor

            javax.jbi.management.DeploymentException: <component-task-result xmlns="http://java.sun.com/xml/ns/jbi/management-message">

                    <component-name>servicemix-saxon</component-name>

                    <component-task-result-details>

                            <task-result-details>

                                    <task-id>deploy</task-id>

                                    <task-result>FAILED</task-result>

                                    <message-type>ERROR</message-type>

                                    <task-status-msg><msg-loc-info><loc-token/><loc-message>Could not deploy xbean service unit</loc-message></msg-loc-info></task-status-msg>

                                    <exception-info>

                                            <nesting-level>1</nesting-level>

                                            <msg-loc-info>

                                                    <loc-token />

                                                    <loc-message>Configuration problem: Bean class not found

            Offending resource: file

            Bean ''; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.bean.BeanEndpoint in classloader org.apache.servicemix.bean.BeanEndpoint</loc-message>

                                                    <stack-trace><![CDATA[org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Bean class not found

            Offending resource: file

            Bean ''; nested exception is java.lang.ClassNotFoundException: org.apache.servicemix.bean.BeanEndpoint in classloader org.apache.servicemix.bean.BeanEndpoint

                    at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)

                    at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.error(BeanDefinitionParserDelegate.java:288)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:569)

                    at org.apache.xbean.spring.context.v2c.XBeanBeanDefinitionParserDelegate.parseBeanDefinitionElement(XBeanBeanDefinitionParserDelegate.java:58)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:389)

                    at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:223)

                    at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:271)

                    at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:155)

                    at org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1255)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1245)

                    at org.apache.xbean.spring.context.v2.XBeanBeanDefinitionDocumentReader.parseBeanDefinitions(XBeanBeanDefinitionDocumentReader.java:84)

                    at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:92)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:507)

                    at org.apache.xbean.spring.context.v2.XBeanXmlBeanDefinitionReader.registerBeanDefinitions(XBeanXmlBeanDefinitionReader.java:79)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:398)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)

                    at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)

                    at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)

                    at org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:113)

                    at org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)

                    at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)

                    at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:423)

                    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:353)

                    at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:86)

                    at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)

                    at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

                    at org.apache.servicemix.jbi.deployer.impl.ServiceUnitImpl.deploy(ServiceUnitImpl.java:89)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.deployServiceAssembly(Deployer.java:325)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.register(Deployer.java:188)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.onBundleStarted(AbstractBundleWatcher.java:80)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.access$000(AbstractBundleWatcher.java:34)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher$1.bundleChanged(AbstractBundleWatcher.java:53)

                    at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:690)

                    at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:619)

                    at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:532)

                    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3586)

                    at org.apache.felix.framework.Felix._startBundle(Felix.java:1613)

                    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)

                    at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4025)

                    at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3271)

                    at org.apache.felix.framework.Felix._updateBundle(Felix.java:1903)

                    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1745)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:394)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:381)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:533)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:290)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor$1.filesChanged(FileMonitor.java:143)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportBulkChanges(Scanner.java:433)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportDifferences(Scanner.java:322)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.scan(Scanner.java:254)

                    at org.apache.servicemix.kernel.filemonitor.Scanner$1.run(Scanner.java:214)

                    at java.util.TimerThread.mainLoop(Timer.java:512)

                    at java.util.TimerThread.run(Timer.java:462)

            Caused by: java.lang.ClassNotFoundException: org.apache.servicemix.bean.BeanEndpoint in classloader org.apache.servicemix.bean.BeanEndpoint

                    at org.apache.xbean.classloader.MultiParentClassLoader.loadClass(MultiParentClassLoader.java:206)

                    at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

                    at org.springframework.util.ClassUtils.forName(ClassUtils.java:242)

                    at org.springframework.beans.factory.support.BeanDefinitionReaderUtils.createBeanDefinition(BeanDefinitionReaderUtils.java:89)

                    at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseBeanDefinitionElement(BeanDefinitionParserDelegate.java:462)

                    ... 54 more

            ]]></stack-trace>

                                            </msg-loc-info>

                                    </exception-info>

                            </task-result-details>

                    </component-task-result-details>

            </component-task-result>

                    at org.apache.servicemix.common.ManagementSupport.failure(ManagementSupport.java:46)

                    at org.apache.servicemix.common.AbstractDeployer.failure(AbstractDeployer.java:43)

                    at org.apache.servicemix.common.xbean.AbstractXBeanDeployer.deploy(AbstractXBeanDeployer.java:116)

                    at org.apache.servicemix.common.BaseServiceUnitManager.doDeploy(BaseServiceUnitManager.java:88)

                    at org.apache.servicemix.common.BaseServiceUnitManager.deploy(BaseServiceUnitManager.java:69)

                    at org.apache.servicemix.jbi.deployer.impl.ServiceUnitImpl.deploy(ServiceUnitImpl.java:89)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.deployServiceAssembly(Deployer.java:325)

                    at org.apache.servicemix.jbi.deployer.impl.Deployer.register(Deployer.java:188)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.onBundleStarted(AbstractBundleWatcher.java:80)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher.access$000(AbstractBundleWatcher.java:34)

                    at org.apache.servicemix.jbi.deployer.impl.AbstractBundleWatcher$1.bundleChanged(AbstractBundleWatcher.java:53)

                    at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatcher.java:690)

                    at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:619)

                    at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:532)

                    at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:3586)

                    at org.apache.felix.framework.Felix._startBundle(Felix.java:1613)

                    at org.apache.felix.framework.Felix.startBundle(Felix.java:1541)

                    at org.apache.felix.framework.Felix$RefreshHelper.restart(Felix.java:4025)

                    at org.apache.felix.framework.Felix.refreshPackages(Felix.java:3271)

                    at org.apache.felix.framework.Felix._updateBundle(Felix.java:1903)

                    at org.apache.felix.framework.Felix.updateBundle(Felix.java:1745)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:394)

                    at org.apache.felix.framework.BundleImpl.update(BundleImpl.java:381)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.refreshPackagesAndStartOrUpdateBundles(FileMonitor.java:533)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor.onFilesChanged(FileMonitor.java:290)

                    at org.apache.servicemix.kernel.filemonitor.FileMonitor$1.filesChanged(FileMonitor.java:143)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportBulkChanges(Scanner.java:433)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.reportDifferences(Scanner.java:322)

                    at org.apache.servicemix.kernel.filemonitor.Scanner.scan(Scanner.java:254)

                    at org.apache.servicemix.kernel.filemonitor.Scanner$1.run(Scanner.java:214)

                    at java.util.TimerThread.mainLoop(Timer.java:512)

                    at java.util.TimerThread.run(Timer.java:462)

            22:09:03,042 | INFO  | lixDispatchQueue | CTSServiceAssembly               | ?                                   ? | BundleEvent STARTED

            22:09:03,042 | INFO  | Timer-1          | FileMonitor                      | x.kernel.filemonitor.FileMonitor  534 | Updated: CTSServiceAssembly

            22:09:03,042 | INFO  | lixDispatchQueue | bundle                           | ?                                   ? | FrameworkEvent PACKAGES REFRESHED

            22:09:03,042 | INFO  | lixDispatchQueue | bundle                           | ?                                   ? | FrameworkEvent PACKAGES REFRESHED

            22:09:10,062 | INFO  | Thread-24        | SpringCommandExecutor$1          | mo.gshell.DefaultCommandExecutor   90 | Executing (String): log d

            22:09:10,093 | INFO  | Thread-27        | log:display                      | shell.support.OsgiCommandSupport  113 | Executing w/args: []

             

             

            however this

             

             

            does not give any deployment error but gives the following error:

             

            TransformerConfigurationException: Could not compile stylesheet

             

            -Harshit

            • 3. Re: TransformerConfigurationException: Could not compile stylesheet
              Harshit Kapoor Newbie

              When I have a look at the assembly.jar created with pom having following

                    

               

               

              it contains saxon-8.7.jar which is XSLT 2.0 compliant processor thus ideally stylesheet shoud compile without error (which is what happens with servicemix 3.2.2)

              It seems that servicemix 4 has reference to some not XSLT2.0 compliant processor when I call the following method in the bean.

               

               

              System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl");

                         

              // Create a transform factory instance.

              tfactory = TransformerFactory.newInstance();

               

              Transformer transformer = tfactory.newTransformer(new StreamSource(new ByteArrayInputStream(xslt.getBytes())));

               

              transformer.transform(new StreamSource (new ByteArrayInputStream(message.getBytes())), new StreamResult(result));

               

               

              Any Suggestions?

               

              Harshit

              • 4. Re: TransformerConfigurationException: Could not compile stylesheet
                Sean O'Callaghan Newbie

                Hi,

                 

                Just looking at the root pom in esb 4.0.0.4,

                 

                http://repo.fusesource.com/maven2/com/iona/fuse/fuse-esb/4.0.0.4/

                 

                The saxon version is 9.1.0.1_1, perhaps this version may work. My previous reply referred to the version for esb 3.x.

                 

                Let me know how you get on,

                 

                Seán.

                • 5. Re: TransformerConfigurationException: Could not compile stylesheet
                  Harshit Kapoor Newbie

                  Hi,

                  I am not using servicemix-saxon service engine.

                  I am using servicemix-bean service engine, inorder to use java code to invoke xslt.

                  So I do not have a dependency on servicemix-saxon SE. I am using saxon xslt processor in java thus I have a dependency on saxon-dom, I have tried using version 8.7 (which used to work fine in servicemix 3.2.2) and 9.1.0.6, but both dependencies give me same error (TransformerConfigurationException: Could not compile stylesheet.). I used net.sf.saxon.Version class to print the version of XSLT and product being used, I appropriately get the following:

                  XSLT Version = 2.0

                  Product Version = 8.7 (in case I used version 8.7 in dependency).

                   

                   

                  Following is excerpt from pom.xml of bean service engine:

                     

                   

                   

                  -Harshit

                  • 6. Re: TransformerConfigurationException: Could not compile stylesheet
                    Harshit Kapoor Newbie

                    After having a closer look at the exception I came to know that bean is using Xalan instead of Saxon. I have already set system property as follows

                              System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl");

                     

                    I get the following output when I use

                    System.out.println("XSLT Version = " + Version.getXSLVersionString());

                    System.out.println("Product Version = " + Version.getProductVersion());

                     

                    XSLT Version = 2.0

                    Product Version = 9.1.0.1

                     

                    -Harshit

                    • 7. Re: TransformerConfigurationException: Could not compile stylesheet
                      Harshit Kapoor Newbie

                      Hi,

                       

                      It seems that the problems is related to

                       

                      static {

                      System.setProperty("javax.xml.transform.TransformerFactory","net.sf.saxon.TransformerFactoryImpl");

                      tfactory = TransformerFactory.newInstance();

                      }

                       

                      When I use the above code in static block in my class Xalan processor is still being used.

                       

                      however when  use the following code

                      static {

                      tFactory  = new net.sf.saxon.TransformerFactoryImpl();

                      }

                      the problem is resolved and the runtime uses saxon processor.

                       

                      The problem is solved but I fail to understand the difference between the SMX4 and SMX 3.2.2 that caused this problem.

                       

                      Could it be related to class loading ?

                       

                      PS: I am using java 1.5.0_17

                       

                      -Harshit