Solr Jetty confusion
Hi, I am currently trying to write a Jetty embedded java app that implements SOLR and uses SOLRJ by excepting posts telling it to do a batch index, or a deletion or what have you. At this point I am completely lost trying to follow http://wiki.apache.org/solr/SolrJetty . In my constructor I am doing the following call: Server server = new Server(); XmlConfiguration configuration = new XmlConfiguration(new FileInputStream("solrjetty.xml")); My xml has two calls, an addConnector to configure the port etc. and the addWebApplication as specified on the solr wiki. When running the app I get this: Exception in thread "main" java.lang.IllegalStateException: No Method: /solr/*/webapps/solr.wartrueorg/mortbay/jetty/servlet/webdefault.xml/solr/home/solr/home on class org.mortbay.jetty.Server Can anyone point me in the right direction? Thanks. -- View this message in context: http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24087264.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr Jetty confusion
Hey, So... I'm assuming your problem is that you're having trouble deploying Solr in Jetty? Or is your problem that it's deploying just fine but your code throws an exception when you try to run it? I am running Solr in Jetty, and I just copied the war into the webapps directory and it worked. It was accessible under /solr, and it was accessible under the port that Jetty has as its HTTP listener (which is probably 8080 by default, but probably won't be 8983). To specify the solr-home I use a Java system property (instead of the JNDI way) since I already have other necessary system properties for my apps. So if your problem turns out to be with the JNDI, sorry I won't be of much help. Hope that helps... - Daryl. On Thu, Jun 18, 2009 at 2:44 AM, pof wrote: > > Hi, I am currently trying to write a Jetty embedded java app that > implements > SOLR and uses SOLRJ by excepting posts telling it to do a batch index, or a > deletion or what have you. At this point I am completely lost trying to > follow http://wiki.apache.org/solr/SolrJetty . In my constructor I am > doing > the following call: > > Server server = new Server(); > XmlConfiguration configuration = new XmlConfiguration(new > FileInputStream("solrjetty.xml")); > > My xml has two calls, an addConnector to configure the port etc. and the > addWebApplication as specified on the solr wiki. When running the app I get > this: > > Exception in thread "main" java.lang.IllegalStateException: No Method: > name="addWebApplication">/solr/*/webapps/solr.war name="extractWAR">true > name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml name="addEnvEntry">/solr/home type="String">/solr/home on class > org.mortbay.jetty.Server > > Can anyone point me in the right direction? Thanks. > -- > View this message in context: > http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24087264.html > Sent from the Solr - User mailing list archive at Nabble.com. > >
Re: Solr Jetty confusion
My problem is that my project doesn't compile and I have know way of knowing if I'm on the right track code wise. There just isn't any comprehensive guide out there for having a solr/jetty app. Development Team wrote: > > Hey, > So... I'm assuming your problem is that you're having trouble > deploying > Solr in Jetty? Or is your problem that it's deploying just fine but your > code throws an exception when you try to run it? > I am running Solr in Jetty, and I just copied the war into the > webapps > directory and it worked. It was accessible under /solr, and it was > accessible under the port that Jetty has as its HTTP listener (which is > probably 8080 by default, but probably won't be 8983). To specify the > solr-home I use a Java system property (instead of the JNDI way) since I > already have other necessary system properties for my apps. So if your > problem turns out to be with the JNDI, sorry I won't be of much help. > Hope that helps... > > - Daryl. > > > On Thu, Jun 18, 2009 at 2:44 AM, pof wrote: > >> >> Hi, I am currently trying to write a Jetty embedded java app that >> implements >> SOLR and uses SOLRJ by excepting posts telling it to do a batch index, or >> a >> deletion or what have you. At this point I am completely lost trying to >> follow http://wiki.apache.org/solr/SolrJetty . In my constructor I am >> doing >> the following call: >> >> Server server = new Server(); >> XmlConfiguration configuration = new XmlConfiguration(new >> FileInputStream("solrjetty.xml")); >> >> My xml has two calls, an addConnector to configure the port etc. and the >> addWebApplication as specified on the solr wiki. When running the app I >> get >> this: >> >> Exception in thread "main" java.lang.IllegalStateException: No Method: >> > name="addWebApplication">/solr/*/webapps/solr.war> name="extractWAR">true> >> name="defaultsDescriptor">org/mortbay/jetty/servlet/webdefault.xml> name="addEnvEntry">/solr/home> type="String">/solr/home on class >> org.mortbay.jetty.Server >> >> Can anyone point me in the right direction? Thanks. >> -- >> View this message in context: >> http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24087264.html >> Sent from the Solr - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24099696.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr Jetty confusion
Development Team wrote: > > To specify the > solr-home I use a Java system property (instead of the JNDI way) since I > already have other necessary system properties for my apps. > Could you please give me a concrete example of how you did this? There is no example code or commandline examples to be found. Cheers, Brett. -- View this message in context: http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24104378.html Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solr Jetty confusion
Hi Brett, Well, I'm running Solr in Jetty with JBoss, so I used the JBoss method of specifying properties (properties-service.xml). However, you can supply the solr-home to the command-line when you start Jetty by using a parameter like, "-Dsolr.solr.home=C:\solr". You can do it like how they do it for Tomcat: http://wiki.apache.org/solr/SolrTomcat?highlight=(solr.home) You mention your code is not compiling... the code should be able to compile whether or not you can actually start solr with the right solr-home. It should also compile regardless of how what container you deploy Solr into. What exactly are you trying to do besides getting Solr to start in Jetty? - Daryl. On Thu, Jun 18, 2009 at 9:58 PM, pof wrote: > > > Development Team wrote: > > > > To specify the > > solr-home I use a Java system property (instead of the JNDI way) since I > > already have other necessary system properties for my apps. > > > > Could you please give me a concrete example of how you did this? There is > no > example code or commandline examples to be found. > > Cheers, Brett. > > -- > View this message in context: > http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24104378.html > Sent from the Solr - User mailing list archive at Nabble.com. > >
Re: Solr Jetty confusion
Hi, the problem was my xml configurations. I am now using a java process (seperate from the webserver) using the EmbeddedSolrServer method and post a commit to the webserver at the end to sync the two cores which seems to work well for me. Thanks for the help. Development Team wrote: > > Hi Brett, > Well, I'm running Solr in Jetty with JBoss, so I used the JBoss > method > of specifying properties (properties-service.xml). However, you can supply > the solr-home to the command-line when you start Jetty by using a > parameter > like, "-Dsolr.solr.home=C:\solr". You can do it like how they do it for > Tomcat: http://wiki.apache.org/solr/SolrTomcat?highlight=(solr.home) > > You mention your code is not compiling... the code should be able to > compile whether or not you can actually start solr with the right > solr-home. > It should also compile regardless of how what container you deploy Solr > into. What exactly are you trying to do besides getting Solr to start in > Jetty? > > - Daryl. > > > > On Thu, Jun 18, 2009 at 9:58 PM, pof wrote: > >> >> >> Development Team wrote: >> > >> > To specify the >> > solr-home I use a Java system property (instead of the JNDI way) since >> I >> > already have other necessary system properties for my apps. >> > >> >> Could you please give me a concrete example of how you did this? There is >> no >> example code or commandline examples to be found. >> >> Cheers, Brett. >> >> -- >> View this message in context: >> http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24104378.html >> Sent from the Solr - User mailing list archive at Nabble.com. >> >> > > -- View this message in context: http://www.nabble.com/Solr-Jetty-confusion-tp24087264p24142282.html Sent from the Solr - User mailing list archive at Nabble.com.