2016-12-24 1 views
4

Есть много вопросов, подобных этому, где люди получают ошибку как следующий, когда они используют библиотеку SentimentAnalysis в StanfordNLP:Stanford CoreNLP не может найти правильную версию ejml при развертывании в молах приложении

java.io.InvalidClassException: org.ejml.simple.SimpleBase; local class incompatible: stream classdesc serialVersionUID = 7560584869544985034, local class serialVersionUID = -5535333403571293496 
at edu.stanford.nlp.sentiment.SentimentModel.loadSerialized(SentimentModel.java:629) 
at edu.stanford.nlp.pipeline.SentimentAnnotator.<init>(SentimentAnnotator.java:54) 
at edu.stanford.nlp.pipeline.AnnotatorImplementations.sentiment(AnnotatorImplementations.java:241) 
at edu.stanford.nlp.pipeline.AnnotatorFactories$16.create(AnnotatorFactories.java:571) 
at edu.stanford.nlp.pipeline.AnnotatorPool.get(AnnotatorPool.java:85) 
at edu.stanford.nlp.pipeline.StanfordCoreNLP.construct(StanfordCoreNLP.java:375) 
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:139) 
at edu.stanford.nlp.pipeline.StanfordCoreNLP.<init>(StanfordCoreNLP.java:135) 
at com.ccri.crusher.slotfiller.SentimentAnalyzer$.<init>(SentimentSayer.scala:31) 
at com.ccri.crusher.slotfiller.SentimentAnalyzer$.<clinit>(SentimentSayer.scala) 

И то люди говорят им, чтобы добавить эту ejml (матрица библиотеки от Google), чтобы их пути к классам: scala error acessing stanford corenlp sentiment - local class incompatible

Вот еще один подобный вопрос: Getting the error while integrating stanford sentiment analysis with java

Это даже ответ ed on in github issues: https://github.com/stanfordnlp/CoreNLP/issues/8

Но я не получаю это сообщение об ошибке при компиляции и не получаю его при открытии консоли mvn: scala. Он работает блестяще тогда.

Я получаю сообщение об ошибке после запуска веб-сервера mvn: причал и доступа к этому классу.

Я попытался добавить зависимость во многих местах моего проекта, включая pom родительского уровня и pom уровня модуля, и как зависимость от плагина mvn jetty, все с тем же результатом. Это зависимость я добавляю:

<!-- https://mvnrepository.com/artifact/com.googlecode.efficient-java-matrix-library/ejml --> 
<dependency> 
    <groupId>com.googlecode.efficient-java-matrix-library</groupId> 
    <artifactId>ejml</artifactId> 
    <version>0.23</version> 
</dependency> 

Что та же версия, что моя версия Стэнфордского CoreNLP запущена (либо 3,6 или 3,7 (составитель от источника)).

Я подозреваю, что у причала есть своя версия «ejml», и это заставляет это на Стэнфорде вместо использования версии 0.23 из ejml, как я указывал выше.

Я пробовал несколько версий как Stanford, так и ejml без успеха.

Обновление: после того, как вы попробовали так много разных версий Stanford и ejml, и, увидев, что потоки с локальными версиями немного не меняются, я убежден, что проблемы там нет. Возможно, что-то в версии scala/java отличается от моего .war vs my .jar?

Update2: дерево зависимостей для войны (когда я использовал ejml .21): МВН

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building crusher-war 1.1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ crusher-war --- 
[INFO] com.ccri.crusher:crusher-war:war:1.1.0-SNAPSHOT 
[INFO] +- com.ccri.commons:commons-scalatra_2.11:jar:1.1:compile 
[INFO] | +- org.scalatra:scalatra_2.11:jar:2.3.0:compile 
[INFO] | | +- org.scalatra:scalatra-common_2.11:jar:2.3.0:compile 
[INFO] | | +- org.slf4j:slf4j-api:jar:1.7.5:compile 
[INFO] | | +- org.clapper:grizzled-slf4j_2.11:jar:1.0.2:compile 
[INFO] | | +- org.scalatra.rl:rl_2.11:jar:0.4.10:compile 
[INFO] | | +- com.googlecode.juniversalchardet:juniversalchardet:jar:1.0.3:compile 
[INFO] | | +- eu.medsea.mimeutil:mime-util:jar:2.1.3:compile 
[INFO] | | +- joda-time:joda-time:jar:2.3:compile 
[INFO] | | +- org.joda:joda-convert:jar:1.6:compile 
[INFO] | | +- org.scala-lang.modules:scala-parser-combinators_2.11:jar:1.0.1:compile 
[INFO] | | \- org.scala-lang.modules:scala-xml_2.11:jar:1.0.2:compile 
[INFO] | +- org.json4s:json4s-jackson_2.11:jar:3.2.10:compile 
[INFO] | | +- org.json4s:json4s-core_2.11:jar:3.2.10:compile 
[INFO] | | | +- com.thoughtworks.paranamer:paranamer:jar:2.6:compile 
[INFO] | | | \- org.scala-lang:scalap:jar:2.11.0:compile 
[INFO] | | \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.1:compile 
[INFO] | |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.0:compile 
[INFO] | |  \- com.fasterxml.jackson.core:jackson-core:jar:2.3.1:compile 
[INFO] | +- org.scalatra:scalatra-json_2.11:jar:2.3.0:compile 
[INFO] | +- org.scalatra:scalatra-scalate_2.11:jar:2.3.0:compile 
[INFO] | | \- org.scalatra.scalate:scalate-core_2.11:jar:1.7.0:compile 
[INFO] | |  +- org.scalatra.scalate:scalate-util_2.11:jar:1.7.0:compile 
[INFO] | |  \- org.scala-lang:scala-compiler:jar:2.11.0:compile 
[INFO] | +- org.springframework:spring-web:jar:3.1.4.RELEASE:compile 
[INFO] | | +- aopalliance:aopalliance:jar:1.0:compile 
[INFO] | | +- org.springframework:spring-aop:jar:3.1.4.RELEASE:compile 
[INFO] | | | \- org.springframework:spring-asm:jar:3.1.4.RELEASE:compile 
[INFO] | | +- org.springframework:spring-beans:jar:3.1.4.RELEASE:compile 
[INFO] | | +- org.springframework:spring-context:jar:3.1.4.RELEASE:compile 
[INFO] | | | \- org.springframework:spring-expression:jar:3.1.4.RELEASE:compile 
[INFO] | | \- org.springframework:spring-core:jar:3.1.4.RELEASE:compile 
[INFO] | |  \- commons-logging:commons-logging:jar:1.1.1:compile 
[INFO] | \- com.typesafe.scala-logging:scala-logging_2.11:jar:3.1.0:compile 
[INFO] |  \- org.scala-lang:scala-reflect:jar:2.11.1:compile 
[INFO] +- com.ccri.dragonfish:meta-web-utils:jar:1.7.1:compile 
[INFO] | +- com.ccri.dragonfish:sparql-utils:jar:1.7.1:compile 
[INFO] | | +- org.openrdf.sesame:sesame-query:jar:2.7.6:compile 
[INFO] | | | \- org.openrdf.sesame:sesame-rio-api:jar:2.7.6:compile 
[INFO] | | +- com.ccri.commons:sparql-endpoint_2.11:jar:1.1.4:compile 
[INFO] | | +- org.apache.rya:rya.api:jar:3.2.10-ccri:compile 
[INFO] | | | +- org.calrissian.mango:mango-core:jar:1.2.0:compile 
[INFO] | | | | \- commons-net:commons-net:jar:3.3:compile 
[INFO] | | | +- org.openrdf.sesame:sesame-queryalgebra-model:jar:2.7.6:compile 
[INFO] | | | +- org.openrdf.sesame:sesame-queryalgebra-evaluation:jar:2.7.6:compile 
[INFO] | | | | +- org.openrdf.sesame:sesame-repository-sparql:jar:2.7.6:compile 
[INFO] | | | | | +- org.openrdf.sesame:sesame-repository-api:jar:2.7.6:compile 
[INFO] | | | | | +- org.openrdf.sesame:sesame-queryparser-api:jar:2.7.6:compile 
[INFO] | | | | | +- org.openrdf.sesame:sesame-queryparser-sparql:jar:2.7.6:compile 
[INFO] | | | | | \- org.openrdf.sesame:sesame-queryresultio-sparqlxml:jar:2.7.6:compile 
[INFO] | | | | \- org.openrdf.sesame:sesame-http-client:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-http-protocol:jar:2.7.6:compile 
[INFO] | | | |  \- org.openrdf.sesame:sesame-queryresultio-api:jar:2.7.6:compile 
[INFO] | | | +- com.google.guava:guava:jar:18.0:compile 
[INFO] | | | \- org.apache.hadoop:hadoop-common:jar:2.5.2:compile 
[INFO] | | |  +- org.apache.hadoop:hadoop-annotations:jar:2.5.2:compile 
[INFO] | | |  | \- jdk.tools:jdk.tools:jar:1.6:system 
[INFO] | | |  +- xmlenc:xmlenc:jar:0.52:compile 
[INFO] | | |  +- commons-httpclient:commons-httpclient:jar:3.1:compile 
[INFO] | | |  +- javax.servlet:servlet-api:jar:2.5:compile 
[INFO] | | |  +- org.mortbay.jetty:jetty:jar:6.1.26:compile 
[INFO] | | |  +- org.mortbay.jetty:jetty-util:jar:6.1.26:compile 
[INFO] | | |  +- com.sun.jersey:jersey-core:jar:1.9:compile 
[INFO] | | |  +- com.sun.jersey:jersey-json:jar:1.9:compile 
[INFO] | | |  | +- org.codehaus.jettison:jettison:jar:1.1:compile 
[INFO] | | |  | +- com.sun.xml.bind:jaxb-impl:jar:2.2.3-1:compile 
[INFO] | | |  | +- org.codehaus.jackson:jackson-jaxrs:jar:1.8.3:compile 
[INFO] | | |  | \- org.codehaus.jackson:jackson-xc:jar:1.8.3:compile 
[INFO] | | |  +- com.sun.jersey:jersey-server:jar:1.9:compile 
[INFO] | | |  | \- asm:asm:jar:3.1:compile 
[INFO] | | |  +- tomcat:jasper-compiler:jar:5.5.23:runtime 
[INFO] | | |  +- tomcat:jasper-runtime:jar:5.5.23:runtime 
[INFO] | | |  +- javax.servlet.jsp:jsp-api:jar:2.1:runtime 
[INFO] | | |  +- commons-el:commons-el:jar:1.0:runtime 
[INFO] | | |  +- net.java.dev.jets3t:jets3t:jar:0.9.0:compile 
[INFO] | | |  | \- com.jamesmurty.utils:java-xmlbuilder:jar:0.4:compile 
[INFO] | | |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.13:compile 
[INFO] | | |  +- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.13:compile 
[INFO] | | |  +- org.apache.avro:avro:jar:1.7.4:compile 
[INFO] | | |  | \- org.xerial.snappy:snappy-java:jar:1.0.4.1:compile 
[INFO] | | |  +- com.google.protobuf:protobuf-java:jar:2.5.0:compile 
[INFO] | | |  +- org.apache.hadoop:hadoop-auth:jar:2.5.2:compile 
[INFO] | | |  | \- org.apache.directory.server:apacheds-kerberos-codec:jar:2.0.0-M15:compile 
[INFO] | | |  |  +- org.apache.directory.server:apacheds-i18n:jar:2.0.0-M15:compile 
[INFO] | | |  |  +- org.apache.directory.api:api-asn1-api:jar:1.0.0-M20:compile 
[INFO] | | |  |  \- org.apache.directory.api:api-util:jar:1.0.0-M20:compile 
[INFO] | | |  +- com.jcraft:jsch:jar:0.1.42:compile 
[INFO] | | |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile 
[INFO] | | +- org.apache.rya:accumulo.rya:jar:3.2.10-ccri:compile 
[INFO] | | | +- org.openrdf.sesame:sesame-rio-ntriples:jar:2.7.6:compile 
[INFO] | | | \- org.openrdf.sesame:sesame-rio-nquads:jar:2.7.6:compile 
[INFO] | | +- org.apache.rya:rya.indexing:jar:3.2.10-ccri:compile 
[INFO] | | | +- org.apache.rya:rya.sail:jar:3.2.10-ccri:compile 
[INFO] | | | | +- org.apache.rya:rya.provenance:jar:3.2.10-ccri:compile 
[INFO] | | | | +- net.sf.ehcache:ehcache-core:jar:1.7.2:compile 
[INFO] | | | | +- com.tinkerpop.blueprints:blueprints-core:jar:2.5.0:compile 
[INFO] | | | | | +- com.fasterxml.jackson.datatype:jackson-datatype-json-org:jar:2.2.3:compile 
[INFO] | | | | | | \- org.json:json:jar:20090211:compile 
[INFO] | | | | | \- colt:colt:jar:1.2.0:compile 
[INFO] | | | | |  \- concurrent:concurrent:jar:1.3.4:compile 
[INFO] | | | | \- org.openrdf.sesame:sesame-runtime:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-repository-manager:jar:2.7.6:compile 
[INFO] | | | |  | \- org.openrdf.sesame:sesame-repository-event:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-repository-http:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-repository-contextaware:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-repository-sail:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-sail-api:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-sail-federation:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-queryparser-serql:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-queryresultio-binary:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-queryresultio-sparqljson:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-queryresultio-text:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-repository-dataset:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-rio-binary:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-rio-n3:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-rio-rdfjson:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-rio-rdfxml:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-rio-trix:jar:2.7.6:runtime 
[INFO] | | | |  +- org.openrdf.sesame:sesame-sail-inferencer:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-sail-memory:jar:2.7.6:compile 
[INFO] | | | |  +- org.openrdf.sesame:sesame-sail-nativerdf:jar:2.7.6:runtime 
[INFO] | | | |  \- org.openrdf.sesame:sesame-sail-rdbms:jar:2.7.6:runtime 
[INFO] | | | |  \- commons-dbcp:commons-dbcp:jar:1.3:runtime 
[INFO] | | | +- org.apache.rya:mongodb.rya:jar:3.2.10-ccri:compile 
[INFO] | | | | +- org.mongodb:mongo-java-driver:jar:2.13.3:compile 
[INFO] | | | | \- de.flapdoodle.embed:de.flapdoodle.embed.mongo:jar:1.50.0:compile 
[INFO] | | | |  \- de.flapdoodle.embed:de.flapdoodle.embed.process:jar:1.50.0:compile 
[INFO] | | | |  +- net.java.dev.jna:jna:jar:4.0.0:compile 
[INFO] | | | |  \- net.java.dev.jna:jna-platform:jar:4.0.0:compile 
[INFO] | | | +- org.apache.rya:rya.prospector:jar:3.2.10-ccri:compile 
[INFO] | | | | \- org.codehaus.groovy:groovy-all:jar:2.3.11:compile 
[INFO] | | | +- org.apache.lucene:lucene-core:jar:3.6.2:compile 
[INFO] | | | +- org.apache.lucene:lucene-analyzers:jar:3.6.2:compile 
[INFO] | | | +- commons-codec:commons-codec:jar:1.10:compile 
[INFO] | | | \- org.locationtech.geomesa:geomesa-accumulo-datastore:jar:1.2.0:compile 
[INFO] | | |  +- org.locationtech.geomesa:geomesa-filter:jar:1.2.0:compile 
[INFO] | | |  | \- org.geotools:gt-transform:jar:14.1:compile 
[INFO] | | |  +- org.locationtech.geomesa:geomesa-security:jar:1.2.0:compile 
[INFO] | | |  +- org.locationtech.geomesa:geomesa-feature-all:jar:1.2.0:compile 
[INFO] | | |  | +- org.locationtech.geomesa:geomesa-feature-common:jar:1.2.0:compile 
[INFO] | | |  | +- org.locationtech.geomesa:geomesa-feature-kryo:jar:1.2.0:compile 
[INFO] | | |  | +- org.locationtech.geomesa:geomesa-feature-avro:jar:1.2.0:compile 
[INFO] | | |  | \- org.locationtech.geomesa:geomesa-feature-nio:jar:1.2.0:compile 
[INFO] | | |  +- org.locationtech.geomesa:geomesa-z3:jar:1.2.0:compile 
[INFO] | | |  | \- org.locationtech.sfcurve:sfcurve-zorder_2.11:jar:0.1.1:compile 
[INFO] | | |  |  \- org.locationtech.sfcurve:sfcurve-api_2.11:jar:0.1.1:compile 
[INFO] | | |  +- org.geotools:gt-cql:jar:14.1:compile 
[INFO] | | |  +- org.geotools:gt-render:jar:14.1:compile 
[INFO] | | |  | \- org.geotools:gt-coverage:jar:14.1:compile 
[INFO] | | |  |  +- org.jaitools:jt-zonalstats:jar:1.4.0:compile 
[INFO] | | |  |  +- org.jaitools:jt-utils:jar:1.4.0:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.affine:jt-affine:jar:1.0.8:compile 
[INFO] | | |  |  | +- it.geosolutions.jaiext.iterators:jt-iterators:jar:1.0.8:compile 
[INFO] | | |  |  | +- it.geosolutions.jaiext.utilities:jt-utilities:jar:1.0.8:compile 
[INFO] | | |  |  | +- it.geosolutions.jaiext.scale:jt-scale:jar:1.0.8:compile 
[INFO] | | |  |  | | \- it.geosolutions.jaiext.translate:jt-translate:jar:1.0.8:compile 
[INFO] | | |  |  | \- javax.media:jai_codec:jar:1.1.3:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.algebra:jt-algebra:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.bandmerge:jt-bandmerge:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.bandselect:jt-bandselect:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.bandcombine:jt-bandcombine:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.border:jt-border:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.buffer:jt-buffer:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.crop:jt-crop:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.lookup:jt-lookup:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.mosaic:jt-mosaic:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.nullop:jt-nullop:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.rescale:jt-rescale:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.stats:jt-stats:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.warp:jt-warp:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.zonal:jt-zonal:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.binarize:jt-binarize:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.format:jt-format:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.colorconvert:jt-colorconvert:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.errordiffusion:jt-errordiffusion:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.orderdither:jt-orderdither:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.colorindexer:jt-colorindexer:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.imagefunction:jt-imagefunction:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.piecewise:jt-piecewise:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.classifier:jt-classifier:jar:1.0.8:compile 
[INFO] | | |  |  +- it.geosolutions.jaiext.rlookup:jt-rlookup:jar:1.0.8:compile 
[INFO] | | |  |  \- it.geosolutions.jaiext.vectorbin:jt-vectorbin:jar:1.0.8:compile 
[INFO] | | |  +- org.geotools:gt-process-feature:jar:14.1:compile 
[INFO] | | |  | \- org.geotools:gt-process:jar:14.1:compile 
[INFO] | | |  +- org.apache.commons:commons-csv:jar:1.0:compile 
[INFO] | | |  \- org.apache.curator:curator-recipes:jar:2.7.1:compile 
[INFO] | | |  \- org.apache.curator:curator-framework:jar:2.7.1:compile 
[INFO] | | |   \- org.apache.curator:curator-client:jar:2.7.1:compile 
[INFO] | | +- org.openrdf.sesame:sesame-rio-trig:jar:2.7.6:compile 
[INFO] | | | +- org.openrdf.sesame:sesame-rio-turtle:jar:2.7.6:compile 
[INFO] | | | +- org.openrdf.sesame:sesame-rio-datatypes:jar:2.7.6:runtime 
[INFO] | | | \- org.openrdf.sesame:sesame-rio-languages:jar:2.7.6:runtime 
[INFO] | | \- org.apache.accumulo:accumulo-core:jar:1.6.4:compile 
[INFO] | |  +- com.beust:jcommander:jar:1.32:compile 
[INFO] | |  +- commons-cli:commons-cli:jar:1.2:compile 
[INFO] | |  +- commons-collections:commons-collections:jar:3.2.1:compile 
[INFO] | |  +- commons-configuration:commons-configuration:jar:1.6:compile 
[INFO] | |  | +- commons-digester:commons-digester:jar:1.8:compile 
[INFO] | |  | | \- commons-beanutils:commons-beanutils:jar:1.7.0:compile 
[INFO] | |  | \- commons-beanutils:commons-beanutils-core:jar:1.8.0:compile 
[INFO] | |  +- commons-lang:commons-lang:jar:2.4:compile 
[INFO] | |  +- jline:jline:jar:2.11:compile 
[INFO] | |  +- log4j:log4j:jar:1.2.16:compile 
[INFO] | |  +- org.apache.accumulo:accumulo-fate:jar:1.6.4:compile 
[INFO] | |  +- org.apache.accumulo:accumulo-start:jar:1.6.4:compile 
[INFO] | |  +- org.apache.accumulo:accumulo-trace:jar:1.6.4:compile 
[INFO] | |  +- org.apache.commons:commons-math:jar:2.1:compile 
[INFO] | |  +- org.apache.commons:commons-vfs2:jar:2.0:compile 
[INFO] | |  | +- org.apache.maven.scm:maven-scm-api:jar:1.4:compile 
[INFO] | |  | | \- org.codehaus.plexus:plexus-utils:jar:1.5.6:compile 
[INFO] | |  | \- org.apache.maven.scm:maven-scm-provider-svnexe:jar:1.4:compile 
[INFO] | |  |  +- org.apache.maven.scm:maven-scm-provider-svn-commons:jar:1.4:compile 
[INFO] | |  |  \- regexp:regexp:jar:1.3:compile 
[INFO] | |  +- org.apache.hadoop:hadoop-client:jar:2.2.0:compile 
[INFO] | |  | +- org.apache.hadoop:hadoop-hdfs:jar:2.2.0:compile 
[INFO] | |  | +- org.apache.hadoop:hadoop-mapreduce-client-app:jar:2.2.0:compile 
[INFO] | |  | | +- org.apache.hadoop:hadoop-mapreduce-client-common:jar:2.2.0:compile 
[INFO] | |  | | | +- org.apache.hadoop:hadoop-yarn-client:jar:2.2.0:compile 
[INFO] | |  | | | | +- com.google.inject:guice:jar:3.0:compile 
[INFO] | |  | | | | | \- javax.inject:javax.inject:jar:1:compile 
[INFO] | |  | | | | +- com.sun.jersey.jersey-test-framework:jersey-test-framework-grizzly2:jar:1.9:compile 
[INFO] | |  | | | | | +- com.sun.jersey.jersey-test-framework:jersey-test-framework-core:jar:1.9:compile 
[INFO] | |  | | | | | | +- javax.servlet:javax.servlet-api:jar:3.1.0:provided 
[INFO] | |  | | | | | | \- com.sun.jersey:jersey-client:jar:1.9:compile 
[INFO] | |  | | | | | \- com.sun.jersey:jersey-grizzly2:jar:1.9:compile 
[INFO] | |  | | | | |  +- org.glassfish.grizzly:grizzly-http:jar:2.1.2:compile 
[INFO] | |  | | | | |  | \- org.glassfish.grizzly:grizzly-framework:jar:2.1.2:compile 
[INFO] | |  | | | | |  |  \- org.glassfish.gmbal:gmbal-api-only:jar:3.0.0-b023:compile 
[INFO] | |  | | | | |  |  \- org.glassfish.external:management-api:jar:3.0.0-b012:compile 
[INFO] | |  | | | | |  +- org.glassfish.grizzly:grizzly-http-server:jar:2.1.2:compile 
[INFO] | |  | | | | |  | \- org.glassfish.grizzly:grizzly-rcm:jar:2.1.2:compile 
[INFO] | |  | | | | |  +- org.glassfish.grizzly:grizzly-http-servlet:jar:2.1.2:compile 
[INFO] | |  | | | | |  \- org.glassfish:javax.servlet:jar:3.1:compile 
[INFO] | |  | | | | \- com.sun.jersey.contribs:jersey-guice:jar:1.9:compile 
[INFO] | |  | | | \- org.apache.hadoop:hadoop-yarn-server-common:jar:2.2.0:compile 
[INFO] | |  | | \- org.apache.hadoop:hadoop-mapreduce-client-shuffle:jar:2.2.0:compile 
[INFO] | |  | +- org.apache.hadoop:hadoop-yarn-api:jar:2.2.0:compile 
[INFO] | |  | +- org.apache.hadoop:hadoop-mapreduce-client-core:jar:2.2.0:compile 
[INFO] | |  | | \- org.apache.hadoop:hadoop-yarn-common:jar:2.2.0:compile 
[INFO] | |  | \- org.apache.hadoop:hadoop-mapreduce-client-jobclient:jar:2.2.0:compile 
[INFO] | |  +- org.apache.thrift:libthrift:jar:0.9.1:compile 
[INFO] | |  | \- org.apache.commons:commons-lang3:jar:3.1:compile 
[INFO] | |  \- org.apache.zookeeper:zookeeper:jar:3.4.5:compile 
[INFO] | |  \- org.jboss.netty:netty:jar:3.2.2.Final:compile 
[INFO] | +- org.openrdf.sesame:sesame-model:jar:2.7.6:compile 
[INFO] | | \- org.openrdf.sesame:sesame-util:jar:2.7.6:compile 
[INFO] | \- org.json4s:json4s-ast_2.11:jar:3.2.10:compile 
[INFO] +- com.ccri.crusher:crusher-web-cqlknn:jar:1.1.0-SNAPSHOT:compile 
[INFO] | +- com.ccri.crusher:crusher-suggest:jar:1.1.0-SNAPSHOT:compile 
[INFO] | | +- com.ccri:knn-core:jar:2.1:compile 
[INFO] | | | +- com.ccri:knn-api:jar:2.1:compile 
[INFO] | | | +- com.ccri:knn-iterators:jar:2.1:compile 
[INFO] | | | +- com.ccri.commons:commons-serialization:jar:0.1.0:compile 
[INFO] | | | \- com.ccri.commons:commons-reflection-annotations:jar:0.1.10:compile 
[INFO] | | \- org.scalanlp:breeze_2.11:jar:0.11:compile 
[INFO] | |  +- org.scalanlp:breeze-macros_2.11:jar:0.11:compile 
[INFO] | |  +- com.github.fommil.netlib:core:jar:1.1.2:compile 
[INFO] | |  +- net.sourceforge.f2j:arpack_combined_all:jar:0.1:compile 
[INFO] | |  +- net.sf.opencsv:opencsv:jar:2.3:compile 
[INFO] | |  +- com.github.rwl:jtransforms:jar:2.4.0:compile 
[INFO] | |  | \- junit:junit:jar:4.8.2:compile 
[INFO] | |  +- org.apache.commons:commons-math3:jar:3.2:compile 
[INFO] | |  \- org.spire-math:spire_2.11:jar:0.7.4:compile 
[INFO] | |  \- org.spire-math:spire-macros_2.11:jar:0.7.4:compile 
[INFO] | +- com.ccri.dragonfish:ccri-ontology:jar:1.7.1:compile 
[INFO] | +- com.ccri.dragonfish:dragonfish-accumulo-core:jar:1.7.1:compile 
[INFO] | +- com.ccri.dragonfish:dragonfish-geometry:jar:1.7.1:compile 
[INFO] | | +- org.locationtech.geomesa:geomesa-utils:jar:1.2.0:compile 
[INFO] | | | +- commons-pool:commons-pool:jar:1.6:compile 
[INFO] | | | +- org.apache.commons:commons-compress:jar:1.4.1:compile 
[INFO] | | | | \- org.tukaani:xz:jar:1.0:compile 
[INFO] | | | +- com.vividsolutions:jts:jar:1.13:compile 
[INFO] | | | +- org.geotools:gt-referencing:jar:14.1:compile 
[INFO] | | | | +- com.googlecode.efficient-java-matrix-library:core:jar:0.26:compile 
[INFO] | | | | \- net.sf.geographiclib:GeographicLib-Java:jar:1.44:compile 
[INFO] | | | +- org.geotools:gt-main:jar:14.1:compile 
[INFO] | | | +- org.geotools:gt-metadata:jar:14.1:compile 
[INFO] | | | +- org.geotools:gt-opengis:jar:14.1:compile 
[INFO] | | | | \- net.java.dev.jsr-275:jsr-275:jar:1.0-beta-2:compile 
[INFO] | | | +- org.geotools:gt-api:jar:14.1:compile 
[INFO] | | | +- org.geotools:gt-grid:jar:14.1:compile 
[INFO] | | | +- org.geotools:gt-data:jar:14.1:compile 
[INFO] | | | \- com.spatial4j:spatial4j:jar:0.4.1:compile 
[INFO] | | \- org.geotools:gt-shapefile:jar:14.2:compile 
[INFO] | |  +- org.jdom:jdom:jar:1.1.3:compile 
[INFO] | |  \- javax.media:jai_core:jar:1.1.3:compile 
[INFO] | +- com.ccri.dragonfish:dragonfish-imagery:jar:1.7.1:compile 
[INFO] | | +- com.ccri.dragonfish:dragonfish-breeze:jar:1.7.1:compile 
[INFO] | | +- com.ccri.dragonfish:dragonfish-serialization:jar:1.7.1:compile 
[INFO] | | | +- com.esotericsoftware.kryo:kryo:jar:2.21:compile 
[INFO] | | | | +- com.esotericsoftware.reflectasm:reflectasm:jar:shaded:1.07:compile 
[INFO] | | | | | \- org.ow2.asm:asm:jar:4.0:compile 
[INFO] | | | | +- com.esotericsoftware.minlog:minlog:jar:1.2:compile 
[INFO] | | | | \- org.objenesis:objenesis:jar:1.2:compile 
[INFO] | | | \- com.twitter:chill_2.11:jar:0.5.0:compile 
[INFO] | | |  \- com.twitter:chill-java:jar:0.5.0:compile 
[INFO] | | +- com.ccri.opencv:opencv:jar:2.4.11-free-fix:compile 
[INFO] | | \- org.slf4j:slf4j-log4j12:jar:1.7.5:compile 
[INFO] | \- com.ccri.dragonfish:dragonfish-native:jar:1.7.1:compile 
[INFO] |  +- com.ccri.gdal:gdal-natives:jar:1.11.2:compile 
[INFO] |  \- commons-io:commons-io:jar:2.4:compile 
[INFO] +- com.ccri.crusher:crusher-web-enrich:jar:1.1.0-SNAPSHOT:compile 
[INFO] | +- com.ccri.crusher:crusher-enrich-core:jar:1.1.0-SNAPSHOT:compile 
[INFO] | \- com.typesafe:config:jar:1.2.1:compile 
[INFO] +- com.ccri.crusher:crusher-enrich-imagechip:jar:1.1.0-SNAPSHOT:compile 
[INFO] +- com.ccri.crusher:crusher-web-suggest:jar:1.1.0-SNAPSHOT:compile 
[INFO] | \- com.ccri.crusher:crusher-enrich-datetime:jar:1.1.0-SNAPSHOT:compile 
[INFO] +- com.ccri.crusher:crusher-web-thumbnail:jar:1.1.0-SNAPSHOT:compile 
[INFO] +- com.ccri.crusher:crusher-web-search:jar:1.1.0-SNAPSHOT:compile 
[INFO] | +- com.ccri.crusher:crusher-search:jar:1.1.0-SNAPSHOT:compile 
[INFO] | | +- com.ccri.commons:commons-query-core:jar:0.0.1:compile 
[INFO] | | \- org.apache.solr:solr-solrj:jar:4.10.2:compile 
[INFO] | |  +- org.apache.httpcomponents:httpclient:jar:4.3.1:compile 
[INFO] | |  +- org.apache.httpcomponents:httpcore:jar:4.3:compile 
[INFO] | |  +- org.apache.httpcomponents:httpmime:jar:4.3.1:compile 
[INFO] | |  +- org.codehaus.woodstox:wstx-asl:jar:3.2.7:compile 
[INFO] | |  \- org.noggit:noggit:jar:0.5:compile 
[INFO] | \- com.ccri.commons:commons-query-parsing:jar:0.0.1:compile 
[INFO] +- com.ccri.crusher:crusher-web-slotfiller:jar:1.1.0-SNAPSHOT:compile 
[INFO] | \- com.ccri.crusher:crusher-slot-filler:jar:1.1.0-SNAPSHOT:compile 
[INFO] |  +- com.ccri.commons:commons-reflection-loaders:jar:0.1.10: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] |  | +- de.jollyday:jollyday:jar:0.4.7:compile 
[INFO] |  | | \- javax.xml.bind:jaxb-api:jar:2.2.7:compile 
[INFO] |  | \- javax.json:javax.json-api:jar:1.0:compile 
[INFO] |  +- edu.stanford.nlp:stanford-corenlp:jar:models:3.5.2:compile 
[INFO] |  \- com.googlecode.efficient-java-matrix-library:ejml:jar:0.21:compile 
[INFO] \- org.scala-lang:scala-library:jar:2.11.7:compile 
+1

