Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console/app-handler throws error for jdk < 18 #165

Closed
alishamohanty opened this issue May 24, 2024 · 0 comments · Fixed by #166 or #167
Closed

console/app-handler throws error for jdk < 18 #165

alishamohanty opened this issue May 24, 2024 · 0 comments · Fixed by #166 or #167
Labels
bug Something isn't working

Comments

@alishamohanty
Copy link
Contributor

Describe the bug

Error is thrown when loading client namespace using console/app-handler
Error:

 :cause No matching method ceilDiv found taking 2 args for class java.lang.Math
 :via
 [{:type clojure.lang.Compiler$CompilerException
   :message Syntax error compiling . at (goose/brokers/redis/console/pages/enqueued.clj:36:57).
   :data #:clojure.error{:phase :compile-syntax-check, :line 36, :column 57, :source goose/brokers/redis/console/pages/enqueued.clj, :symbol .}
   :at [clojure.lang.Compiler analyzeSeq Compiler.java 7132]}
  {:type java.lang.IllegalArgumentException
   :message No matching method ceilDiv found taking 2 args for class java.lang.Math
   :at [clojure.lang.Compiler$StaticMethodExpr <init> Compiler.java 1687]}]}

To Reproduce

Load the following client-namespace with jvm < 18

(ns client
  (:require
    [compojure.core :refer [context defroutes]]
    [compojure.route :as route]
    [goose.brokers.redis.broker :as redis]
    [goose.brokers.rmq.broker :as rmq]
    [goose.console :as console]

    [ring.adapter.jetty :as jetty]))


(defonce server (atom nil))

(def redis-producer (redis/new-producer redis/default-opts))
;;(def rabbitmq-producer (rmq/new-producer rmq/default-opts))

(defroutes goose-routes
           (context "/goose" []
                    (partial console/app-handler {:broker       redis-producer
                                                  :app-name     "Goose's client"
                                                  :route-prefix "/goose"}))
           (route/not-found "<h1>Page not found </h1>"))

(defn start-server []
  (reset! server (jetty/run-jetty goose-routes {:port  3004
                                                :join? false})))

(defn stop-server []
  (when-let [s @server]
    (.stop s)
    (println s "Stopped")))

(start-server)

Versions

  1. Goose: 0.5.0
  2. Clojure: 1.11.0

Screenshots

If applicable, add screenshots to help explain your problem.

@alishamohanty alishamohanty added the bug Something isn't working label May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant