I have nearly the same problem as this:
However, in my case, I'm building a web app in Clojure, whereas my co-worker is building our Natural Language Processing engine in Java. The NLP is included as a jar. We had this working for a few weeks, but my co-worker has added some new dependencies that are now giving us this error.
This person also reports a similar error:
Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
See here: with an answer here:
The issue in both cases seems to be a version conflict in different libraries, but I have no idea how to resolve this. In the Clojure app we use clj-time, which apparently uses Joda-Time 2.6, whereas the Stanford Core NLP libraries seem to use Joda 2.1. Is there anyway to resolve that conflict?
Both pieces of software compile, and the Clojure app can start, with the NLP engine included. However, the Clojure app then calls a "start" method in the NLP engine, which causes the NLP engine to load the lexers and parsers that it needs. We then get these messages and errors:
Loading classifier from /home/safflower/apricots/dependencies/english.muc.7class.caseless.distsim.crf.ser.gz ... done [1.5 sec].
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz ... done [0.3 sec].
Loading parser from serialized file edu/stanford/nlp/models/lexparser/englishPCFG.caseless.ser.gz ... done [1.1 sec].
Adding annotator tokenize
TokenizerAnnotator: No tokenizer type provided. Defaulting to PTBTokenizer.
Adding annotator ssplit
Adding annotator pos
Reading POS tagger model from edu/stanford/nlp/models/pos-tagger/english-left3words/english-left3words-distsim.tagger ... done [1.9 sec].
Adding annotator lemma
Adding annotator ner
Loading classifier from /home/safflower/apricots/dependencies/english.all.7class.distsim.crf.ser.gz ... done [1.5 sec].
Initializing JollyDayHoliday for SUTime from classpath: edu/stanford/nlp/models/sutime/jollyday/Holidays_sutime.xml as sutime.binder.1.
#<ReflectionLoadingException edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl>
Exception in start/start: edu.stanford.nlp.util.ReflectionLoading$ReflectionLoadingException: Error creating edu.stanford.nlp.time.TimeExpressionExtractorImpl
If I do this in the Java app:
mvn dependency:tree
I see this:
[INFO] | +- joda-time:joda-time:jar:2.1:compile
[INFO] | \- javax.xml.bind:jaxb-api:jar:2.2.7:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile
[INFO] +- junit:junit:jar:3.8.1:test
[INFO] +- net.sf.supercsv:super-csv:jar:2.0.0-beta-1:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.0:compile
[INFO] \- edu.stanford.nlp:stanford-corenlp:jar:3.5.2:compile
[INFO] +- com.io7m.xom:xom:jar:1.2.10:compile
[INFO] | +- xml-apis:xml-apis:jar:1.3.03:compile
[INFO] | +- xerces:xercesImpl:jar:2.8.0:compile
[INFO] | \- xalan:xalan:jar:2.7.0:compile
[INFO] +- com.googlecode.efficient-java-matrix-library:ejml:jar:0.23:compile
[INFO] \- javax.json:javax.json-api:jar:1.0:compile
If I do this in the Clojure app:
lein deps :tree
I see this:
Retrieving org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.pom from central
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.pom from clojars
Retrieving org/clojure/tools.nrepl/0.2.6/tools.nrepl-0.2.6.jar from central
Retrieving clojure-complete/clojure-complete/0.2.3/clojure-complete-0.2.3.jar from clojars
Possibly confusing dependencies found:
[slingshot "0.10.3"]
overrides
[clj-http "1.1.2"] -> [slingshot "0.12.2" :exclusions [org.clojure/clojure]]
Consider using these exclusions:
[clj-http "1.1.2" :exclusions [slingshot]]
[clj-time "0.6.0"]
overrides
[ring "1.4.0-RC1"] -> [ring/ring-jetty-adapter "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"]
and
[ring "1.4.0-RC1"] -> [ring/ring-devel "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"]
and
[ring "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"]
Consider using these exclusions:
[ring "1.4.0-RC1" :exclusions [clj-time]]
[ring "1.4.0-RC1" :exclusions [clj-time]]
[ring "1.4.0-RC1" :exclusions [clj-time]]
[org.clojure/tools.namespace "0.2.4"]
overrides
[ring "1.4.0-RC1"] -> [ring/ring-devel "1.4.0-RC1"] -> [ns-tracker "0.3.0"] -> [org.clojure/tools.namespace "0.2.10"]
Consider using these exclusions:
[ring "1.4.0-RC1" :exclusions [org.clojure/tools.namespace]]
[clj-stacktrace "0.2.7"]
overrides
[ring "1.4.0-RC1"] -> [ring/ring-devel "1.4.0-RC1"] -> [clj-stacktrace "0.2.8"]
Consider using these exclusions:
[ring "1.4.0-RC1" :exclusions [clj-stacktrace]]
[clj-time "0.6.0"] -> [joda-time "2.2"]
overrides
[ring "1.4.0-RC1"] -> [ring/ring-jetty-adapter "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"] -> [joda-time "2.6"]
and
[ring "1.4.0-RC1"] -> [ring/ring-devel "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"] -> [joda-time "2.6"]
and
[ring "1.4.0-RC1"] -> [ring/ring-core "1.4.0-RC1"] -> [clj-time "0.9.0"] -> [joda-time "2.6"]
Consider using these exclusions:
[ring "1.4.0-RC1" :exclusions [joda-time]]
[ring "1.4.0-RC1" :exclusions [joda-time]]
[ring "1.4.0-RC1" :exclusions [joda-time]]
[cheshire "5.5.0"]
[com.fasterxml.jackson.core/jackson-core "2.5.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.5.3"]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.5.3"]
[tigris "0.1.1"]
[clj-http "1.1.2"]
[com.cognitect/transit-clj "0.8.271" :exclusions [[org.clojure/clojure]]]
[com.cognitect/transit-java "0.8.287"]
[com.fasterxml.jackson.datatype/jackson-datatype-json-org "2.3.2"]
[com.fasterxml.jackson.core/jackson-databind "2.3.2"]
[com.fasterxml.jackson.core/jackson-annotations "2.3.0"]
[org.json/json "20090211"]
[org.apache.directory.studio/org.apache.commons.codec "1.8"]
[org.msgpack/msgpack "0.6.10"]
[com.googlecode.json-simple/json-simple "1.1.1" :exclusions [[junit]]]
[org.javassist/javassist "3.18.1-GA"]
[commons-codec "1.10" :exclusions [[org.clojure/clojure]]]
[commons-io "2.4" :exclusions [[org.clojure/clojure]]]
[crouton "0.1.2" :exclusions [[org.clojure/clojure]]]
[org.jsoup/jsoup "1.7.1"]
[org.apache.httpcomponents/httpclient "4.4.1" :exclusions [[org.clojure/clojure]]]
[commons-logging "1.2"]
[org.apache.httpcomponents/httpcore "4.4.1" :exclusions [[org.clojure/clojure]]]
[org.apache.httpcomponents/httpmime "4.4.1" :exclusions [[org.clojure/clojure]]]
[org.clojure/tools.reader "0.9.2" :exclusions [[org.clojure/clojure]]]
[potemkin "0.3.13" :exclusions [[org.clojure/clojure]]]
[clj-tuple "0.2.1"]
[clj-stacktrace "0.2.7"]
[clj-time "0.6.0"]
[joda-time "2.2"]
[clojure-complete "0.2.3" :scope "test" :exclusions [[org.clojure/clojure]]]
[com.novemberain/monger "2.0.1"]
[clojurewerkz/support "1.1.0"]
[com.google.guava/guava "18.0"]
[org.mongodb/mongo-java-driver "2.12.4"]
[com.taoensso/timbre "3.2.1"]
[com.taoensso/encore "1.5.1"]
[io.aviso/pretty "0.1.10"]
[compojure "1.3.4"]
[clout "2.1.2"]
[instaparse "1.4.0" :exclusions [[org.clojure/clojure]]]
[medley "0.6.0"]
[org.clojure/tools.macro "0.1.5"]
[ring/ring-codec "1.0.0"]
[dire "0.5.1"]
[robert/hooke "1.3.0"]
[local/nlp "1.0-SNAPSHOT"]
[manifold "0.1.0"]
[org.clojure/tools.logging "0.3.1"]
[riddley "0.1.9"]
[me.raynes/fs "1.4.4"]
[org.apache.commons/commons-compress "1.4"]
[org.tukaani/xz "1.0"]
[org.clojure/clojure "1.6.0"]
[org.clojure/core.cache "0.6.4"]
[org.clojure/data.priority-map "0.0.4"]
[org.clojure/core.incubator "0.1.3"]
[org.clojure/core.match "0.3.0-alpha4"]
[org.clojure/tools.analyzer.jvm "0.6.5"]
[org.clojure/core.memoize "0.5.6"]
[org.clojure/tools.analyzer "0.6.4"]
[org.ow2.asm/asm-all "4.2"]
[org.clojure/data.json "0.2.5"]
[org.clojure/tools.namespace "0.2.4"]
[org.clojure/tools.nrepl "0.2.6" :scope "test" :exclusions [[org.clojure/clojure]]]
[overtone/at-at "1.2.0"]
[ring/ring-json "0.3.1"]
[ring "1.4.0-RC1"]
[ring/ring-core "1.4.0-RC1"]
[commons-fileupload "1.3.1"]
[crypto-equality "1.0.0"]
[crypto-random "1.2.0"]
[ring/ring-devel "1.4.0-RC1"]
[hiccup "1.0.5"]
[ns-tracker "0.3.0"]
[org.clojure/java.classpath "0.2.2"]
[ring/ring-jetty-adapter "1.4.0-RC1"]
[org.eclipse.jetty/jetty-server "9.2.10.v20150310"]
[javax.servlet/javax.servlet-api "3.1.0"]
[org.eclipse.jetty/jetty-http "9.2.10.v20150310"]
[org.eclipse.jetty/jetty-util "9.2.10.v20150310"]
[org.eclipse.jetty/jetty-io "9.2.10.v20150310"]
[ring/ring-servlet "1.4.0-RC1"]
[slingshot "0.10.3"]
safflower@cloud-server-01:~/apricots$
[robert/hooke "1.3.0"]
[local/nlp "1.0-SNAPSHOT"]
[manifold "0.1.0"]
[org.clojure/tools.logging "0.3.1"]
[riddley "0.1.9"]
[me.raynes/fs "1.4.4"]
[org.apache.commons/commons-compress "1.4"]
[org.tukaani/xz "1.0"]
[org.clojure/clojure "1.6.0"]
[org.clojure/core.cache "0.6.4"]
[org.clojure/data.priority-map "0.0.4"]
[org.clojure/core.incubator "0.1.3"]
[org.clojure/core.match "0.3.0-alpha4"]
[org.clojure/tools.analyzer.jvm "0.6.5"]
[org.clojure/core.memoize "0.5.6"]
[org.clojure/tools.analyzer "0.6.4"]
[org.ow2.asm/asm-all "4.2"]
[org.clojure/data.json "0.2.5"]
[org.clojure/tools.namespace "0.2.4"]
[org.clojure/tools.nrepl "0.2.6" :scope "test" :exclusions [[org.clojure/clojure]]]
[overtone/at-at "1.2.0"]
[ring/ring-json "0.3.1"]
[ring "1.4.0-RC1"]
[ring/ring-core "1.4.0-RC1"]
[commons-fileupload "1.3.1"]
[crypto-equality "1.0.0"]
[crypto-random "1.2.0"]
[ring/ring-devel "1.4.0-RC1"]
[hiccup "1.0.5"]
[ns-tracker "0.3.0"]
[org.clojure/java.classpath "0.2.2"]
[ring/ring-jetty-adapter "1.4.0-RC1"]
[org.eclipse.jetty/jetty-server "9.2.10.v20150310"]
[javax.servlet/javax.servlet-api "3.1.0"]
[org.eclipse.jetty/jetty-http "9.2.10.v20150310"]
[org.eclipse.jetty/jetty-util "9.2.10.v20150310"]
[org.eclipse.jetty/jetty-io "9.2.10.v20150310"]
[ring/ring-servlet "1.4.0-RC1"]
[slingshot "0.10.3"]
How would I resolve a potential version conflict?
This is the project.clj file that I have:
(defproject oyster "0.1"
:dependencies [[org.clojure/clojure "1.6.0"]
[com.taoensso/timbre "3.2.1"]
[dire "0.5.1"]
[slingshot "0.10.3"]
[ring "1.4.0-RC1"]
[clj-time "0.6.0"]
[org.clojure/data.json "0.2.5"]
[compojure "1.3.4"]
[com.novemberain/monger "2.0.1"]
[org.clojure/tools.namespace "0.2.4"]
[manifold "0.1.0"]
[me.raynes/fs "1.4.4"]
[org.clojure/core.incubator "0.1.3"]
[clj-stacktrace "0.2.7"]
[overtone/at-at "1.2.0"]
[ring/ring-json "0.3.1"]
[clj-http "1.1.2"]
[org.clojure/core.cache "0.6.4"]
[cheshire "5.5.0"]
[org.clojure/core.match "0.3.0-alpha4"]
[local/nlp "1.0-SNAPSHOT"]]
:repositories {"local" ~(str (.toURI (java.io.File. "maven_repository")))}
:disable-implicit-clean true
;; :warn-on-reflection true
:source-paths ["src/clojure"]
:java-source-paths ["src/java"]
:main oyster.core
:aot :all
:jvm-opts ["-Xms100m" "-Xmx1000m" "-XX:-UseCompressedOops"])
Including your project.clj would help to find the problem. You probably need to use the :exclusions option in the :dependencies section of project.clj
From https://github.com/technomancy/leiningen/blob/master/sample.project.clj
In one of my projects, I have a problem similar to yours and I need this line: