Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8268489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:54:24+00:00 2026-06-08T05:54:24+00:00

Building ring server-headless works — lein ring server-headless — but when I try to

  • 0

Building ring server-headless works — lein ring server-headless — but when I try to build the war or uberwar I get the following error, and cannot figure out why this is happening.

No namespaces to :aot compile listed in project.clj.
Exception in thread "main" java.lang.ExceptionInInitializerError, compiling:(ring/util/servlet.clj:62)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6416)
at clojure.lang.Compiler.analyze(Compiler.java:6216)
...

Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at clojure.lang.RT.classForName(RT.java:2013)
at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:938)
at clojure.lang.Compiler$HostExpr.access$400(Compiler.java:710)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6342)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6395)
... 69 more
Caused by: java.lang.Exception: Cyclic load dependency: [ /servlet ]->/ring/util/servlet->[ /servlet ]
at clojure.core$check_cyclic_dependency.invoke(core.clj:5288)
at clojure.core$load.doInvoke(core.clj:5383)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.lang.Var.invoke(Var.java:401)
at servlet.<clinit>(Unknown Source)
... 76 more

My project.clj file is:

(defproject myproj "0.1"
:description "the sample"
:dependencies [
    [org.clojure/clojure "1.3.0"]
    [compojure "1.0.4"]
    [hiccup "1.0.0"]
    [clj-json "0.5.0"]
    [ring/ring "1.1.0"]
    [clj-http "0.1.1"]
]   
:plugins [
    [lein-ring "0.7.0"]
]   
:ring {:handler routes/start})

If I remove the :ring {:handler routes/start} then I get a NPE somewhere else.

I don’t know if I’m missing something in my project.clj, or if the particular version of lein is broken for this use case. Can someone clarify this for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T05:54:25+00:00Added an answer on June 8, 2026 at 5:54 am

    I solved the issue, which was a bit of a mistake on my part. Posting the answer here in case anyone makes the same mistake.

    I had something like the following in src/routes.clj:

    (defroutes main-routes
        (GET "/some/path" [& params] (some-code params))
        (route/resources "/")
        (route/not-found "not found"))
    
    (def start (run-jetty (handler/site main-routes) {:port 8080}))
    

    This is all standard code to setup routes and provide a hook to start the jetty webapp from the command line via lein ring server-headless. Except that I declared start as a global instead of a function. That means when I run lein ring server-headless things still work, but when I run lein ring uberwar I end up with a weird configuration–a full jetty server will try to start up with it’s servlet, AND uberwar has generated a servlet and is trying to package it into a jar.

    When I was comparing my code against the compojure examples I kept missing this difference I guess because def and defn optically look so similar. But anyway I just made this change to get it working:

    (defn start [] (run-jetty (handler/site main-routes) {:port 8080}))  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know it's possible to create a war file using lein ring war ,
Building a website. When I order my tags like this, LightCycle works but Lightbox
Building application with Phonegap Build, but i don't know why the application couldn't install
I'm building a Clojure Noir web application to run as a WAR file in
building libraries with waf is nice and I like the lib<targetname> naming scheme. But
Building a site on CargoCollective, but it appears they use jQuery 1.4.2 which seems
Building a string for post request in the following way, var itemsToAdd = sl.SelProds.ToList();
Building my code (below) returns error 'imread' is not a member of 'cv' .
Building a Monodroid application we've been using Protobuf-net for serialization. It works in debug
Building a multi-language application in Java. Getting an error when inserting String value from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.