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 Ryan Yacyshyn <ry...@gmail.com> on 2018/04/08 08:36:36 UTC

Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Hi all,

I'm running into a small problem loading
the OpenNLPExtractNamedEntitiesUpdateProcessorFactory class, getting an
error saying it's not found. I'm loading all the required jar files,
according to the readme:

*solrconfig.xml*

  <lib
dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lucene-libs"
regex="lucene-analyzers-opennlp-.*\.jar" />
  <lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib"
regex="opennlp-.*\.jar" />

  ...

  <updateRequestProcessorChain name="multiple-extract">
    <processor
class="solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory">
      <str name="modelFile">en-ner-person.bin</str>
      <str name="analyzerFieldType">opennlp-en-tokenization</str>
      <str name="source">text</str>
      <str name="dest">people_ss</str>
    </processor>
  </updateRequestProcessorChain>

*managed-schema*

  <fieldType name="opennlp-en-tokenization" class="solr.TextField">
    <analyzer>
      <tokenizer class="solr.OpenNLPTokenizerFactory"
sentenceModel="en-sent.bin" tokenizerModel="en-token.bin"/>
    </analyzer>
  </fieldType>

I have the three *.bin files in my conf directory, but when I try to reload
with this config I get this error:

```
{
  "responseHeader": {
    "status": 500,
    "QTime": 390
  },
  "error": {
    "metadata": [
      "error-class",
      "org.apache.solr.common.SolrException",
      "root-error-class",
      "java.lang.ClassNotFoundException"
    ],
    "msg": "Error handling 'reload' action",
    "trace": "org.apache.solr.common.SolrException: Error handling 'reload'
action\n\tat
org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$2(CoreAdminOperation.java:112)\n\tat
org.apache.solr.handler.admin.CoreAdminOperation$$Lambda$103/335708295.execute(Unknown
Source)\n\tat
org.apache.solr.handler.admin.CoreAdminOperation.execute(CoreAdminOperation.java:358)\n\tat
org.apache.solr.handler.admin.CoreAdminHandler$CallInfo.call(CoreAdminHandler.java:389)\n\tat
org.apache.solr.handler.admin.CoreAdminHandler.handleRequestBody(CoreAdminHandler.java:174)\n\tat
org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:195)\n\tat
org.apache.solr.servlet.HttpSolrCall.handleAdmin(HttpSolrCall.java:736)\n\tat
org.apache.solr.servlet.HttpSolrCall.handleAdminRequest(HttpSolrCall.java:717)\n\tat
org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:498)\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:384)\n\tat
org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:330)\n\tat
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1629)\n\tat
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat
org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:190)\n\tat
org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)\n\tat
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)\n\tat
org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)\n\tat
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)\n\tat
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219)\n\tat
org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335)\n\tat
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)\n\tat
org.eclipse.jetty.server.Server.handle(Server.java:530)\n\tat
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:347)\n\tat
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:256)\n\tat
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)\n\tat
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)\n\tat
org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:247)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.produce(EatWhatYouKill.java:140)\n\tat
org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)\n\tat
org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:382)\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:708)\n\tat
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:626)\n\tat
java.lang.Thread.run(Thread.java:745)\nCaused by:
org.apache.solr.common.SolrException: Unable to reload core [nlp]\n\tat
org.apache.solr.core.CoreContainer.reload(CoreContainer.java:1311)\n\tat
org.apache.solr.handler.admin.CoreAdminOperation.lambda$static$2(CoreAdminOperation.java:110)\n\t...
43 more\nCaused by: org.apache.solr.common.SolrException: Error loading
class 'solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory'\n\tat
org.apache.solr.core.SolrCore.<init>(SolrCore.java:1008)\n\tat
org.apache.solr.core.SolrCore.reload(SolrCore.java:656)\n\tat
org.apache.solr.core.CoreContainer.reload(CoreContainer.java:1290)\n\t...
44 more\nCaused by: org.apache.solr.common.SolrException: Error loading
class 'solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory'\n\tat
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:557)\n\tat
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:488)\n\tat
org.apache.solr.core.SolrCore.createInstance(SolrCore.java:786)\n\tat
org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:842)\n\tat
org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2749)\n\tat
org.apache.solr.update.processor.UpdateRequestProcessorChain.init(UpdateRequestProcessorChain.java:129)\n\tat
org.apache.solr.core.SolrCore.createInitInstance(SolrCore.java:844)\n\tat
org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2724)\n\tat
org.apache.solr.core.SolrCore.initPlugins(SolrCore.java:2718)\n\tat
org.apache.solr.core.SolrCore.loadUpdateProcessorChains(SolrCore.java:1420)\n\tat
org.apache.solr.core.SolrCore.<init>(SolrCore.java:964)\n\t... 46
more\nCaused by: java.lang.ClassNotFoundException:
solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory\n\tat
java.net.URLClassLoader.findClass(URLClassLoader.java:381)\n\tat
java.lang.ClassLoader.loadClass(ClassLoader.java:424)\n\tat
java.net.FactoryURLClassLoader.loadClass(URLClassLoader.java:810)\n\tat
java.lang.ClassLoader.loadClass(ClassLoader.java:357)\n\tat
java.lang.Class.forName0(Native Method)\n\tat
java.lang.Class.forName(Class.java:348)\n\tat
org.apache.solr.core.SolrResourceLoader.findClass(SolrResourceLoader.java:541)\n\t...
56 more\n",
    "code": 500
  }
}
```
Any idea what I might be doing wrong?

