Factual / factual-clojure-driver

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

Issues with ring #6

Closed noprompt closed 11 years ago

noprompt commented 11 years ago

The driver seems to cause problems when using ring with versions >= 1.4.1.

Here are the exact steps I took to produce the problem.

$ lein new compojure foo

The project file:

(defproject foo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :dependencies [[org.clojure/clojure "1.4.0"]
                 [factual/factual-clojure-driver "1.4.5"]
                 [compojure "1.1.5"]]
  :plugins [[lein-ring "0.8.2"]]
  :ring {:handler foo.handler/app}
  :profiles
  {:dev {:dependencies [[ring-mock "0.1.3"]]}})

Attempt to start the server:

$ lein ring server
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
    at org.eclipse.jetty.util.log.JettyAwareLogger.log(JettyAwareLogger.java:613)
    at org.eclipse.jetty.util.log.JettyAwareLogger.debug(JettyAwareLogger.java:200)
    at org.eclipse.jetty.util.log.Slf4jLog.debug(Slf4jLog.java:94)
    at org.eclipse.jetty.util.component.Container.add(Container.java:201)
    at org.eclipse.jetty.util.component.Container.update(Container.java:164)
    at org.eclipse.jetty.util.component.Container.update(Container.java:106)
    at org.eclipse.jetty.server.Server.setConnectors(Server.java:184)
    at org.eclipse.jetty.server.Server.addConnector(Server.java:158)
    at ring.adapter.jetty$create_server.invoke(jetty.clj:54)
    at ring.adapter.jetty$run_jetty.invoke(jetty.clj:79)
    at ring.server.standalone$serve$fn__1557.invoke(standalone.clj:98)
    at ring.server.standalone$try_port.invoke(standalone.clj:16)
    at ring.server.standalone$serve.doInvoke(standalone.clj:95)
    at clojure.lang.RestFn.invoke(RestFn.java:423)
    at ring.server.leiningen$serve.invoke(leiningen.clj:20)
    at user$eval2122.invoke(NO_SOURCE_FILE:1)
    at clojure.lang.Compiler.eval(Compiler.java:6511)
    at clojure.lang.Compiler.eval(Compiler.java:6501)
    at clojure.lang.Compiler.eval(Compiler.java:6477)
    at clojure.core$eval.invoke(core.clj:2797)
    at clojure.main$eval_opt.invoke(main.clj:297)
    at clojure.main$initialize.invoke(main.clj:316)
    at clojure.main$null_opt.invoke(main.clj:349)
    at clojure.main$main.doInvoke(main.clj:427)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:419)
    at clojure.lang.AFn.applyToHelper(AFn.java:163)
    at clojure.lang.Var.applyTo(Var.java:532)
    at clojure.main.main(main.java:37)
Subprocess failed

Edit: Versions >= 1.4.1

dirtyvagabond commented 11 years ago

A workaround for now is to use version 1.3.1 of this driver, i.e.:

[factual/factual-clojure-driver "1.3.1"]

You could also consider using factql, which is a DSL approach to using Factual (and currently uses version 1.3.1 of this driver).

yoshimotob commented 11 years ago

There seems to be a conflict in the slf4j versions being included. Do avoid this, please try the following: [factual/factual-clojure-driver "1.4.5" :exclusions [org.slf4j/slf4j-log4j12]]

noprompt commented 11 years ago

Thanks. I'll give that a shot!

yoshimotob commented 11 years ago

There is also a new driver version up that should resolve this automatically: [factual/factual-clojure-driver "1.4.6"] Let us know if this will work for you as well. Thanks!

noprompt commented 11 years ago

Even better! I'll be working on the app that uses this driver again tomorrow and will be sure to let you know. Thanks again for your help.

noprompt commented 11 years ago

My apologies for the late response. I do want to verify that [factual/factual-clojure-driver "1.4.6"] works like a charm! Awesome work guys.