problem using boot-clj to build uberjar that starts up a component based system

Skip to first unread message

Matthias Sattel

Jul 13, 2015, 9:53:22 AM7/13/15
I am currently using the component library from Stuart Sierra to build up a system. So far it works on the repl and in my tests, but somehow when I build the uberjar using boot.clj and execute it, the system doesn't start.

(defn -main
  "Startup the embedded http server and the other components."
  [& args]
  (let [system (system/my-system {})]
      (info "Try to start my system " system)
      (component/start system))))

And my-system is build as follows:

(defn my-system [config-options]
    (info "Building my system")
    (-> (component/system-map
         :my-storage (my-storage-test-component/new-storage)
         :http (http-component/new-http-server (http-port (:http-port config-options)) (wrap-handler)))
        (component/system-using {:http {:storage :my-storage}}))

I added those log outputs because I am new to clojure and have not debugged clj code yet.
On the repl I can call the -main function and it startsup the system as expected, but when I build an uberjar with boot and start it, then it just logs the two info messages on the command line, then it seems to do nothing for some seconds and then it stops.

Any help would be great, maybe you guys can tell me how I can find the problem. Can I somehow debug into that when I run the jar file??? Could it be a problem with aot?

This is my boot config:
    pom {
        :project 'my-project
        :version "0.1.0-SNAPSHOT" }
    aot {:namespace '#{myproject.embedded-main}}
    jar {
        :manifest {"description" "Testing boot"}
        :main 'myproject.embedded-main })

(deftask build
     "Building the project"

Ragnar Dahlén

Jul 13, 2015, 9:58:34 AM7/13/15
Hi Matthias,

I encountered similar symptoms (basically a corrupt uberjar) which I eventually tracked down to file handle leaks and fixed in:

This PR has been merged but not been released yet, so I'd give boot master a go and see if that fixes your problem.

Colin Yates

Jul 13, 2015, 9:59:33 AM7/13/15
Assuming -main is defined in myproject/embedded-main.clj then you need to know Java doesn’t like - in filenames so the actual class is my project.embedded_main. It is fine to include - when referring to Clojure construct (symbols etc.), but when defining a Java construct you need to use “_”.

Also, you don’t need (do…) in your defns like that.

You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
For more options, visit

Matthias Sattel

Jul 13, 2015, 5:05:11 PM7/13/15
Hi Ragnar,
your fix solved my issue. With the latest boot version I can build the uberjar and start the system as expected. Thanks a lot. So far I like boot a lot, very interesting build tool.
Reply all
Reply to author
0 new messages