Fork me on GitHub
#aws-lambda
<
2022-02-24
>
Jason20:02:35

hi i'm a newbie to running clojure projects on aws lambda and im coming across the following error. I uploaded a standalone jar for a clojure project that I generated using "lein uberjar". I suspect this is something very simple that happened even before the program is run. any thought is much appreciated!

Kevan22:02:56

Check that the name of your handler matches what the lambda is expecting.

Jason22:02:17

Thanks for the help! my handler is "thesis-main.core::main" (without the quotation marks). I do have a function called "-main" (without quotation marks) in my clojure code. Is this considered a match? If not, what do you recommend I have in stead? Thank you!

Kevan22:02:31

Mmmm, can you post the ns that your handler file is in? The lambda I was working on the other week has looks like:

  (ns handler
     (:gen-class
   :implements [com.amazonaws.services.lambda.runtime.RequestStreamHandler])
  (:require [clojure.data.json :as json]...)

Kevan22:02:41

And the runtime setting in aws the Handler is handler

Jason23:02:13

My handler setting is in the picture below and that code snippet is how i referenced it in my code. I'm not sure if I'm doing it correctly though. Thank you!

(ns thesis-main.core
  (:gen-class))
(require '[clojure.set :as s])