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 Nawab Zada Asad Iqbal <kh...@gmail.com> on 2017/06/02 10:15:39 UTC

Steps for building solr/lucene code and starting server

Hi,

I have synced lucene-solr repo because I (will) have some custom code in
lucene and solr folders. What are the steps for starting solr server? My
schema.xml uses ICUNormalizer2CharFilterFactory (which I see in lucene
folder tree), but I don't know how to make it work with solr webapp. I know
the (luncene ant
target) 'compile',  (solr targets) 'dist', and 'server', but the order is
not clear to me.

I have compiled lucene before doing 'ant server' in solr folder, but I
still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-

Caused by: org.apache.solr.common.SolrException: Plugin init failure for
[schema.xml] fieldType "text": Plugin init failure for [schema.xml]
analyzer/charFilter "nfkc": Error loading class
'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'



Thanks
Nawab

Re: Steps for building solr/lucene code and starting server

Posted by Nawab Zada Asad Iqbal <kh...@gmail.com>.
Thanks Erick

I ended up including my files in solr/webapp/build.xml under "dist" target
(which is also called by "server" target in solr folder). I used fileset
instead of lib not sure about the pros and cons. Now I am able to run my
server using 'bin/solr' with my custom config files.



On Fri, Jun 2, 2017 at 8:08 PM, Erick Erickson <er...@gmail.com>
wrote:

> You can just put a <lib..../> directive in your solrconfig.xml file
> that points to the jar in analysis-extras.....
>
> I generally prefer that to copying things around on the theory that
> it's one less thing to forget to copy sometime later...
>
> Best,
> Erick
>
> On Fri, Jun 2, 2017 at 5:05 PM, Nawab Zada Asad Iqbal <kh...@gmail.com>
> wrote:
> > When I do 'ant server', the libs from "./build/lucene-libs/" are copied
> > over to "./server/solr-webapp/webapp/WEB-INF/lib/" . However, my
> required
> > class is in a lib which is on:
> > "./build/contrib/solr-analysis-extras/lucene-libs/"
> >
> > I guess, I need to do the contrib target?
> >
> >
> > On Fri, Jun 2, 2017 at 4:20 PM, Nawab Zada Asad Iqbal <kh...@gmail.com>
> > wrote:
> >
> >> Hi Erick
> >>
> >> "bin/solr start -e techproducts" works fine. It is probably because it
> is
> >> not referring to 'org.apache.lucene.analysis.ic
> >> u.ICUNormalizer2CharFilterFactory' in the schema.xml ?
> >>
> >> I am not sure what should I try. I am wondering if there is some
> document
> >> about solr dev setup.
> >>
> >>
> >> On Fri, Jun 2, 2017 at 8:29 AM, Erick Erickson <erickerickson@gmail.com
> >
> >> wrote:
> >>
> >>> "ant server" should be sufficient. "dist" is useful for when
> >>> you have custom _external_ programs (say SolrJ) that you
> >>> want all the libraries collected in the same place. There's
> >>> no need to "ant compile" as the "server" target
> >>>
> >>> I assume what you're seeing is a ClassNotFound error, right?
> >>> I'm a bit puzzled since that filter isn't a contrib, so it should
> >>> be found.
> >>>
> >>> What I'd do is just do the build first then start the example,
> >>> "bin/solr start -e techproducts"
> >>> Don't specify solrhome or anything else. Once that works,
> >>> build up from there.
> >>>
> >>> Best,
> >>> Erick
> >>>
> >>> On Fri, Jun 2, 2017 at 3:15 AM, Nawab Zada Asad Iqbal <
> khichi@gmail.com>
> >>> wrote:
> >>> > Hi,
> >>> >
> >>> > I have synced lucene-solr repo because I (will) have some custom
> code in
> >>> > lucene and solr folders. What are the steps for starting solr
> server? My
> >>> > schema.xml uses ICUNormalizer2CharFilterFactory (which I see in
> lucene
> >>> > folder tree), but I don't know how to make it work with solr webapp.
> I
> >>> know
> >>> > the (luncene ant
> >>> > target) 'compile',  (solr targets) 'dist', and 'server', but the
> order
> >>> is
> >>> > not clear to me.
> >>> >
> >>> > I have compiled lucene before doing 'ant server' in solr folder, but
> I
> >>> > still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-
> >>> >
> >>> > Caused by: org.apache.solr.common.SolrException: Plugin init failure
> >>> for
> >>> > [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
> >>> > analyzer/charFilter "nfkc": Error loading class
> >>> > 'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'
> >>> >
> >>> >
> >>> >
> >>> > Thanks
> >>> > Nawab
> >>>
> >>
> >>
>

Re: Steps for building solr/lucene code and starting server

Posted by Erick Erickson <er...@gmail.com>.
You can just put a <lib..../> directive in your solrconfig.xml file
that points to the jar in analysis-extras.....

I generally prefer that to copying things around on the theory that
it's one less thing to forget to copy sometime later...

Best,
Erick

On Fri, Jun 2, 2017 at 5:05 PM, Nawab Zada Asad Iqbal <kh...@gmail.com> wrote:
> When I do 'ant server', the libs from "./build/lucene-libs/" are copied
> over to "./server/solr-webapp/webapp/WEB-INF/lib/" . However, my required
> class is in a lib which is on:
> "./build/contrib/solr-analysis-extras/lucene-libs/"
>
> I guess, I need to do the contrib target?
>
>
> On Fri, Jun 2, 2017 at 4:20 PM, Nawab Zada Asad Iqbal <kh...@gmail.com>
> wrote:
>
>> Hi Erick
>>
>> "bin/solr start -e techproducts" works fine. It is probably because it is
>> not referring to 'org.apache.lucene.analysis.ic
>> u.ICUNormalizer2CharFilterFactory' in the schema.xml ?
>>
>> I am not sure what should I try. I am wondering if there is some document
>> about solr dev setup.
>>
>>
>> On Fri, Jun 2, 2017 at 8:29 AM, Erick Erickson <er...@gmail.com>
>> wrote:
>>
>>> "ant server" should be sufficient. "dist" is useful for when
>>> you have custom _external_ programs (say SolrJ) that you
>>> want all the libraries collected in the same place. There's
>>> no need to "ant compile" as the "server" target
>>>
>>> I assume what you're seeing is a ClassNotFound error, right?
>>> I'm a bit puzzled since that filter isn't a contrib, so it should
>>> be found.
>>>
>>> What I'd do is just do the build first then start the example,
>>> "bin/solr start -e techproducts"
>>> Don't specify solrhome or anything else. Once that works,
>>> build up from there.
>>>
>>> Best,
>>> Erick
>>>
>>> On Fri, Jun 2, 2017 at 3:15 AM, Nawab Zada Asad Iqbal <kh...@gmail.com>
>>> wrote:
>>> > Hi,
>>> >
>>> > I have synced lucene-solr repo because I (will) have some custom code in
>>> > lucene and solr folders. What are the steps for starting solr server? My
>>> > schema.xml uses ICUNormalizer2CharFilterFactory (which I see in lucene
>>> > folder tree), but I don't know how to make it work with solr webapp. I
>>> know
>>> > the (luncene ant
>>> > target) 'compile',  (solr targets) 'dist', and 'server', but the order
>>> is
>>> > not clear to me.
>>> >
>>> > I have compiled lucene before doing 'ant server' in solr folder, but I
>>> > still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-
>>> >
>>> > Caused by: org.apache.solr.common.SolrException: Plugin init failure
>>> for
>>> > [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
>>> > analyzer/charFilter "nfkc": Error loading class
>>> > 'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'
>>> >
>>> >
>>> >
>>> > Thanks
>>> > Nawab
>>>
>>
>>

Re: Steps for building solr/lucene code and starting server

Posted by Nawab Zada Asad Iqbal <kh...@gmail.com>.
When I do 'ant server', the libs from "./build/lucene-libs/" are copied
over to "./server/solr-webapp/webapp/WEB-INF/lib/" . However, my required
class is in a lib which is on:
"./build/contrib/solr-analysis-extras/lucene-libs/"

I guess, I need to do the contrib target?


On Fri, Jun 2, 2017 at 4:20 PM, Nawab Zada Asad Iqbal <kh...@gmail.com>
wrote:

> Hi Erick
>
> "bin/solr start -e techproducts" works fine. It is probably because it is
> not referring to 'org.apache.lucene.analysis.ic
> u.ICUNormalizer2CharFilterFactory' in the schema.xml ?
>
> I am not sure what should I try. I am wondering if there is some document
> about solr dev setup.
>
>
> On Fri, Jun 2, 2017 at 8:29 AM, Erick Erickson <er...@gmail.com>
> wrote:
>
>> "ant server" should be sufficient. "dist" is useful for when
>> you have custom _external_ programs (say SolrJ) that you
>> want all the libraries collected in the same place. There's
>> no need to "ant compile" as the "server" target
>>
>> I assume what you're seeing is a ClassNotFound error, right?
>> I'm a bit puzzled since that filter isn't a contrib, so it should
>> be found.
>>
>> What I'd do is just do the build first then start the example,
>> "bin/solr start -e techproducts"
>> Don't specify solrhome or anything else. Once that works,
>> build up from there.
>>
>> Best,
>> Erick
>>
>> On Fri, Jun 2, 2017 at 3:15 AM, Nawab Zada Asad Iqbal <kh...@gmail.com>
>> wrote:
>> > Hi,
>> >
>> > I have synced lucene-solr repo because I (will) have some custom code in
>> > lucene and solr folders. What are the steps for starting solr server? My
>> > schema.xml uses ICUNormalizer2CharFilterFactory (which I see in lucene
>> > folder tree), but I don't know how to make it work with solr webapp. I
>> know
>> > the (luncene ant
>> > target) 'compile',  (solr targets) 'dist', and 'server', but the order
>> is
>> > not clear to me.
>> >
>> > I have compiled lucene before doing 'ant server' in solr folder, but I
>> > still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-
>> >
>> > Caused by: org.apache.solr.common.SolrException: Plugin init failure
>> for
>> > [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
>> > analyzer/charFilter "nfkc": Error loading class
>> > 'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'
>> >
>> >
>> >
>> > Thanks
>> > Nawab
>>
>
>

Re: Steps for building solr/lucene code and starting server

Posted by Nawab Zada Asad Iqbal <kh...@gmail.com>.
Hi Erick

"bin/solr start -e techproducts" works fine. It is probably because it is
not referring to 'org.apache.lucene.analysis.ic
u.ICUNormalizer2CharFilterFactory' in the schema.xml ?

I am not sure what should I try. I am wondering if there is some document
about solr dev setup.


On Fri, Jun 2, 2017 at 8:29 AM, Erick Erickson <er...@gmail.com>
wrote:

> "ant server" should be sufficient. "dist" is useful for when
> you have custom _external_ programs (say SolrJ) that you
> want all the libraries collected in the same place. There's
> no need to "ant compile" as the "server" target
>
> I assume what you're seeing is a ClassNotFound error, right?
> I'm a bit puzzled since that filter isn't a contrib, so it should
> be found.
>
> What I'd do is just do the build first then start the example,
> "bin/solr start -e techproducts"
> Don't specify solrhome or anything else. Once that works,
> build up from there.
>
> Best,
> Erick
>
> On Fri, Jun 2, 2017 at 3:15 AM, Nawab Zada Asad Iqbal <kh...@gmail.com>
> wrote:
> > Hi,
> >
> > I have synced lucene-solr repo because I (will) have some custom code in
> > lucene and solr folders. What are the steps for starting solr server? My
> > schema.xml uses ICUNormalizer2CharFilterFactory (which I see in lucene
> > folder tree), but I don't know how to make it work with solr webapp. I
> know
> > the (luncene ant
> > target) 'compile',  (solr targets) 'dist', and 'server', but the order is
> > not clear to me.
> >
> > I have compiled lucene before doing 'ant server' in solr folder, but I
> > still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-
> >
> > Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> > [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
> > analyzer/charFilter "nfkc": Error loading class
> > 'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'
> >
> >
> >
> > Thanks
> > Nawab
>

Re: Steps for building solr/lucene code and starting server

Posted by Erick Erickson <er...@gmail.com>.
"ant server" should be sufficient. "dist" is useful for when
you have custom _external_ programs (say SolrJ) that you
want all the libraries collected in the same place. There's
no need to "ant compile" as the "server" target

I assume what you're seeing is a ClassNotFound error, right?
I'm a bit puzzled since that filter isn't a contrib, so it should
be found.

What I'd do is just do the build first then start the example,
"bin/solr start -e techproducts"
Don't specify solrhome or anything else. Once that works,
build up from there.

Best,
Erick

On Fri, Jun 2, 2017 at 3:15 AM, Nawab Zada Asad Iqbal <kh...@gmail.com> wrote:
> Hi,
>
> I have synced lucene-solr repo because I (will) have some custom code in
> lucene and solr folders. What are the steps for starting solr server? My
> schema.xml uses ICUNormalizer2CharFilterFactory (which I see in lucene
> folder tree), but I don't know how to make it work with solr webapp. I know
> the (luncene ant
> target) 'compile',  (solr targets) 'dist', and 'server', but the order is
> not clear to me.
>
> I have compiled lucene before doing 'ant server' in solr folder, but I
> still see this error when I do 'bin/solr start -f -s ~/solrhome/' :-
>
> Caused by: org.apache.solr.common.SolrException: Plugin init failure for
> [schema.xml] fieldType "text": Plugin init failure for [schema.xml]
> analyzer/charFilter "nfkc": Error loading class
> 'org.apache.lucene.analysis.icu.ICUNormalizer2CharFilterFactory'
>
>
>
> Thanks
> Nawab