Вы пробовали mvn зависимость: дерево, чтобы лучше понять? посмотрите на https://maven.apache.org/plugins/maven-dependency-plugin/examples/resolving-conflicts-using-the-dependency-tree.html – pedrorijo91

+0

@ pedrorijo91 yup, когда я изменяю версию ejml, он отображается в mvn: дереве зависимостей как изменения, как в общем проекте, так и в войне. к сожалению, это не помогло мне понять ошибку. – compguy24

+0

Какой выход? вы можете вставить его? вы видите конфликт зависимости? – pedrorijo91

ответ

3

Я позволю себе процитировать документы для java.io.Serializable:

сериализации во время выполнения ассоциаты с каждым сериализуемым классом номер версии, называемый serialVersionUID, который используется во время десериализации, чтобы убедиться, что отправитель и получатель сериализованного объекта загружают классы для этого объекта, которые совместимы с t o сериализация. Если приемник загрузил класс для объекта, у которого есть другой serialVersionUID, чем класс соответствующего класса отправителя, то десериализация приведет к InvalidClassException.Сериализуемая класс может объявить свой собственный serialVersionUID явно объявить поле с именем "serialVersionUID", который должен быть статическим, окончательным и типа long:

ANY-ACCESS-MODIFIER static final long serialVersionUID = 42L; 

Если сериализации класс не явно объявлять в serialVersionUID , то время выполнения сериализации рассчитает значение serialVersionUID по умолчанию для этого класса на основе различных аспектов класса, как описано в объекте Java (TM) техническая спецификация. Тем не менее, настоятельно рекомендовал, что все сериализуемые классы явно объявляют значения serialVersionUID, так как вычисление по умолчанию serialVersionUID очень чувствительно к деталям класса, которые могут различаться в зависимости от реализаций компилятора и могут приводить к неожиданным InvalidClassExceptions во время десериализации. Поэтому, чтобы гарантировать согласованное значение serialVersionUID в разных реализациях java-компилятора, сериализуемый класс должен объявить явное значение serialVersionUID. Также настоятельно рекомендуется, чтобы в явных объявлениях serialVersionUID по возможности использовался специальный модификатор, поскольку такие объявления применимы только к объявляющему сразу классу - поля serialVersionUID не полезны в качестве унаследованных. Классы массивов не могут объявлять явные serialVersionUID, поэтому они всегда имеют рассчитанное по умолчанию значение, но требование для сопоставления значений serialVersionUID отменяется для классов массивов.

Проблема здесь состоит в том, что все Serializable классов в ejml библиотеке не имеют serialVersionUID поля. Например, the SimpleBase class. Итак, что происходит в вашем случае, так это то, что у вас есть данные, сериализованные одной версией/сборкой библиотеки, но десериализованные другой версией/сборкой, которая имеет разные serialVersionUID.

Говоря это, вам нужно выяснить, какая версия и сборка были использованы для сериализации данных и использования только этой сборки. Если это было от maven, то вы должны использовать его с maven. Если вы скомпилируете эту версию самостоятельно, то нет гарантии, что serialVersionUID будет таким же.

Но правильным решением будет запрос Pull в библиотеку ejml, который явно добавит значение serialVersionUID ко всем классам, которые реализуют Serializable.

+0

Итак, скажем, я получаю serialVersionUID в класс SimpleBase. Если я правильно понимаю, моя ошибка заключается в десериализации. Разве мне не нужно было бы объявлять один и тот же serialVersionUID в любых восходящих классах, которые сериализуют объект в первую очередь? – compguy24

+0

@ compguy24 О, я думаю, я был недостаточно ясен.Коренной причиной вашей проблемы является serialVersionUID. Лучше всего объявлять поле serialVersionUID, если класс расширяет Serializable. Авторы ejml должны были это сделать. Если вы используете другую сборку (не только версию), чем использовали для сериализации, очень возможно, что serialVersionUID будет отличаться. Вот что случилось. –

+0

@ compguy24 Решил ли вы вашу проблему? Вам все еще нужна помощь? –

Смежные вопросы