example .java to start jetty with solr

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

example .java to start jetty with solr

Brian Whitman
Does anyone have a "solr launcher" .java file that: 1) instantiates  
jetty & sets its port, 2) sets some solr parameters (location of war  
file, location of data directory, etc), 3) launches jetty with solr  
as a context?

I would like to call Jetty/Solr from a a Java bridge and have it exit  
when the program does reliably, to use as the backend to a larger  
program. I can't use java -jar start.jar because it spawns a new  
process, I need to find the actual java code to set it up. I've tried  
setting up the Jetty Server() and doing the addWebApplication() thing  
but while Jetty starts, it does not seem to find all the support  
files for Solr.

-Brian




Reply | Threaded
Open this post in threaded view
|

Re: example .java to start jetty with solr

Chris Hostetter-3

: program. I can't use java -jar start.jar because it spawns a new
: process, I need to find the actual java code to set it up. I've tried
: setting up the Jetty Server() and doing the addWebApplication() thing
: but while Jetty starts, it does not seem to find all the support
: files for Solr.

the solr.war is setup to look for those files using a variety of means --
the ultimate fallback being in the current working directory of the java
process.

if you are already using the progromatic interface to Jetty to set up the
Server() and add the web application, you should look into how to specify
the solr/home using the JNDI addEnvEntry call and try that (note: this
requires "Jetty Plus")

Alternately you could set the "solr.solr.home" Java SYstem property in
your JVM prior to initializing Jetty...

http://wiki.apache.org/solr/SolrInstall
http://wiki.apache.org/solr/SolrJetty



-Hoss