Hi Bernard

On 10/09/12 10:50, TacheDeChoco wrote:
Hi Sergey

I tried with the latest 2.4.x as well as 2.5.x versions, without any success
:-(.

As you suggested it , I also wrote a simple test class to ensure Xalan was
able to transform my xml:

private static File XSLT = new File("src/main/resources/mytemplate.xsl");
private static File XML = new File("test/xml/sample.xml");
...     
TransformerFactory transFact = TransformerFactory.newInstance( );
InputStream xsltIs = new FileInputStream(XSLT);
Source xsltSource = new StreamSource(xsltIs);
Transformer trans = transFact.newTransformer(xsltSource);
InputStream xmlIs = new FileInputStream(XML);
Source xmlSource = new StreamSource(xmlIs);
Writer w = new PrintWriter(System.out);
Result result = new StreamResult(w);
trans.transform(xmlSource, result);

And the transformation is running fine
(but here, the xml is static, coming from a flat file - isof coming as jaxb
output).

Right...

I finally tried to use different XSLT implementation, ie Saxon (using
-Djavax.xml.transform.TransformerFactory=net.sf.saxon.TransformerFactoryImpl),
but I got another error:

javax.xml.transform.TransformerConfigurationException: Templates object was
not created by Saxon
        at
net.sf.saxon.TransformerFactoryImpl.newTransformerHandler(TransformerFactoryImpl.java:420)
        at
org.apache.cxf.jaxrs.provider.XSLTJaxbProvider.marshalToOutputStream(XSLTJaxbProvider.java:214)


This one is definitely a Saxon bug - I've seen it many years ago when Saxon was the preferred choice for my work and it is still there. No idea why Saxon expects public pluggable intefaces such as Templates implemented by Saxon too - the fact it works with Xalan confirms it.

So we do have a couple of tests using this provider and it works. But you see NPE. Can you please get the war or Maven-based project attached to JIRA ?

Thanks, Sergey


So up to now, no real fix or workaround :-(




Bernard.







--
View this message in context: 
http://cxf.547215.n5.nabble.com/Strange-NPE-with-XSLTJaxbProvider-tp5713703p5713747.html
Sent from the cxf-user mailing list archive at Nabble.com.


Reply via email to