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 "pramila_thakur@ontla.ola.org" <pr...@ontla.ola.org> on 2012/05/11 17:24:45 UTC

Solr 3.6 fails when using XSLT

Hi Everyone,

I have recently upgraded to *solr 3.6 from solr 1.4.*
My XSL where working fine in solr 1.4.

but now with Solr 3.6 I keep getting the following Error 

/getTransformer fails in getContentType java.lang.RuntimeException:
getTransformer fails in getContentType /

But instead of results.xsl If I use example.xsl, it is fine.

I fine my xsl:include does not seem to work with Solr 3.6

Can someone please let me know what am I doing wrong?

Thanks,

--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-fails-when-using-XSLT-tp3980240.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Solr 3.6 fails when using XSLT

Posted by Chris Hostetter <ho...@fucit.org>.
: This is what worked in solr 1.4 and did not work in solr 3.6.
: 
: Actually solr 3.6 requires all the xsl to be present in conf/xslt directory
: All paths leading to xsl should be relative to conf directory.
: 
: But before this was not the case.

Right ... this was actually a bug (in how all relative paths in xml 
includes, or xsl includes, were resolved) that was fixed in Solr 3.1, as 
noted 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: Solr 3.6 fails when using XSLT

Posted by "pramila_thakur@ontla.ola.org" <pr...@ontla.ola.org>.
Hi Everyone,

This is what worked in solr 1.4 and did not work in solr 3.6.

Actually solr 3.6 requires all the xsl to be present in conf/xslt directory
All paths leading to xsl should be relative to conf directory.

But before this was not the case.

<!-
NOTE: Does NOT work with solr 3.6 , worked in Solr 1.4
<xsl:include  href="../webapps/pdfexample/xsl_scripts/highlight.xsl"/>
<xsl:include  href="../webapps/pdfexample/xsl_scripts/pagination.xsl"/>
<xsl:include  href="../webapps/pdfexample/xsl_scripts/simpleSearch.xsl"/>
<xsl:include  href="../webapps/pdfexample/xsl_scripts/bills/facets.xsl"/>
<xsl:include  href="../webapps/pdfexample/xsl_scripts/bills/advanceSearch.xsl"/>
<xsl:include  href="../webapps/pdfexample/xsl_scripts/bills/search_common_fields.xsl"/>
-->
<!-this is relative to conf directory, which is working for solr 3.6 -->

<xsl:include  href="./xsl_scripts/highlight.xsl"/>
<xsl:include  href="./xsl_scripts/pagination.xsl"/>
<xsl:include  href="./xsl_scripts/simpleSearch.xsl"/>
<xsl:include  href="./xsl_scripts/bills/facets.xsl"/>
<xsl:include  href="./xsl_scripts/bills/advanceSearch.xsl"/>
<xsl:include  href="./xsl_scripts/bills/search_common_fields.xsl"/>

Thanks,

--Pramila Thakur
________________________________
From: Chris Hostetter-3 [via Lucene] [mailto:ml-node+s472066n3985522h93@n3.nabble.com]
Sent: Tuesday, May 22, 2012 3:37 PM
To: Thakur, Pramila
Subject: Re: Solr 3.6 fails when using XSLT


what does your results.xsl look like? or more sepcificly: can you post a
very small example XSL that has this problem?

you mentioned you are using xsl:include and that doesn't seem to work ...
is that a seperate problem, or does removing/adding the xsl:including
fix/cause this problem?

what does your xsl:include look like? where to the various xsl templates
live in the filesystem realtive to eachother?


: Date: Fri, 11 May 2012 08:24:45 -0700 (PDT)
: From: "[hidden email]</user/SendEmail.jtp?type=node&node=3985522&i=0>" <[hidden email]</user/SendEmail.jtp?type=node&node=3985522&i=1>>
: Reply-To: [hidden email]</user/SendEmail.jtp?type=node&node=3985522&i=2>
: To: [hidden email]</user/SendEmail.jtp?type=node&node=3985522&i=3>
: Subject: Solr 3.6 fails when using XSLT
:
: Hi Everyone,
:
: I have recently upgraded to *solr 3.6 from solr 1.4.*
: My XSL where working fine in solr 1.4.
:
: but now with Solr 3.6 I keep getting the following Error
:
: /getTransformer fails in getContentType java.lang.RuntimeException:
: getTransformer fails in getContentType /
:
: But instead of results.xsl If I use example.xsl, it is fine.
:
: I fine my xsl:include does not seem to work with Solr 3.6
:
: Can someone please let me know what am I doing wrong?
:
: Thanks,
:
: --
: View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-fails-when-using-XSLT-tp3980240.html
: Sent from the Solr - User mailing list archive at Nabble.com.

-Hoss

________________________________
If you reply to this email, your message will be added to the discussion below:
http://lucene.472066.n3.nabble.com/Solr-3-6-fails-when-using-XSLT-tp3980240p3985522.html
To unsubscribe from Solr 3.6 fails when using XSLT, click here<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3980240&code=cHJhbWlsYV90aGFrdXJAb250bGEub2xhLm9yZ3wzOTgwMjQwfC0zOTMxMDQ3NzI=>.
NAML<http://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-fails-when-using-XSLT-tp3980240p3985524.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Solr 3.6 fails when using XSLT

Posted by Chris Hostetter <ho...@fucit.org>.
what does your results.xsl look like? or more sepcificly: can you post a 
very small example XSL that has this problem?

you mentioned you are using xsl:include and that doesn't seem to work ... 
is that a seperate problem, or does removing/adding the xsl:including 
fix/cause this problem?

what does your xsl:include look like? where to the various xsl templates 
live in the filesystem realtive to eachother?


: Date: Fri, 11 May 2012 08:24:45 -0700 (PDT)
: From: "pramila_thakur@ontla.ola.org" <pr...@ontla.ola.org>
: Reply-To: solr-user@lucene.apache.org
: To: solr-user@lucene.apache.org
: Subject: Solr 3.6 fails when using XSLT
: 
: Hi Everyone,
: 
: I have recently upgraded to *solr 3.6 from solr 1.4.*
: My XSL where working fine in solr 1.4.
: 
: but now with Solr 3.6 I keep getting the following Error 
: 
: /getTransformer fails in getContentType java.lang.RuntimeException:
: getTransformer fails in getContentType /
: 
: But instead of results.xsl If I use example.xsl, it is fine.
: 
: I fine my xsl:include does not seem to work with Solr 3.6
: 
: Can someone please let me know what am I doing wrong?
: 
: Thanks,
: 
: --
: View this message in context: http://lucene.472066.n3.nabble.com/Solr-3-6-fails-when-using-XSLT-tp3980240.html
: Sent from the Solr - User mailing list archive at Nabble.com.

-Hoss