I just investigate a little.

In application log, I found :

2009-05-30 14:54:59 [org.apache.cxf.jaxrs.provider.XSLTJaxbProvider] WARN  -
No template is available at : classpath:rdf-stylesheet.xsl

In XSLTJaxbProvider, there is a bug : 

 protected Templates createTemplates(String loc) {
        try {
            InputStream is = null;
            if (loc.startsWith("classpath:")) {
                String path = loc.substring("classpath:".length() + 1);
    
                // ===> path actually is set with "df-stylesheet.xsl"

                is =
this.getClass().getClassLoader().getResourceAsStream(path);
            } else {
                File f = new File(loc);
                if (f.exists()) {
                    is = new FileInputStream(f);
                }
            }
            if (is == null) {
                LOG.warning("No template is available at : " + loc);
                return null;
            }
            
            Reader r = new BufferedReader(
                           new InputStreamReader(is, "UTF-8"));
            Source source = new StreamSource(r);
            if (factory == null) {
                factory =
(SAXTransformerFactory)TransformerFactory.newInstance();
                if (uriResolver != null) {
                    factory.setURIResolver(uriResolver);
                }
            }
            return factory.newTemplates(source);
            
        } catch (Exception ex) {
            LOG.warning("No template can be created : " + ex.getMessage());
        }
        return null;
    }


To avoid this bug, I modified my endpoint configuration : 

        <util:map id="outMediaTemplates">
                <entry key="application/xml+rdf" value="classpath: 
rdf-stylesheet.xsl" />
        </util:map>

With this, Templates object is correctly created (maybe a JIRA issue will be
needed ?)

But it doesn't solve my base problem : when calling the service
/prodservice, I still get a ".No message body writer found for response
class : ProductsDTO." html error page. 
-- 
View this message in context: 
http://www.nabble.com/How-to-use-cxf-2.2.2-jaxrs-XSLTJaxbProvider-feature---tp23792102p23793284.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to