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 Lighton Phiri <li...@gmail.com> on 2012/12/18 15:00:41 UTC

XsltUpdateRequestHandler - HTTP ERROR 404

I am trying to test-drive an XsltUpdateRequestHandler I've set up on
one of my Solr cores. I am getting an 'HTTP ERROR 404' error and can't
quite figure out why. I've tried moving my xslt stylesheet to
different locations but that hasn't helped so far...

Specifically, issuing the command below results in the error response
output below.

curl "http://localhost:8983/solr/w5/update/xslt?commit=true&tr=ndltd-xsltUpdateRequestHandler.xsl"
-H "Content-Type: text/xml; charset=utf-8" --data-binary @oai-file.xml


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>Error 404 Not Found</title>
</head>
<body><h2>HTTP ERROR 404</h2>
<p>Problem accessing /solr/w5/update/xslt. Reason:
<pre>    Not Found</pre></p><hr /><i><small>Powered by
Jetty://</small></i><br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>
<br/>

</body>
</html>

My current solr core structure is as follows (w5 is a Solr core)

w5/
├── conf
│   ├── :
│   ├── :
│   ├── schema.xml
│   ├── solrconfig.xml
│   ├── :
│   └── xslt
│       └── ndltd-xsltUpdateRequestHandler.xsl
└── data
    └── index
        ├── segments.gen
        └── :


Lighton Phiri
http://lightonphiri.org

Re: XsltUpdateRequestHandler - HTTP ERROR 404

Posted by Lighton Phiri <li...@gmail.com>.
Finally got this to work --thank you Upayavira. Turns out the issue
was as a result of a syntax error in my stylesheet --I had <xsl:value>
instread of <xml-value-of> :(

I didn't notice the xsltproc compilation errors before because it
processed the valid styles and printed out the errors at the beginning
of output.

compilation error: file example-DIH/solr/w5/conf/xslt/x.xsl line 86
element value
xsltStylePreCompute: unknown xsl:value
compilation error: file example-DIH/solr/w5/conf/xslt/x.xsl line 90
element value
xsltStylePreCompute: unknown xsl:value


Lighton Phiri
http://lightonphiri.org


On 18 December 2012 17:01, Lighton Phiri <li...@gmail.com> wrote:
> I finally understand what you meant and called UpdateRequestHandler as
> shown below.
>
> curl "http://localhost:8983/solr/w5/update?commit=true&tr=x.xsl
>
> However, I am now getting an error '500 - Unable to initialize
> Templates' error. Part of error stack is below. I am not quite
> familiar with Solr errors though... turned on debugging but still
> can't figure out what I am doing wrong. I know stylesheet is fine
> because I can apply it to candidate XML files with xsltproc and it
> works.
>
> Searched mailing list archive and came up with this [1]
>
> <?xml version="1.0" encoding="UTF-8"?>
> <response>
> <lst name="responseHeader"><int name="status">500</int><int
> name="QTime">30</int></lst><lst name="error"><str name="msg">Unable to
> initialize Templates 'x.xsl'</str><str
> name="trace">java.io.IOException: Unable to initialize Templates
> 'x.xsl'
> 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.handler.loader.XMLLoader.getTransformer(XMLLoader.java:180)
> at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:116)
> at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
> at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
> at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
> :
> :
>
> [1] http://lucene.472066.n3.nabble.com/getTransformer-error-td3047726.html
> Lighton Phiri
> http://lightonphiri.org
>
>
> On 18 December 2012 16:27, Lighton Phiri <li...@gmail.com> wrote:
>>> Are you using 4.0? In 4.0 it has been merged into a single
>>
>> Sorry, forgot to specify Solr version --I am working with 4.0
>>
>>>As I understand it, if you post XML tohttp://localhost:8983/solr/update and provide a tr parameter, it will do
>>> the same thing as the XsltUpdateRequestHandler did.
>>
>> Still no luck getting it to work, I am getting the same 404 error... a
>> bit more context here; I am working with the example directory set up
>> and so basically started my Solr server with command below. Could it
>> be that I don't have the stylesheet in the right place?
>>
>> java -Dsolr.solr.home="./example-DIH/solr/" -jar start.jar
>>
>> From what I could see before I dumped my stylesheet in w5 core, db
>> core had a similar set up...
>>
>> ./solr/collection1/conf/xslt
>> ./example-DIH/solr/db/conf/xslt
>> ./example-DIH/solr/w5/conf/xslt
>>
>> Lighton Phiri
>> http://lightonphiri.org

Re: XsltUpdateRequestHandler - HTTP ERROR 404

Posted by Lighton Phiri <li...@gmail.com>.
I finally understand what you meant and called UpdateRequestHandler as
shown below.

curl "http://localhost:8983/solr/w5/update?commit=true&tr=x.xsl

