Factual / factual-clojure-driver

Officially supported Clojure driver for Factual's API.
Other
20 stars 6 forks source link

Can not start server in a Compojure-api project after adding factual-clojure-driver 1.5.1 #11

Closed ssnall closed 9 years ago

ssnall commented 9 years ago

I just started a composore-api project using template.

lein new compojure-api my-api

Server starts fine with lein ring server

Now tried integrating factual-clojure-driver 1.5.1 server won't start after that. Getting the following error.

Exception in thread "main" java.lang.IllegalArgumentException: Can't define method not in interfaces: get_file_name, compiling:(clojure/tools/reader/reader_types.clj:107:1) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6651) at clojure.lang.Compiler.analyze(Compiler.java:6445) at clojure.lang.Compiler.analyze(Compiler.java:6406) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782) at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6100) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6644) at clojure.lang.Compiler.analyze(Compiler.java:6445) at clojure.lang.Compiler.analyze(Compiler.java:6406) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:5782) at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5217) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3846) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6642) at clojure.lang.Compiler.analyze(Compiler.java:6445) at clojure.lang.Compiler.eval(Compiler.java:6700) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:628) at clojure.core$use.doInvoke(core.clj:5618) at clojure.lang.RestFn.invoke(RestFn.java:436) at clojure.tools.reader.edn$eval9701$loading__4958__auto____9702.invoke(edn.clj:9) at clojure.tools.reader.edn$eval9701.invoke(edn.clj:9) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:482) at ring.middleware.format_params$eval9098$loading__4958__auto____9099.invoke(format_params.clj:1) at ring.middleware.format_params$eval9098.invoke(format_params.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:930) at compojure.api.middleware$eval9058$loading__4958__auto____9059.invoke(middleware.clj:1) at compojure.api.middleware$eval9058.invoke(middleware.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:551) at compojure.api.core$eval3359$loading__4958__auto____3360.invoke(core.clj:1) at compojure.api.core$eval3359.invoke(core.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:457) at compojure.api.sweet$eval3353$loading__4958__auto____3354.invoke(sweet.clj:1) at compojure.api.sweet$eval3353.invoke(sweet.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:436) at my_api.handler$eval3347$loading__4958__auto____3348.invoke(handler.clj:1) at my_api.handler$eval3347.invoke(handler.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.loadResourceScript(RT.java:361) at clojure.lang.RT.load(RT.java:440) at clojure.lang.RT.load(RT.java:411) at clojure.core$load$fn__5066.invoke(core.clj:5641) at clojure.core$load.doInvoke(core.clj:5640) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invoke(core.clj:5446) at clojure.core$load_lib$fn__5015.invoke(core.clj:5486) at clojure.core$load_lib.doInvoke(core.clj:5485) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invoke(core.clj:626) at clojure.core$load_libs.doInvoke(core.clj:5524) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invoke(core.clj:626) at clojure.core$require.doInvoke(core.clj:5607) at clojure.lang.RestFn.invoke(RestFn.java:421) at user$eval5.invoke(form-init8745060463986181286.clj:1) at clojure.lang.Compiler.eval(Compiler.java:6703) at clojure.lang.Compiler.eval(Compiler.java:6692) at clojure.lang.Compiler.load(Compiler.java:7130) at clojure.lang.Compiler.loadFile(Compiler.java:7086) at clojure.main$load_script.invoke(main.clj:274) at clojure.main$init_opt.invoke(main.clj:279) at clojure.main$initialize.invoke(main.clj:307) at clojure.main$null_opt.invoke(main.clj:342) at clojure.main$main.doInvoke(main.clj:420) at clojure.lang.RestFn.invoke(RestFn.java:421) at clojure.lang.Var.invoke(Var.java:383) at clojure.lang.AFn.applyToHelper(AFn.java:156) at clojure.lang.Var.applyTo(Var.java:700) at clojure.main.main(main.java:37) Caused by: java.lang.IllegalArgumentException: Can't define method not in interfaces: get_file_name at clojure.lang.Compiler$NewInstanceMethod.parse(Compiler.java:7984) at clojure.lang.Compiler$NewInstanceExpr.build(Compiler.java:7544) at clojure.lang.Compiler$NewInstanceExpr$DeftypeParser.parse(Compiler.java:7425) at clojure.lang.Compiler.analyzeSeq(Compiler.java:6644) ... 178 more

ssnall commented 9 years ago

my project.clj if that helps

(defproject my-api "0.1.0-SNAPSHOT" :description "FIXME: write description" :dependencies [ [org.clojure/tools.reader "0.8.16"] [org.clojure/clojure "1.6.0"] [factual/factual-clojure-driver "1.5.1"] [metosin/compojure-api "0.19.0"] [metosin/ring-http-response "0.6.1"] [metosin/ring-swagger-ui "2.1.8-M1"] [org.clojure/tools.reader "0.8.16"]] :ring {:handler my-api.handler/app} :uberjar-name "server.jar" :profiles {:dev {:dependencies [[cheshire "5.3.1"] [ring-mock "0.1.5"]] :plugins [[lein-ring "0.9.2"]]}})

dirtyvagabond commented 9 years ago

Hi @ssnall , apologies, I do not know why this is happening. I suspect there is a transitive dependency issue here, where one of our driver's dependencies is conflicting with one of your project's other dependencies. I am not able to troubleshoot this for you. You might try removing specific dependencies from your project one at a time, to see if you can identify where exactly the conflict is. If you are able to do this, please let me know what you discover

alexrobbins commented 9 years ago

The output of lein deps :tree can be helpful for debugging issues like this. It'll tell you when there are conflicting dependencies.

ssnall commented 9 years ago

I figured it out. it is org.clojure/clojure version mismatch.

I had to clone the this repo and change project.clj replace [org.clojure/clojure "1.4.0"] -> [org.clojure/clojure "1.6.0"]

lein install

then rest is good. Thanks for looking into it.

dirtyvagabond commented 9 years ago

@mavericklou please take a few moments to upgrade the deps, especially Clojure, test, and release a new version. thanks!

dirtyvagabond commented 9 years ago

thanks @ssnall for the report, very helpful

mavericklou commented 9 years ago

6fdf059d95098233d991e0d171e85a297663f1c6

mavericklou commented 9 years ago

@dirtyvagabond need permission to deploy new jar to clojars

mavericklou commented 9 years ago

1.5.2 deployed. @ssnall please try this version