Fork me on GitHub
#clojure
<
2017-12-02
>
Oliver George04:12:21

I'm getting an error when using clj with a deps.edn including a :local/root.

{:deps {org.clojure/java.jdbc {:mvn/version "0.6.2-alpha2"}
        oracle/driver {:local/root "./ojdbc7.jar"}}}
It says
Error building classpath. Wrong number of args (4) passed to: local/eval398/fn--400

Alex Miller (Clojure team)13:12:47

Based on that error, it’s probably a bug based on one of the recent refactors. I will take a look. Also btw, this stuff is good for #tools-deps

Alex Miller (Clojure team)14:12:38

yep, had some signature drift. will be fixed in next release.

Alex Miller (Clojure team)14:12:53

as a temp workaround, you can probably declare it in paths instead - :paths ["src" "ojdbc7.jar"]

Alex Miller (Clojure team)14:12:22

that’s not what paths is for, but it should work

Oliver George04:12:47

Based on "Refer to a specific jar on disk" in https://clojure.org/guides/deps_and_cli

Oliver George04:12:04

I also tried full path etc.

Oliver George04:12:53

(Also interested in how to debug stuff like this.)

Oliver George08:12:33

Answering my own question in part. clj -Sverbose will show details. In my case confirming my brew install wasn't the latest. (not a fix but still useful).

qqq08:12:05

is there a simple way to do a https supporting web server in java? it feels silly that my clojure code is all doing http/ws, then I am running some node.js wrapper to tunnel https -> http, wss -> ws

val_waeselynck09:12:24

I personally just deploy to Elastic Beanstalk, which takes care of SSL and Nginx for me

qqq09:12:52

yeah, AWS makes SSL trivial

qqq09:12:03

my situation is: I need this for local, with a self signed cert

qqq09:12:23

some auth libs I'm talking to are unhappy unless the host url is ssl, thus, I need ssl even in my dev setup

noisesmith15:12:11

there are more reasons to use nginx as a reverse proxy - it has better security and more reliable security updates than most alternatives, and if set up properly can improve performance and balance your load for you

qqq18:12:08

as stupid as it sounds, neither performance nor load balancing matters for production, I'm using AWS for SSL this is literally for local, where there is just one user (me), and I need SSL because some auth libraries I'm playing with barf if my webpage isn't hosted in SSL

noisesmith18:12:20

oh - aws might be using nginx for your ssl for all I know (I know that is how it works for our app at least)

joaohgomes13:12:45

have you tried to spin up a nginx docker container and proxying requests to your local server? This is probably more than what you need, but you could use as reference to create your own config. https://github.com/jwilder/nginx-proxy

joninvski10:12:10

i'm a clojure newbie and am trying to learn channels and agents. Did a small tutorial about them here: https://joaoptrindade.com/tutorial-clojure-agents-and-channels anyone interested in giving some feedback? see if i understood the concept correctly

Bravi10:12:12

Hi. what’s the equivalent in clojure for

hash_hmac('sha512')

christos10:12:49

what is the equivalent in java ? 😛

Bravi20:12:51

when creating a restful api using ring + compojure, do I have to specify {:body ..} for every single handler? Is it not possible to make this automatic

Bravi20:12:11

this is what I mean:

(defn index-page [req]
  {:body {:data [{:id 1
                  :name "Some name"}]}})

(defroutes app-routes
  (GET "/" _ index-page))

Bravi22:12:22

how can I make an http call in ring and return the result to the client? when I do this

(defn get-orders [req]
  (let [{:keys [sig uri]} (api-signature :get-orders)]
    (client/get uri
                {:async? true}
                (fn [response] {:body "something"})
                (fn [exception] {:body "error"}))))

Bravi22:12:46

it gives me this error

No implementation of method: :render of protocol: #'compojure.response/Renderable found for class: org.apache.http.impl.nio.client.FutureWrapper

seancorfield23:12:19

@bravilogy you're making an async get call inside a synchronous handler.

seancorfield23:12:15

You could use Ring's async handler machinery -- or force a dereference on the get call -- or just do a synchronous get instead.

Bravi23:12:08

thanks @seancorfield. Actually I removed :async? true along with callbacks and it works fine now

Bravi23:12:12

I just don’t get what’s the point of async in here 😄

Bravi23:12:40

is it there just so it doesn’t block IO?

seancorfield23:12:50

If you were using Ring's async handlers, it would make sense to use the async version of get -- and, yes, async would not block while the HTTP call is processed.