Reputation: 1318
Okay, so the guts of the issue is I'm getting this error:
Unhandled java.lang.NoSuchFieldError
METER
Stacktrace:
Parser.java: 560 org.geotools.referencing.wkt.Parser/parseSpheroid
Parser.java: 656 org.geotools.referencing.wkt.Parser/parseDatum
Parser.java: 867 org.geotools.referencing.wkt.Parser/parseGeoGCS
Parser.java: 224 org.geotools.referencing.wkt.Parser/parseCoordinateReferenceSystem
Parser.java: 204 org.geotools.referencing.wkt.Parser/parseCoordinateReferenceSystem
ReferencingObjectFactory.java: 1090 org.geotools.referencing.factory.ReferencingObjectFactory/createFromWKT
PrjFileReader.java: 94 org.geotools.data.PrjFileReader/<init>
PrjFileReader.java: 68 org.geotools.data.PrjFileReader/<init>
ShapefileSetManager.java: 106 org.geotools.data.shapefile.ShapefileSetManager/openPrjReader
ShapefileFeatureSource.java: 519 org.geotools.data.shapefile.ShapefileFeatureSource/readAttributes
ShapefileFeatureSource.java: 475 org.geotools.data.shapefile.ShapefileFeatureSource/buildFeatureType
ShapefileFeatureStore.java: 132 org.geotools.data.shapefile.ShapefileFeatureStore/buildFeatureType
ContentFeatureSource.java: 343 org.geotools.data.store.ContentFeatureSource/getAbsoluteSchema
ContentFeatureSource.java: 312 org.geotools.data.store.ContentFeatureSource/getSchema
ContentDataStore.java: 345 org.geotools.data.store.ContentDataStore/getSchema
NativeMethodAccessorImpl.java: -2 sun.reflect.NativeMethodAccessorImpl/invoke0
NativeMethodAccessorImpl.java: 62 sun.reflect.NativeMethodAccessorImpl/invoke
DelegatingMethodAccessorImpl.java: 43 sun.reflect.DelegatingMethodAccessorImpl/invoke
Method.java: 483 java.lang.reflect.Method/invoke
Reflector.java: 93 clojure.lang.Reflector/invokeMatchingMethod
Reflector.java: 28 clojure.lang.Reflector/invokeInstanceMethod
geometry.clj: 40 grafter.tabular.geometry/store->dataset
geometry.clj: 39 grafter.tabular.geometry/store->dataset
geometry.clj: 51 grafter.tabular.geometry/eval17505/fn
MultiFn.java: 233 clojure.lang.MultiFn/invoke
common.clj: 191 grafter.tabular.common/dispatch-with-format-option
common.clj: 180 grafter.tabular.common/dispatch-with-format-option
common.clj: 197 grafter.tabular.common/eval1293/fn
MultiFn.java: 233 clojure.lang.MultiFn/invoke
common.clj: 200 grafter.tabular.common/read-dataset
common.clj: 199 grafter.tabular.common/read-dataset
RestFn.java: 410 clojure.lang.RestFn/invoke
REPL: 44 grafter.tabular.geometry/eval17511
REPL: 44 grafter.tabular.geometry/eval17511
Compiler.java: 6927 clojure.lang.Compiler/eval
Compiler.java: 6890 clojure.lang.Compiler/eval
core.clj: 3105 clojure.core/eval
core.clj: 3101 clojure.core/eval
main.clj: 240 clojure.main/repl/read-eval-print/fn
main.clj: 240 clojure.main/repl/read-eval-print
main.clj: 258 clojure.main/repl/fn
main.clj: 258 clojure.main/repl
main.clj: 174 clojure.main/repl
RestFn.java: 1523 clojure.lang.RestFn/invoke
interruptible_eval.clj: 87 clojure.tools.nrepl.middleware.interruptible-eval/evaluate/fn
AFn.java: 152 clojure.lang.AFn/applyToHelper
AFn.java: 144 clojure.lang.AFn/applyTo
core.clj: 646 clojure.core/apply
core.clj: 1881 clojure.core/with-bindings*
core.clj: 1881 clojure.core/with-bindings*
RestFn.java: 425 clojure.lang.RestFn/invoke
interruptible_eval.clj: 85 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 55 clojure.tools.nrepl.middleware.interruptible-eval/evaluate
interruptible_eval.clj: 222 clojure.tools.nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
interruptible_eval.clj: 190 clojure.tools.nrepl.middleware.interruptible-eval/run-next/fn
AFn.java: 22 clojure.lang.AFn/run
ThreadPoolExecutor.java: 1142 java.util.concurrent.ThreadPoolExecutor/runWorker
ThreadPoolExecutor.java: 617 java.util.concurrent.ThreadPoolExecutor$Worker/run
Thread.java: 745 java.lang.Thread/run
When calling a function that uses some geotools functionality from org.geotools/gt-shapefile
. My starting version was 15.1
.
The weird thing is that we're using this project (version 13.2
) in a virtually identical app, using the same calling code and same namespace to call from; yet using that version doesn't work here - the same error is thrown.
I've tried:
15.1
and rolling back from thereI've seen from looking around that this seems to be a dependency issue, but I'm not sure exactly where it occurs.
Upvotes: 2
Views: 572
Reputation: 1318
After quite a while, I managed to work this out - and wanted to make sure it was on SO for posterity. The problem is in the javax.measure
library; you can see the fields here. There are two versions on maven and continued development post-May 2010 is elsewhere.
A lot of projects mix this in, and dependency mismatch can happen pretty easily. In our case, Apache Tika was the culprit. One of our internal libs uses Tika, and that uses:
[javax.measure/jsr-275 "0.9.3"]
Whereas Geotools uses:
[net.java.dev.jsr-275/jsr-275 "1.0-beta-2”]
Thus, adding the following to any projects in your project.clj
that refer to javax.measure
will solve the issue:
[library "x.x.x" :exclusions [javax.measure/jsr-275]]
To identify these, use $ lein deps :tree
to explore your dependencies.
Upvotes: 5