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

  • Home
  • SEARCH
  • 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 6721627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:21:07+00:00 2026-05-26T09:21:07+00:00

this is my project.clj file: (defproject org.github.pistacchio.deviantchecker 0.9.0 :description A one page application for

  • 0

this is my project.clj file:

(defproject org.github.pistacchio.deviantchecker "0.9.0"
  :description "A one page application for keeping track of changes on deviantart.com gallieries"
  :dependencies [[org.clojure/clojure "1.2.1"]
                 [org.clojure/clojure-contrib "1.2.0"]
                 [enlive  "1.0.0"]
                 [compojure "0.6.4"]
                 [ring/ring-jetty-adapter "1.0.0-beta2"]]
  :dev-dependencies [[lein-ring "0.4.6"]]
  :ring {:handler org.github.pistacchio.deviantchecker.core/app}
  :main org.github.pistacchio.deviantchecker.core)

and this my routing:

(defroutes main-routes
  (GET "/" [] (get-home))
  (GET "/add" [d] (add-gallery d))
  (GET "/delete" [d] (delete-gallery d))
  (GET "/check" [d] (check-gallery d))
  (route/resources "/")
  (route/not-found "Page not found"))

I have some web static files in /resources/public and I can access them. In the code I also need o access some files on the file system that are located on /resources/data and /resources/tpl. Using lein ring server or lein run, the following call works fine

(java.io.File. "resources/tpl/home.html")

but when packing the application with lein uberwar and deploying under Tomcat it fails and I get a FileNotFoundException. Maybe this is because with lein the current working directory is the project root while under Tomcat it is Tomcat’s bin directory.

For example, I have /resources/data/data.dat that gets packed in the war as /data/data.dat so either “resources/data/data.dat” doesn’t work under Tomcat or “data/data.dat” doesn’t work in development.

By the way, what is the proper way of managing this in Compojure? Thanks.

  • 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-05-26T09:21:07+00:00Added an answer on May 26, 2026 at 9:21 am

    You can use clojure.java.io/resource to access resources whether they’re on the local file system, or packed in a jar/war:

    (require '[clojure.java.io :as io])
    (io/reader (io/resource "public/some/file.txt")) ; file in resource classpath or $root/resources/public...
    

    You probably shouldn’t try to load them from a directory, since you can’t be sure where the file is going to end up when its deployed from a jar/war (or even if it’s on the file system at all, probably).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my project.clj file so far: (defproject raj 0.0.1-SNAPSHOT :description FIXME: write description
I have a simple web app with this project.clj: (defproject squirrel-money 1.0.0-SNAPSHOT :description Squirrel
On this project I am working on right now, one of the newest feature
For this project, I have to have it so that the page loads while
The point of this question is to clear up confusion about Clojure project.clj dependencies
I am asking this question to straighten out a confusion I have about project.clj
This project is the probable first step in migrating a large CMS from Classic
This project started as a development platform because i wanted to be able to
This is the last part of this project, thanks to all who've helped with
Why isn't this project maintained anymore? I love this app, however not updating it

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.