You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by bryan rasmussen <ra...@gmail.com> on 2011/06/10 10:12:26 UTC

getTransformer error

Hi,
I am trying to transforrm the results using xslt - I store my xslts in
conf/xslt/

I call them in the querystring with the parameters

&wt=xslt&tr=result.xsl

And get back an error:

 getTransformer fails in getContentType

java.lang.RuntimeException: getTransformer fails in getContentType
...
Caused by: java.io.IOException: Unable to initialize Templates 'result.xsl'
...
Caused by: javax.xml.transform.TransformerConfigurationException:
Could not compile stylesheet

I'm supposing it is not an XSLT issue as I am able to run the
transformation via command line with Xalan.


Thanks,
Bryan Rasmussen

Re: getTransformer error

Posted by Chris Hostetter <ho...@fucit.org>.
: Anyone found a solution to the getTransformer error. I am getting the same
: error.

If you use Solr 3.6, with the example jetty and example configs, do you 
get the same error using the provided example XSL files?

http://localhost:8983/solr/select?q=*:*&wt=xslt&tr=example.xsl
http://localhost:8983/solr/select?q=*:*&wt=xslt&tr=example_rss.xsl
http://localhost:8983/solr/select?q=*:*&wt=xslt&tr=example_atom.xsl

	... I just tried those and had no problems.

: Caused by: java.io.IOException: Unable to initialize Templates
: 'example.xslt'

Just to be clear: is your file actually named "example.xslt" ? the example 
that comes with Solr is "example.xsl" (no "T")

Can you post that file?

Does it by any chance contain an xsl include (or xinclude)?  If so, see 
the note about SOLR-1656 in CHANGES.txt...

* SOLR-1656: XIncludes and other HREFs in XML files loaded by ResourceLoader
  are fixed to be resolved using the URI standard (RFC 2396). The system
  identifier is no longer a plain filename with path, it gets initialized
  using a custom URI scheme "solrres:". This scheme is resolved using a
  EntityResolver that utilizes ResourceLoader
  (org.apache.solr.common.util.SystemIdResolver). This makes all relative
  pathes in Solr's config files behave like expected. This change
  introduces some backwards breaks in the API: Some config classes
  (Config, SolrConfig, IndexSchema) were changed to take
  org.xml.sax.InputSource instead of InputStream. There may also be some
  backwards breaks in existing config files, it is recommended to check
  your config files / XSLTs and replace all XIncludes/HREFs that were
  hacked to use absolute paths to use relative ones. (uschindler)






-Hoss

Re: getTransformer error

Posted by watson <ro...@gmail.com>.
Anyone found a solution to the getTransformer error. I am getting the same
error.

Here is my output:


Problem accessing /solr/JOBS/select/. Reason:

    getTransformer fails in getContentType

java.lang.RuntimeException: getTransformer fails in getContentType
	at
org.apache.solr.response.XSLTResponseWriter.getContentType(XSLTResponseWriter.java:72)
	at
org.apache.solr.servlet.SolrDispatchFilter.writeResponse(SolrDispatchFilter.java:326)
	at
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:261)
	at
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:129)
	at
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:59)
	at
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
	at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
	at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
	at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
	at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
	at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at
org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
	at
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: java.io.IOException: Unable to initialize Templates
'example.xslt'
	at
org.apache.solr.util.xslt.TransformerProvider.getTemplates(TransformerProvider.java:117)
	at
org.apache.solr.util.xslt.TransformerProvider.getTransformer(TransformerProvider.java:77)
	at
org.apache.solr.response.XSLTResponseWriter.getTransformer(XSLTResponseWriter.java:130)
	at
org.apache.solr.response.XSLTResponseWriter.getContentType(XSLTResponseWriter.java:69)
	... 23 more
Caused by: javax.xml.transform.TransformerConfigurationException: Could not
compile stylesheet
	at
com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown
Source)
	at
org.apache.solr.util.xslt.TransformerProvider.getTemplates(TransformerProvider.java:110)
	... 26 more


--
View this message in context: http://lucene.472066.n3.nabble.com/getTransformer-error-tp3047726p3985687.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: getTransformer error

Posted by "pramila_thakur@ontla.ola.org" <pr...@ontla.ola.org>.
Hi ,
I am facing the same problem with my XSLT, after upgrading to 3.6 from solr
1.4

I was wondering if you have found the solution? Can you please share your
solution if you have found one?

This should be helpful to others as well who are struggling.

thanks

--Pramila

--
View this message in context: http://lucene.472066.n3.nabble.com/getTransformer-error-tp3047726p3982801.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: getTransformer error

Posted by bryan rasmussen <ra...@gmail.com>.
Ok I guess it is nonetheless a stylesheet problem, as  a basic hello
world outputting stylesheet works.

thanks,
Bryan Rasmussen
On Fri, Jun 10, 2011 at 10:12 AM, bryan rasmussen
<ra...@gmail.com> wrote:
> Hi,
> I am trying to transforrm the results using xslt - I store my xslts in
> conf/xslt/
>
> I call them in the querystring with the parameters
>
> &wt=xslt&tr=result.xsl
>
> And get back an error:
>
>  getTransformer fails in getContentType
>
> java.lang.RuntimeException: getTransformer fails in getContentType
> ...
> Caused by: java.io.IOException: Unable to initialize Templates 'result.xsl'
> ...
> Caused by: javax.xml.transform.TransformerConfigurationException:
> Could not compile stylesheet
>
> I'm supposing it is not an XSLT issue as I am able to run the
> transformation via command line with Xalan.
>
>
> Thanks,
> Bryan Rasmussen
>