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 Yuriy Akopov <ak...@hotmail.co.uk> on 2011/06/19 17:32:44 UTC

Building Solr 3.2 from sources - can't get war

Hi,

This is my first post here so excuse me please if it is not really related.

At the moment I'm using Solr 1.4.1 with SOLR-236 (https://issues.apache.org/jira/browse/SOLR-236) patch applied to support field collapsing.

One of the mandatory fields of documents indexed is generated from the *.doc/*.docx/*.pdf files uploaded by users, so Solr Cell is also heavily used in the project for the purpose of parsing documents to store their plain text content. Unfortunately, it can't parse correctly all the documents but in most cases it works well enough.

Recently I learned (http://stackoverflow.com/questions/6369214/solr-cell-extractingrequesthandler-cannot-parse-some-doc-files/) that Solr Cell I'm using is old so by using its up-to-date version I can get more documents parsed correctly. As I am using apache-solr-cell-1.4.1.jar in my lib folder, first thing I tried was to replace it with apache-solr-cell-3.2.jar from the latest distribution without changing anything else (e.g. war file). After Solr instance was restarted, it worked (I managed to fetch the content of the parsed document) but after a number of requests crashed.

Then, I decided that in order to use *-3.2 libraries properly I need to use 3.2 core war file as well. But as I need the collapsing functionality, I need to build a custom patched version of it as I did before with 1.4.1.

--
So the first question is if I was really right in my assumption here - maybe it is possible to upgrade Solr Cell / Tika to the latest version while still using 1.4.1 Solr core? If that's possible, my following questions can be skipped.
--

And the problem I am facing is that I can't build 3.2 version war file. I mean, when I get source from http://svn.apache.org/repos/asf/lucene/solr/tags/1.4.1/release-1.4.1 among the build options there is the "dist-war" key which allows to build war core and a set of standard libraries. Everything is simple in case you need to build 1.4.1 core.

For 3.2, I can't see a similar build option. First, there is no release-3.2 folder, so I tried to checkout http://svn.apache.org/repos/asf/lucene/dev/trunk supposing this is the latest stable release (and I might be wrong there). However, there is no "dist-war" build option and I only get various jar files when building that branch with no war file at all.

--
So the second question is what exactly am I doing wrong - do I checkout incorrect branch (and what is the correct one then?) or do I build it improperly (maybe I need to modify build.xml somehow)?
--

Many thanks in advance. Feel free to ask for more details if that matters - I am a total noob in Java programming so very likely I've missed something here.

--
Yuriy Akopov

 		 	   		  

RE: Building Solr 3.2 from sources - can't get war

Posted by Yuriy Akopov <ak...@hotmail.co.uk>.

> https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_2/

Thanks, that worked and as I now see was quite obvious (ashamed).

> Building dist succeeds, but I just tried dist-war on my checked out 3.2 
> and it failed, ending with the following error:
>
> BUILD FAILED
> /opt/ncindex/src/orig_3_2/solr/build.xml:620: 
> /opt/ncindex/src/orig_3_2/solr/build/web not found.

Btw first I got the same error, then first I build "compile", then "dist" and then "dist-war", and this way the WAR was created successfully. Will test it now if the patch applied works.
-y.
 		 	   		  

RE: Building Solr 3.2 from sources - can't get war

Posted by Steven A Rowe <sa...@syr.edu>.
https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_3_2/

> -----Original Message-----
> From: Yuriy Akopov [mailto:akopov@hotmail.co.uk]
> Sent: Sunday, June 19, 2011 4:38 PM
> To: solr-user@lucene.apache.org
> Subject: Re: Building Solr 3.2 from sources - can't get war
> 
> > In the checked out lucene (either trunk or one of the 3.x branches)
> source
> > is a solr/ directory.  You just cd into that directory, and dist-war
> > becomes a build option.
> 
> Thanks, Shawn! That worked and by invoking dist-war build I have received
> apache-solr-4.0-SNAPSHOT.war file successfully - but judging by its name
> it
> is a current 4.0 snapshot rather than stable 3.2.
> 
> Alas, 4.0 doesn't suit me for two reasons: first, it is still
> experimental
> and hasn't been released yet (at least as far as I know) and second, it
> supports field collapsing natively, so it doesn't need to be patched. The
> problem is that the parameters Solr 4.0 uses to control collapsing are
> not
> compatible with the ones added by SOLR-236 patch so I have to rewrite my
> client application as well. Which is surely inevitable sooner or later
> but
> until 4.0 is released I'd prefer stick to earlier version.
> 
> So I need an advice once again - which folder I need to checkout to get
> 3.2
> source code? Is it clear with 1.4.1 (.../tags/release-1.4.1 is obvious
> enough), and ...dev/trunk turned out to contain 4.0. Surely my question
> is
> silly but I can't figure out how can I get Solr 3.2 buildable source
> code.
> 
> -y.


Re: Building Solr 3.2 from sources - can't get war

Posted by Yuriy Akopov <ak...@hotmail.co.uk>.
> In the checked out lucene (either trunk or one of the 3.x branches) source 
> is a solr/ directory.  You just cd into that directory, and dist-war 
> becomes a build option.

Thanks, Shawn! That worked and by invoking dist-war build I have received 
apache-solr-4.0-SNAPSHOT.war file successfully - but judging by its name it 
is a current 4.0 snapshot rather than stable 3.2.

Alas, 4.0 doesn't suit me for two reasons: first, it is still experimental 
and hasn't been released yet (at least as far as I know) and second, it 
supports field collapsing natively, so it doesn't need to be patched. The 
problem is that the parameters Solr 4.0 uses to control collapsing are not 
compatible with the ones added by SOLR-236 patch so I have to rewrite my 
client application as well. Which is surely inevitable sooner or later but 
until 4.0 is released I'd prefer stick to earlier version.

So I need an advice once again - which folder I need to checkout to get 3.2 
source code? Is it clear with 1.4.1 (.../tags/release-1.4.1 is obvious 
enough), and ...dev/trunk turned out to contain 4.0. Surely my question is 
silly but I can't figure out how can I get Solr 3.2 buildable source code.

-y.


Re: Building Solr 3.2 from sources - can't get war

Posted by Shawn Heisey <so...@elyograg.org>.
On 6/19/2011 9:32 AM, Yuriy Akopov wrote:
> For 3.2, I can't see a similar build option. First, there is no release-3.2 folder, so I tried to checkout http://svn.apache.org/repos/asf/lucene/dev/trunk supposing this is the latest stable release (and I might be wrong there). However, there is no "dist-war" build option and I only get various jar files when building that branch with no war file at all.

I don't know the answer to your first question about Tika, but I can 
tackle the second.

In the checked out lucene (either trunk or one of the 3.x branches) 
source is a solr/ directory.  You just cd into that directory, and 
dist-war becomes a build option.  I tend to build solr with "ant dist" 
which also builds all the contrib jars.  If you are using the 
dataimporthandler, you'll want the contrib jars.  DIH has always been a 
contrib module, and in 3.1 it was removed from the .war file.

Building dist succeeds, but I just tried dist-war on my checked out 3.2 
and it failed, ending with the following error:

BUILD FAILED
/opt/ncindex/src/orig_3_2/solr/build.xml:620: 
/opt/ncindex/src/orig_3_2/solr/build/web not found.

Shawn