Jetty question very specific to Solr, have been around and around with Google
and Jetty doc.
Drafting a simple patch for SOLR-4431 so that /cloud redirects to /solr/#/~cloud
What's working:
Added jetty-rewrite to solr/example/ivy.xml so that I'm now getting
example/lib/jetty-rewrite-8.1.8.v20121106.jar
Added rewrite rule to jetty.xml, references class
org.eclipse.jetty.rewrite.handler.RewriteHandler
What's *almost* working:
If I just java -jar start.jar, I get a class not found for
RewriteHandler
If I do java -jar start.jar OPTIONS=default,rewrite, it works, BUT not
acceptable for general usage
Where I'm stuck:
I need to tell Jetty to include "rewrite" in its list of options, so
it'll include the new class path.
Add "rewrite" in such a way that "java -jar start.jar" picks it up.
SEEMS simple enough, but each of the solutions has some problem:
Add OPTIONS= on the command line: Unacceptable, can't start solr if you
forget it.
Some environment variable… (if it exists), same problem, can't start
solr if you forget it.
Add it to start.config in the start.jar file: No, we don't build that,
we download it as a fixed asset in ivy
Add it to start.ini: No, we don't use start.ini, and if I add one, I
*think* it's back to requiring a different command line option
Add something to etc/jetty.xml, BEFORE first reference to
RewriteHandler class. So far no luck, trying to set OPTIONS=… in there.
Maybe there's some other way???
Add something to etc/webdefault.xml: might be too late in the startup
chain, and haven't found anything that works.
Add something to contexts/solr-jetty-context.xml: same issues, probably
too late, and haven't found anything that works.
So… how do I get rewrite.jar into Jetty? (or a default OPTIONS that includes
rewrite)
Details on some things I've tried (may or may not be helpful, this is stuff
that didn't work)
jetty.xml, 1
<Configure id="Server" …>
<Set name="OPTIONS">default,rewrite,*</Set>
jetty.xml, 2
<Configure id="Server" …>
<Call name="setAttribute">
<Arg>OPTIONS</Arg>
<Arg>default,rewrite,*</Arg>
</Call>
webdefault.xml
<web-app …> ...
<servlet>
<init-param>
<param-name>OPTIONS</param-name>
<param-value>default,rewrite,*</param-value>
</init-param>
solr-jetty-context.xml
<Configure …>
<Set name="OPTIONS">default,rewrite,*</Set>
--
Mark Bennett / LucidWorks: Search & Big Data / [email protected]
Office: 408-898-4201 / Telecommute: 408-733-0387 / Cell: 408-829-6513