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 Sandeep Mestry <sa...@gmail.com> on 2013/05/20 16:01:29 UTC

Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Hi All,

I want to override a component from solr-core and for that I need solr-core
jar.

I am using the solr.war that comes from Apache mirror and if I open the
war, I see the solr-core jar is actually named as apache-solr-core.jar.
This is also true about solrj jar.

If I now provide a dependency in my module for apache-solr-core.jar, it's
not being found in the mirror. And if I use solr-core.jar, I get strange
class cast exception during Solr startup for MorfologikFilterFactory.

(I'm not using this factory at all in my project.)

at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.ClassCastException: class
org.apache.lucene.analysis.morfologik.MorfologikFilterFactory
at java.lang.Class.asSubclass(Unknown Source)
at org.apache.lucene.util.SPIClassIterator.next(SPIClassIterator.java:126)
at
org.apache.lucene.analysis.util.AnalysisSPILoader.reload(AnalysisSPILoader.java:73)
at
org.apache.lucene.analysis.util.AnalysisSPILoader.<init>(AnalysisSPILoader.java:55)

I tried manually removing the apache-solr-core.jar from the solr
distribution war and then providing the dependency and everything worked
fine.

And I do remember the discussion on the forum about dropping the name
*apache* from solr jars. If that's what caused this issue, then can you
tell me if the mirrors need updating with solr-core.jar instead of
apache-solr-core.jar?

Many Thanks,
Sandeep

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Sandeep Mestry <sa...@gmail.com>.
Thanks Erick for your suggestion.

Turns out I won't be going that route after all as the highlighter
component is quite complicated - to follow and to override - and not much
time left in hand so did it the manual (dirty) way.

Beat Regards,
Sandeep


On 22 May 2013 12:21, Erick Erickson <er...@gmail.com> wrote:

> Sandeep:
>
> You need to be a little careful here, I second Shawn's comment that
> you are mixing versions. You say you are using solr 4.0. But the jar
> that ships with that is apache-solr-core-4.0.0.jar. Then you talk
> about using solr-core, which is called solr-core-4.1.jar.
>
> Maven is not officially supported, so grabbing some solr-core.jar
> (with no apache) and doing _anything_ with it from a 4.0 code base is
> not a good idea.
>
> You can check out the 4.0 code branch and just compile the whole
> thing. Or you can get a new 4.0 distro and use the jars there. But I'd
> be _really_ cautious about using a 4.1 or later jar with 4.0.
>
> FWIW,
> Erick
>
> On Tue, May 21, 2013 at 12:05 PM, Sandeep Mestry <sa...@gmail.com>
> wrote:
> > Thanks Steve,
> >
> > I could find solr-core.jar in the repo but could not find
> > apache-solr-core.jar.
> > I think my issue got misunderstood - which is totally my fault.
> >
> > Anyway, I took into account Shawn's comment and will use solr-core.jar
> only
> > for compiling the project - not for deploying.
> >
> > Thanks,
> > Sandeep
> >
> >
> > On 21 May 2013 16:46, Steve Rowe <sa...@gmail.com> wrote:
> >
> >> The 4.0 solr-core jar is available in Maven Central: <
> >>
> http://search.maven.org/#artifactdetails%7Corg.apache.solr%7Csolr-core%7C4.0.0%7Cjar
> >> >
> >>
> >> Steve
> >>
> >> On May 21, 2013, at 11:26 AM, Sandeep Mestry <sa...@gmail.com>
> wrote:
> >>
> >> > Hi Steve,
> >> >
> >> > Solr 4.0 - mentioned in the subject.. :-)
> >> >
> >> > Thanks,
> >> > Sandeep
> >> >
> >> >
> >> > On 21 May 2013 14:58, Steve Rowe <sa...@gmail.com> wrote:
> >> >
> >> >> Sandeep,
> >> >>
> >> >> What version of Solr are you using?
> >> >>
> >> >> Steve
> >> >>
> >> >> On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com>
> >> wrote:
> >> >>
> >> >>> Hi Shawn,
> >> >>>
> >> >>> Thanks for your reply.
> >> >>>
> >> >>> I'm not mixing versions.
> >> >>> The problem I faced is I want to override Highlighter from solr-core
> >> jar
> >> >>> and if I add that as a dependency in my project then there was a
> clash
> >> >>> between solr-core.jar and the apache-solr-core.jar that comes
> bundled
> >> >>> within the solr distribution. It was complaining about
> >> >> MorfologikFilterFactory
> >> >>> classcastexception.
> >> >>> I can't use apache-solr-core.jar as a dependency as no such jar
> exists
> >> in
> >> >>> any maven repo.
> >> >>>
> >> >>> The only thing I could do is to remove apache-solr-core.jar from
> >> solr.war
> >> >>> and then use solr-core.jar as a dependency - however I do not think
> >> this
> >> >> is
> >> >>> the ideal solution.
> >> >>>
> >> >>> Thanks,
> >> >>> Sandeep
> >> >>>
> >> >>>
> >> >>> On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
> >> >>>
> >> >>>> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
> >> >>>>> And I do remember the discussion on the forum about dropping the
> name
> >> >>>>> *apache* from solr jars. If that's what caused this issue, then
> can
> >> you
> >> >>>>> tell me if the mirrors need updating with solr-core.jar instead of
> >> >>>>> apache-solr-core.jar?
> >> >>>>
> >> >>>> If it's named apache-solr-core, then it's from 4.0 or earlier.  If
> >> it's
> >> >>>> named solr-core, then it's from 4.1 or later.  That might mean that
> >> you
> >> >>>> are mixing versions - don't do that.  Make sure that you have jars
> >> from
> >> >>>> the exact same version as your server.
> >> >>>>
> >> >>>> Thanks,
> >> >>>> Shawn
> >> >>>>
> >> >>>>
> >> >>
> >> >>
> >>
> >>
>

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Erick Erickson <er...@gmail.com>.
Sandeep:

