Thanks Shawn,

I actually figured out the issue while I was on my flight back home. It was a 
trivial problem caused by a bad assumption. I have some classpath issues now 
but those are problems I can solve.

Sorry for not including any logs, the behaviour looked like it was simply not 
detecting the war and I was just curious if there was something obvious I was 
missing because it is hard to find documentation on. It started working when I 
exploded the war archive, a mistake I probably shouldn’t have made.

To Upayavira: I think it is a fair question why I would be using Embedded 
Jetty. There is a lot of value and use cases for this, in my case I want to run 
my SOLR instance within the JVM of another java process. I also believe in a 
philosophy that developers should understand how software works, not just how 
to use it; therefore I like to experiment with unconventional approaches when I 
tinker. This doesn’t mean I would take the unconventional approach to 
production.

Thanks!

Darin


> On Jul 23, 2015, at 7:54 PM, Shawn Heisey <apa...@elyograg.org> wrote:
> 
> On 7/23/2015 3:14 PM, Darin Amos wrote:
>> I have been trying to run the SOLR war with embedded Jetty and can’t seem to 
>> get the config quiet right. Is there any known documentation on this or is 
>> someone else doing this? I seem to just be setting up a document server at 
>> my solr.home directory. The code snippet below seems incomplete to me, but I 
>> can’t seem to find what I am missing. 
>> 
>> Thanks!
>> 
>> Darin
>> 
>> Server solrServer = new Server(8983);
>> 
>> WebAppContext solrApp = new WebAppContext();
>> solrApp.setContextPath("/");
>> solrApp.setWar("solr.war");   //solr.war is sitting in my java.home root for 
>> now.
>> solrServer.setHandler(solrApp);
>> 
>> solrServer.start();
>> solrServer.join();
> 
> The only officially supported way to run Solr since 5.0 was released is
> with the scripts included in the "bin" directory in the download.
> 
> https://wiki.apache.org/solr/WhyNoWar <https://wiki.apache.org/solr/WhyNoWar>
> 
> That doesn't mean I won't try to help you, but without logs, there's no
> way to know what is happening.  You may need help from the Jetty
> project, at least to set up logging, and possibly with the rest of it. 
> Here's some info on logging for a standard install ... I have no idea
> how you'd go about this for the embedded version:
> 
> http://www.eclipse.org/jetty/documentation/9.2.7.v20150116/configuring-logging.html
>  
> <http://www.eclipse.org/jetty/documentation/9.2.7.v20150116/configuring-logging.html>
> 
> For Solr's logging, you need the jars from the server/lib/ext directory
> in the Solr download (for the included jetty server) in a similar
> directory for your application, and the log4j.properties file needs to
> be on the classpath or explicitly described with an appropriate system
> property.
> 
> https://wiki.apache.org/solr/SolrLogging 
> <https://wiki.apache.org/solr/SolrLogging>
> 
> In the Solr download, look at the xml file in server/contexts (5.x) for
> some hints about how to properly configure jetty for the webapp.
> 
> I would recommend that you use "/solr" for the context path.  Every
> example you'll run into uses that URL path.  If you want to be
> explicitly different than default to make an attacker's job harder, then
> pick some other string to put after the slash.  I don't have much
> experience with the root context, but I've read somewhere that there can
> be some pitfalls.  I do not know what they are.
> 
> Thanks,
> Shawn

Reply via email to