I think that when you used

TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();


it did solve your initial problem, which was that you weren't loading Saxon. It then exposed another problem, the circular reference error. We now need to tackle this second problem. The fact that it didn't happen when running from the standalone application might suggest that different stylesheet modules are being loaded in the two cases, for example because the base URI is different. Could you please provide details that help us to understand the circular reference error? - specifically, the actual error message and the stylesheet modules referred to in the message?


Michael Kay




From: Anton Mints [mailto:developer.geo@yahoo.com]
Sent: 19 July 2006 18:07
To: 'Michael Kay'; 'Mailing list for SAXON XSLT queries'
Cc: 'Ernst Nolte'; 'Dmitry Krambalev'
Subject: RE: [saxon] Saxon 8.7 Transformer problem - JBOSS - XSLT2.0

We are already instantiating it exactly like this, however it didn’t solve the problem. It only brought circular reference error into picture. There is no problem with the stylesheet either, because it was tested on the stand alone application with exactly same package for the same test message.




From: Michael Kay [mailto:mike@saxonica.com]
Sent: Wednesday, July 19, 2006 5:23 PM
To: 'Mailing list for SAXON XSLT queries'
Cc: 'Anton Mints'
Subject: RE: [saxon] Saxon 8.7 Transformer problem - JBOSS - XSLT2.0


The simplest way to ensure that you load Saxon and not Xalan is to instantiate it directly: instead of using


TransformerFactory factory = TransformerFactory.newInstance();




TransformerFactory factory = new net.sf.saxon.TransformerFactoryImpl();


It means your code is committed to Saxon, but that seems to be what you want here.


(I think you mean Xalan when you say Xerces. Xerces is an XML parser, Xalan an XSLT transformer. It's quite normal to use Xerces as the XML parser with Saxon as the XSLT transformer).


If you still have problems with circular variable references, that suggests a problem in your stylesheet.


Michael Kay



From: saxon-help-bounces@lists.sourceforge.net [mailto:saxon-help-bounces@lists.sourceforge.net] On Behalf Of Anton Mints
Sent: 18 July 2006 21:45
To: Saxon-help@lists.sourceforge.net
Subject: [saxon] Saxon 8.7 Transformer problem - JBOSS - XSLT2.0

Hi All,


We are making ear component that shall run in JBOSS. In this component we are reading messages from the Sonic queue and writing them to the database. In between there is an XSLT transformation.


We are using XSLT 2.0 style sheet in combination with Saxon 8.7B.


It was failing immediately, because it was trying to use XERCES transformer by default.


1. First of all we have thoughts that it failing because it’s using xerces parser installed on the apache at the initial stage. So we have placed saxon8..jar files to the CLASSPATH (they are obviously deployed locally in the ear package). It didn’t help.


2. Then, we have added the saxon namespace in front of all parsers and transformer classes. It did help, but now it failing with the ‘Circular variable definition …’ exception.


It’s obviously working as stand alone application with java 1.5. It’s also working on the test JBOSS server with no XERCES installed. Also there is no problem with the XSLT.


It probably a class loading problem, but we could not figure out, what is the problem, because the Saxons are the first one to be loaded.


So we might assume, that even we are really calling saxon transformer (and we can see, that it’s loaded with the saxon loader) it still somehow internally using the xerces that is only 1.0 comparable.


Can somebody advice, what shall we do to force saxon transformer and parser use only 2.0 own implementation.


Much appreciated for any help.


Anton Mints