However, I am now getting an error '500 - Unable to initialize
Templates' error. Part of error stack is below. I am not quite
familiar with Solr errors though... turned on debugging but still
can't figure out what I am doing wrong. I know stylesheet is fine
because I can apply it to candidate XML files with xsltproc and it
works.

Searched mailing list archive and came up with this [1]

<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">500</int><int
name="QTime">30</int></lst><lst name="error"><str name="msg">Unable to
initialize Templates 'x.xsl'</str><str
name="trace">java.io.IOException: Unable to initialize Templates
'x.xsl'
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.handler.loader.XMLLoader.getTransformer(XMLLoader.java:180)
at org.apache.solr.handler.loader.XMLLoader.load(XMLLoader.java:116)
at org.apache.solr.handler.UpdateRequestHandler$1.load(UpdateRequestHandler.java:92)
at org.apache.solr.handler.ContentStreamHandlerBase.handleRequestBody(ContentStreamHandlerBase.java:74)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
:
:

[1] http://lucene.472066.n3.nabble.com/getTransformer-error-td3047726.html
Lighton Phiri
http://lightonphiri.org


On 18 December 2012 16:27, Lighton Phiri <li...@gmail.com> wrote:
>> Are you using 4.0? In 4.0 it has been merged into a single
>
> Sorry, forgot to specify Solr version --I am working with 4.0
>
>>As I understand it, if you post XML tohttp://localhost:8983/solr/update and provide a tr parameter, it will do
>> the same thing as the XsltUpdateRequestHandler did.
>
> Still no luck getting it to work, I am getting the same 404 error... a
> bit more context here; I am working with the example directory set up
> and so basically started my Solr server with command below. Could it
> be that I don't have the stylesheet in the right place?
>
> java -Dsolr.solr.home="./example-DIH/solr/" -jar start.jar
>
> From what I could see before I dumped my stylesheet in w5 core, db
> core had a similar set up...
>
> ./solr/collection1/conf/xslt
> ./example-DIH/solr/db/conf/xslt
> ./example-DIH/solr/w5/conf/xslt
>
> Lighton Phiri
> http://lightonphiri.org

Re: XsltUpdateRequestHandler - HTTP ERROR 404

Posted by Lighton Phiri <li...@gmail.com>.
> Are you using 4.0? In 4.0 it has been merged into a single

Sorry, forgot to specify Solr version --I am working with 4.0

>As I understand it, if you post XML tohttp://localhost:8983/solr/update and provide a tr parameter, it will do
> the same thing as the XsltUpdateRequestHandler did.

Still no luck getting it to work, I am getting the same 404 error... a
bit more context here; I am working with the example directory set up
and so basically started my Solr server with command below. Could it
be that I don't have the stylesheet in the right place?

java -Dsolr.solr.home="./example-DIH/solr/" -jar start.jar

>From what I could see before I dumped my stylesheet in w5 core, db
core had a similar set up...

./solr/collection1/conf/xslt
./example-DIH/solr/db/conf/xslt
./example-DIH/solr/w5/conf/xslt

Lighton Phiri
http://lightonphiri.org

Re: XsltUpdateRequestHandler - HTTP ERROR 404

Posted by Upayavira <uv...@odoko.co.uk>.
Yay, someone actually using it...

Are you using 4.0? In 4.0 it has been merged into a single
UpdateRequestHandler now. As I understand it, if you post XML to
http://localhost:8983/solr/update and provide a tr parameter, it will do
the same thing as the XsltUpdateRequestHandler did.

Upayavira

On Tue, Dec 18, 2012, at 02:00 PM, Lighton Phiri wrote:
> I am trying to test-drive an XsltUpdateRequestHandler I've set up on
> one of my Solr cores. I am getting an 'HTTP ERROR 404' error and can't
> quite figure out why. I've tried moving my xslt stylesheet to
> different locations but that hasn't helped so far...
> 
> Specifically, issuing the command below results in the error response
> output below.
> 
> curl
> "http://localhost:8983/solr/w5/update/xslt?commit=true&tr=ndltd-xsltUpdateRequestHandler.xsl"
> -H "Content-Type: text/xml; charset=utf-8" --data-binary @oai-file.xml
> 
> 
> <html>
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
> <title>Error 404 Not Found</title>
> </head>
> <body><h2>HTTP ERROR 404</h2>
> <p>Problem accessing /solr/w5/update/xslt. Reason:
> <pre>    Not Found</pre></p><hr /><i><small>Powered by
> Jetty://</small></i><br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> <br/>
> 
> </body>
> </html>
> 
> My current solr core structure is as follows (w5 is a Solr core)
> 
> w5/
> ├── conf
> │   ├── :
> │   ├── :
> │   ├── schema.xml
> │   ├── solrconfig.xml
> │   ├── :
> │   └── xslt
> │       └── ndltd-xsltUpdateRequestHandler.xsl
> └── data
>     └── index
>         ├── segments.gen
>         └── :
> 
> 
> Lighton Phiri
> http://lightonphiri.org