0

I have a problem with CoreNLP using in JBoss Fuse ESB. I installed CoreNLP with it's models on ESB by

install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0//models-english

Then, when my module tries to use models-english I have error log message

Caused by: java.io.IOException: Unable to open "edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger" as class path, filename or URL
    at edu.stanford.nlp.io.IOUtils.getInputStreamFromURLOrClasspathOrFileSystem(IOUtils.java:485)[275:org.opengravity.camel.nlp:1.0.0.SNAPSHOT]
    at edu.stanford.nlp.tagger.maxent.MaxentTagger.readModelAndInit(MaxentTagger.java:765)[275:org.opengravity.camel.nlp:1.0.0.SNAPSHOT]
    ... 69 more

I tried to solve this problem by maven-bundle-plugin configurations

<Embed-Dependency>stanford-corenlp</Embed-Dependency>

but unfortunately it didn't help.

MrFroll
  • 146
  • 1
  • 7
  • Not all JARs are OSGi compliant. Especially if they try to load resources from the classpath. You can try to enable dynamic import on the bundles by running `dev:dynamic-import XXX` where XXX is the bundle id. – Claus Ibsen Sep 06 '16 at 07:40
  • Thank you, Claus. It solved my problem. – MrFroll Sep 11 '16 at 18:45

1 Answers1

0

First of all I install two modules

install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0
install wrap:mvn:edu.stanford.nlp/stanford-corenlp/3.6.0//models-english

and then, as it was advised by Claus Ibsen, I enabled dynamic import on the first bundle dev:dynamic-import XXX where XXX is the stanford-corenlp-3.6.0 bundle id. It solved my problem.

MrFroll
  • 146
  • 1
  • 7