You need to be a little careful here, I second Shawn's comment that
you are mixing versions. You say you are using solr 4.0. But the jar
that ships with that is apache-solr-core-4.0.0.jar. Then you talk
about using solr-core, which is called solr-core-4.1.jar.

Maven is not officially supported, so grabbing some solr-core.jar
(with no apache) and doing _anything_ with it from a 4.0 code base is
not a good idea.

You can check out the 4.0 code branch and just compile the whole
thing. Or you can get a new 4.0 distro and use the jars there. But I'd
be _really_ cautious about using a 4.1 or later jar with 4.0.

FWIW,
Erick

On Tue, May 21, 2013 at 12:05 PM, Sandeep Mestry <sa...@gmail.com> wrote:
> Thanks Steve,
>
> I could find solr-core.jar in the repo but could not find
> apache-solr-core.jar.
> I think my issue got misunderstood - which is totally my fault.
>
> Anyway, I took into account Shawn's comment and will use solr-core.jar only
> for compiling the project - not for deploying.
>
> Thanks,
> Sandeep
>
>
> On 21 May 2013 16:46, Steve Rowe <sa...@gmail.com> wrote:
>
>> The 4.0 solr-core jar is available in Maven Central: <
>> http://search.maven.org/#artifactdetails%7Corg.apache.solr%7Csolr-core%7C4.0.0%7Cjar
>> >
>>
>> Steve
>>
>> On May 21, 2013, at 11:26 AM, Sandeep Mestry <sa...@gmail.com> wrote:
>>
>> > Hi Steve,
>> >
>> > Solr 4.0 - mentioned in the subject.. :-)
>> >
>> > Thanks,
>> > Sandeep
>> >
>> >
>> > On 21 May 2013 14:58, Steve Rowe <sa...@gmail.com> wrote:
>> >
>> >> Sandeep,
>> >>
>> >> What version of Solr are you using?
>> >>
>> >> Steve
>> >>
>> >> On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com>
>> wrote:
>> >>
>> >>> Hi Shawn,
>> >>>
>> >>> Thanks for your reply.
>> >>>
>> >>> I'm not mixing versions.
>> >>> The problem I faced is I want to override Highlighter from solr-core
>> jar
>> >>> and if I add that as a dependency in my project then there was a clash
>> >>> between solr-core.jar and the apache-solr-core.jar that comes bundled
>> >>> within the solr distribution. It was complaining about
>> >> MorfologikFilterFactory
>> >>> classcastexception.
>> >>> I can't use apache-solr-core.jar as a dependency as no such jar exists
>> in
>> >>> any maven repo.
>> >>>
>> >>> The only thing I could do is to remove apache-solr-core.jar from
>> solr.war
>> >>> and then use solr-core.jar as a dependency - however I do not think
>> this
>> >> is
>> >>> the ideal solution.
>> >>>
>> >>> Thanks,
>> >>> Sandeep
>> >>>
>> >>>
>> >>> On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
>> >>>
>> >>>> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
>> >>>>> And I do remember the discussion on the forum about dropping the name
>> >>>>> *apache* from solr jars. If that's what caused this issue, then can
>> you
>> >>>>> tell me if the mirrors need updating with solr-core.jar instead of
>> >>>>> apache-solr-core.jar?
>> >>>>
>> >>>> If it's named apache-solr-core, then it's from 4.0 or earlier.  If
>> it's
>> >>>> named solr-core, then it's from 4.1 or later.  That might mean that
>> you
>> >>>> are mixing versions - don't do that.  Make sure that you have jars
>> from
>> >>>> the exact same version as your server.
>> >>>>
>> >>>> Thanks,
>> >>>> Shawn
>> >>>>
>> >>>>
>> >>
>> >>
>>
>>

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Sandeep Mestry <sa...@gmail.com>.
Thanks Steve,