Thanks!
Ryan

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Ryan Yacyshyn <ry...@gmail.com>.
Hi,

The readme found in '/contrib/analysis-extras' mentions: OpenNLP relies on
lucene-libs/lucene-analyzers-opennlp-X.Y.jar and lib/opennlp-*.jar

Make sure you are loading these as well as the
'solr-analysis-extras-7.3.0.jar' file in the /dist directory.

Regards,
Ryan



On Mon, 16 Apr 2018 at 23:53 Erick Erickson <er...@gmail.com> wrote:

> Have you tried starting Solr with the "-v" option? That will show you
> exactly (in the solr.log file) where every jar is loaded from. Make
> sure you are
> 1> loading the jar at all
> 2> loading the jar you think you are (i.e. not loading an old version
> from somewhere on your classpath).
>
> Copying jar files around is often a source of user error, you can wind
> up loading them from someplace unexpected..
>
> Best,
> Erick
>
> On Mon, Apr 16, 2018 at 2:58 AM, Fatalityap <al...@gmail.com>
> wrote:
> > Hi, can you post final solution how you solve this problem?
> >
> > I have copied solr-analysis-extras-7.3.0.jar to
> /contrib/analysis-extras/lib
> > folder and loaded it like this:
> >
> > /<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib"
> > regex=".*\.jar" /> /
> >
> > but error have not gone...
> >
> > I still see:
> >
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> > Error loading class
> 'solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory'
> >
> >
> >
> > --
> > Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html
>

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Erick Erickson <er...@gmail.com>.
Have you tried starting Solr with the "-v" option? That will show you
exactly (in the solr.log file) where every jar is loaded from. Make
sure you are
1> loading the jar at all
2> loading the jar you think you are (i.e. not loading an old version
from somewhere on your classpath).

Copying jar files around is often a source of user error, you can wind
up loading them from someplace unexpected..

Best,
Erick

On Mon, Apr 16, 2018 at 2:58 AM, Fatalityap <al...@gmail.com> wrote:
> Hi, can you post final solution how you solve this problem?
>
> I have copied solr-analysis-extras-7.3.0.jar to /contrib/analysis-extras/lib
> folder and loaded it like this:
>
> /<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib"
> regex=".*\.jar" /> /
>
> but error have not gone...
>
> I still see:
> org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
> Error loading class 'solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory'
>
>
>
> --
> Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Fatalityap <al...@gmail.com>.
Hi, can you post final solution how you solve this problem? 

I have copied solr-analysis-extras-7.3.0.jar to /contrib/analysis-extras/lib
folder and loaded it like this: 

/<lib dir="${solr.install.dir:../../../..}/contrib/analysis-extras/lib"
regex=".*\.jar" /> /

but error have not gone... 

I still see: 
org.apache.solr.common.SolrException:org.apache.solr.common.SolrException:
Error loading class 'solr.OpenNLPExtractNamedEntitiesUpdateProcessorFactory'



--
Sent from: http://lucene.472066.n3.nabble.com/Solr-User-f472068.html

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Ryan Yacyshyn <ry...@gmail.com>.
Hi,

I found the problem: there was an additional jar file in the /dist folder
that needed to be loaded as well (dist/solr-analysis-extras-7.3.0.jar). I
didn't see this one.

Thanks,
Ryan



On Mon, 9 Apr 2018 at 14:58 Ryan Yacyshyn <ry...@gmail.com> wrote:

> Hi Shawn,
>
> I'm pretty sure the paths to load the jars in analysis-extras is correct,
> the jars in /contrib/analysis-extras/lib load fine. I verified this by
> changing the name of solr.OpenNLPTokenizerFactory to solr.OpenNLPTokenizerFactory2
> and saw the new error. Changing it back to solr.OpenNLPTokenizerFactory
> (without the "2") doesn't throw any errors, so I'm assuming these two
> jar files (opennlp-maxent-3.0.3.jar and opennlp-tools-1.8.3.jar) must be
> loading.
>
> I tried swapping the order in which these jars are loaded as well, but no
> luck there.
>
> I have attached my solr.log file after a restart. Also included is my
> solrconfig.xml and managed-schema. The path to my config
> is /Users/ryan/solr-7.3.0/server/solr/nlp/conf and this is where I have the
> OpenNLP bin files (en-ner-person.bin, en-sent.bin, and en-token.bin).
> Configs are derived from the _default configset.
>
> On a mac, and my Java version is:
>
> java version "1.8.0_45"
> Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
> Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
>
> Thanks,
> Ryan
>
>
>
> On Sun, 8 Apr 2018 at 21:34 Shawn Heisey <ap...@elyograg.org> wrote:
>
>> On 4/8/2018 2:36 AM, Ryan Yacyshyn wrote:
>> > I'm running into a small problem loading
>> > the OpenNLPExtractNamedEntitiesUpdateProcessorFactory class, getting an
>> > error saying it's not found. I'm loading all the required jar files,
>> > according to the readme:
>>
>> You've got a <lib> element to load analysis-extras jars, but are you
>> certain it's actually loading anything?
>>
>> Can you share a solr.log file created just after a Solr restart?  Not
>> just a reload -- I'm asking for a restart so the log is more complete.
>> With that, I can see what's happening and then ask more questions that
>> may pinpoint something.
>>
>> Thanks,
>> Shawn
>>
>>

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Ryan Yacyshyn <ry...@gmail.com>.
Hi Shawn,

I'm pretty sure the paths to load the jars in analysis-extras is correct,
the jars in /contrib/analysis-extras/lib load fine. I verified this by
changing the name of solr.OpenNLPTokenizerFactory to
solr.OpenNLPTokenizerFactory2
and saw the new error. Changing it back to solr.OpenNLPTokenizerFactory
(without the "2") doesn't throw any errors, so I'm assuming these two
jar files (opennlp-maxent-3.0.3.jar and opennlp-tools-1.8.3.jar) must be
loading.

I tried swapping the order in which these jars are loaded as well, but no
luck there.

I have attached my solr.log file after a restart. Also included is my
solrconfig.xml and managed-schema. The path to my config
is /Users/ryan/solr-7.3.0/server/solr/nlp/conf and this is where I have the
OpenNLP bin files (en-ner-person.bin, en-sent.bin, and en-token.bin).
Configs are derived from the _default configset.

On a mac, and my Java version is:

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Thanks,
Ryan



On Sun, 8 Apr 2018 at 21:34 Shawn Heisey <ap...@elyograg.org> wrote:

> On 4/8/2018 2:36 AM, Ryan Yacyshyn wrote:
> > I'm running into a small problem loading
> > the OpenNLPExtractNamedEntitiesUpdateProcessorFactory class, getting an
> > error saying it's not found. I'm loading all the required jar files,
> > according to the readme:
>
> You've got a <lib> element to load analysis-extras jars, but are you
> certain it's actually loading anything?
>
> Can you share a solr.log file created just after a Solr restart?  Not
> just a reload -- I'm asking for a restart so the log is more complete.
> With that, I can see what's happening and then ask more questions that
> may pinpoint something.
>
> Thanks,
> Shawn
>
>

Re: Solr 7.3.0 loading OpenNLPExtractNamedEntitiesUpdateProcessorFactory

Posted by Shawn Heisey <ap...@elyograg.org>.
On 4/8/2018 2:36 AM, Ryan Yacyshyn wrote:
> I'm running into a small problem loading
> the OpenNLPExtractNamedEntitiesUpdateProcessorFactory class, getting an
> error saying it's not found. I'm loading all the required jar files,
> according to the readme:

You've got a <lib> element to load analysis-extras jars, but are you 
certain it's actually loading anything?

Can you share a solr.log file created just after a Solr restart?  Not 
just a reload -- I'm asking for a restart so the log is more complete.  
With that, I can see what's happening and then ask more questions that 
may pinpoint something.

Thanks,
Shawn