I could find solr-core.jar in the repo but could not find
apache-solr-core.jar.
I think my issue got misunderstood - which is totally my fault.

Anyway, I took into account Shawn's comment and will use solr-core.jar only
for compiling the project - not for deploying.

Thanks,
Sandeep


On 21 May 2013 16:46, Steve Rowe <sa...@gmail.com> wrote:

> The 4.0 solr-core jar is available in Maven Central: <
> http://search.maven.org/#artifactdetails%7Corg.apache.solr%7Csolr-core%7C4.0.0%7Cjar
> >
>
> Steve
>
> On May 21, 2013, at 11:26 AM, Sandeep Mestry <sa...@gmail.com> wrote:
>
> > Hi Steve,
> >
> > Solr 4.0 - mentioned in the subject.. :-)
> >
> > Thanks,
> > Sandeep
> >
> >
> > On 21 May 2013 14:58, Steve Rowe <sa...@gmail.com> wrote:
> >
> >> Sandeep,
> >>
> >> What version of Solr are you using?
> >>
> >> Steve
> >>
> >> On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com>
> wrote:
> >>
> >>> Hi Shawn,
> >>>
> >>> Thanks for your reply.
> >>>
> >>> I'm not mixing versions.
> >>> The problem I faced is I want to override Highlighter from solr-core
> jar
> >>> and if I add that as a dependency in my project then there was a clash
> >>> between solr-core.jar and the apache-solr-core.jar that comes bundled
> >>> within the solr distribution. It was complaining about
> >> MorfologikFilterFactory
> >>> classcastexception.
> >>> I can't use apache-solr-core.jar as a dependency as no such jar exists
> in
> >>> any maven repo.
> >>>
> >>> The only thing I could do is to remove apache-solr-core.jar from
> solr.war
> >>> and then use solr-core.jar as a dependency - however I do not think
> this
> >> is
> >>> the ideal solution.
> >>>
> >>> Thanks,
> >>> Sandeep
> >>>
> >>>
> >>> On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
> >>>
> >>>> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
> >>>>> And I do remember the discussion on the forum about dropping the name
> >>>>> *apache* from solr jars. If that's what caused this issue, then can
> you
> >>>>> tell me if the mirrors need updating with solr-core.jar instead of
> >>>>> apache-solr-core.jar?
> >>>>
> >>>> If it's named apache-solr-core, then it's from 4.0 or earlier.  If
> it's
> >>>> named solr-core, then it's from 4.1 or later.  That might mean that
> you
> >>>> are mixing versions - don't do that.  Make sure that you have jars
> from
> >>>> the exact same version as your server.
> >>>>
> >>>> Thanks,
> >>>> Shawn
> >>>>
> >>>>
> >>
> >>
>
>

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Steve Rowe <sa...@gmail.com>.
The 4.0 solr-core jar is available in Maven Central: <http://search.maven.org/#artifactdetails%7Corg.apache.solr%7Csolr-core%7C4.0.0%7Cjar>

Steve

On May 21, 2013, at 11:26 AM, Sandeep Mestry <sa...@gmail.com> wrote:

> Hi Steve,
> 
> Solr 4.0 - mentioned in the subject.. :-)
> 
> Thanks,
> Sandeep
> 
> 
> On 21 May 2013 14:58, Steve Rowe <sa...@gmail.com> wrote:
> 
>> Sandeep,
>> 
>> What version of Solr are you using?
>> 
>> Steve
>> 
>> On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com> wrote:
>> 
>>> Hi Shawn,
>>> 
>>> Thanks for your reply.
>>> 
>>> I'm not mixing versions.
>>> The problem I faced is I want to override Highlighter from solr-core jar
>>> and if I add that as a dependency in my project then there was a clash
>>> between solr-core.jar and the apache-solr-core.jar that comes bundled
>>> within the solr distribution. It was complaining about
>> MorfologikFilterFactory
>>> classcastexception.
>>> I can't use apache-solr-core.jar as a dependency as no such jar exists in
>>> any maven repo.
>>> 
>>> The only thing I could do is to remove apache-solr-core.jar from solr.war
>>> and then use solr-core.jar as a dependency - however I do not think this
>> is
>>> the ideal solution.
>>> 
>>> Thanks,
>>> Sandeep
>>> 
>>> 
>>> On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
>>> 
>>>> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
>>>>> And I do remember the discussion on the forum about dropping the name
>>>>> *apache* from solr jars. If that's what caused this issue, then can you
>>>>> tell me if the mirrors need updating with solr-core.jar instead of
>>>>> apache-solr-core.jar?
>>>> 
>>>> If it's named apache-solr-core, then it's from 4.0 or earlier.  If it's
>>>> named solr-core, then it's from 4.1 or later.  That might mean that you
>>>> are mixing versions - don't do that.  Make sure that you have jars from
>>>> the exact same version as your server.
>>>> 
>>>> Thanks,
>>>> Shawn
>>>> 
>>>> 
>> 
>> 


Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Sandeep Mestry <sa...@gmail.com>.
Hi Steve,

Solr 4.0 - mentioned in the subject.. :-)

Thanks,
Sandeep


On 21 May 2013 14:58, Steve Rowe <sa...@gmail.com> wrote:

> Sandeep,
>
> What version of Solr are you using?
>
> Steve
>
> On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com> wrote:
>
> > Hi Shawn,
> >
> > Thanks for your reply.
> >
> > I'm not mixing versions.
> > The problem I faced is I want to override Highlighter from solr-core jar
> > and if I add that as a dependency in my project then there was a clash
> > between solr-core.jar and the apache-solr-core.jar that comes bundled
> > within the solr distribution. It was complaining about
> MorfologikFilterFactory
> > classcastexception.
> > I can't use apache-solr-core.jar as a dependency as no such jar exists in
> > any maven repo.
> >
> > The only thing I could do is to remove apache-solr-core.jar from solr.war
> > and then use solr-core.jar as a dependency - however I do not think this
> is
> > the ideal solution.
> >
> > Thanks,
> > Sandeep
> >
> >
> > On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
> >
> >> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
> >>> And I do remember the discussion on the forum about dropping the name
> >>> *apache* from solr jars. If that's what caused this issue, then can you
> >>> tell me if the mirrors need updating with solr-core.jar instead of
> >>> apache-solr-core.jar?
> >>
> >> If it's named apache-solr-core, then it's from 4.0 or earlier.  If it's
> >> named solr-core, then it's from 4.1 or later.  That might mean that you
> >> are mixing versions - don't do that.  Make sure that you have jars from
> >> the exact same version as your server.
> >>
> >> Thanks,
> >> Shawn
> >>
> >>
>
>

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Steve Rowe <sa...@gmail.com>.
Sandeep,

What version of Solr are you using?

Steve

On May 21, 2013, at 6:55 AM, Sandeep Mestry <sa...@gmail.com> wrote:

> Hi Shawn,
> 
> Thanks for your reply.
> 
> I'm not mixing versions.
> The problem I faced is I want to override Highlighter from solr-core jar
> and if I add that as a dependency in my project then there was a clash
> between solr-core.jar and the apache-solr-core.jar that comes bundled
> within the solr distribution. It was complaining about MorfologikFilterFactory
> classcastexception.
> I can't use apache-solr-core.jar as a dependency as no such jar exists in
> any maven repo.
> 
> The only thing I could do is to remove apache-solr-core.jar from solr.war
> and then use solr-core.jar as a dependency - however I do not think this is
> the ideal solution.
> 
> Thanks,
> Sandeep
> 
> 
> On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:
> 
>> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
>>> And I do remember the discussion on the forum about dropping the name
>>> *apache* from solr jars. If that's what caused this issue, then can you
>>> tell me if the mirrors need updating with solr-core.jar instead of
>>> apache-solr-core.jar?
>> 
>> If it's named apache-solr-core, then it's from 4.0 or earlier.  If it's
>> named solr-core, then it's from 4.1 or later.  That might mean that you
>> are mixing versions - don't do that.  Make sure that you have jars from
>> the exact same version as your server.
>> 
>> Thanks,
>> Shawn
>> 
>> 


Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/21/2013 4:55 AM, Sandeep Mestry wrote:
> I'm not mixing versions.
> The problem I faced is I want to override Highlighter from solr-core jar
> and if I add that as a dependency in my project then there was a clash
> between solr-core.jar and the apache-solr-core.jar that comes bundled
> within the solr distribution. It was complaining about MorfologikFilterFactory
> classcastexception.
> I can't use apache-solr-core.jar as a dependency as no such jar exists in
> any maven repo.
> 
> The only thing I could do is to remove apache-solr-core.jar from solr.war
> and then use solr-core.jar as a dependency - however I do not think this is
> the ideal solution.

You'll need to have the solr core jar available for *compiling* your
code, but when you actually go to use your code with Solr, you don't
need to include the core jar, because it's already in Solr.

Thanks,
Shawn


Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Sandeep Mestry <sa...@gmail.com>.
Hi Shawn,

Thanks for your reply.

I'm not mixing versions.
The problem I faced is I want to override Highlighter from solr-core jar
and if I add that as a dependency in my project then there was a clash
between solr-core.jar and the apache-solr-core.jar that comes bundled
within the solr distribution. It was complaining about MorfologikFilterFactory
classcastexception.
I can't use apache-solr-core.jar as a dependency as no such jar exists in
any maven repo.

The only thing I could do is to remove apache-solr-core.jar from solr.war
and then use solr-core.jar as a dependency - however I do not think this is
the ideal solution.

Thanks,
Sandeep


On 20 May 2013 15:18, Shawn Heisey <so...@elyograg.org> wrote:

> On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
> > And I do remember the discussion on the forum about dropping the name
> > *apache* from solr jars. If that's what caused this issue, then can you
> > tell me if the mirrors need updating with solr-core.jar instead of
> > apache-solr-core.jar?
>
> If it's named apache-solr-core, then it's from 4.0 or earlier.  If it's
> named solr-core, then it's from 4.1 or later.  That might mean that you
> are mixing versions - don't do that.  Make sure that you have jars from
> the exact same version as your server.
>
> Thanks,
> Shawn
>
>

Re: Solr 4.0 war startup issue - apache-solr-core.jar Vs solr-core

Posted by Shawn Heisey <so...@elyograg.org>.
On 5/20/2013 8:01 AM, Sandeep Mestry wrote:
> And I do remember the discussion on the forum about dropping the name
> *apache* from solr jars. If that's what caused this issue, then can you
> tell me if the mirrors need updating with solr-core.jar instead of
> apache-solr-core.jar?

If it's named apache-solr-core, then it's from 4.0 or earlier.  If it's
named solr-core, then it's from 4.1 or later.  That might mean that you
are mixing versions - don't do that.  Make sure that you have jars from
the exact same version as your server.

Thanks,
Shawn