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 3454266
In Process

The Archive Base Latest Questions

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

I’ve written a little internal webapp that I use to import invoices from our

  • 0

I’ve written a little internal webapp that I use to import invoices from our jobcard database into MYOB. I’ve written it using Clojure and Compojure, and it actually works pretty well, and it was also a good learning exercise for me.

However, I’ve got a problem, it seems that after a successful invoice import the jetty server will no longer serve the static CSS file.

The defroute is as follows:

(defroutes static-routes
  (GET ["/:filename" :filename #".*"] [filename]
       (response/file-response filename {:root "public"})))

(The file is just css/default.css, it works just perfectly before the first import.)

Now I think I’ve found the problem, it seems that the MYOB ODBC driver is changing the working directory of the Jetty server (and my REPL), because when I enter the following in the REPL:

(file-seq (File. "."))

I get a listing of my Temp files directory, which would explain why my CSS file is no longer being found.

The odd thing is, if I do:

(.getAbsolutePath (File. "."))

I get the correct directory of my application.

Does anyone know of something (other than coding in an absolute path) that can get around this quirk of the MYOB ODBC driver?

I’m guessing that I could just grab and store the absolute path when I start up, but would that work with an uberjar?

Edit:
It seems that it is impossible to fix due to limitations in the JVM?

How do I change directory in command line with Clojure?

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

    There doesn’t really seem to be much that can be done about this. It just seems that the MYOB ODBC bridge is just bad.

    So in order to get around this, I’ve replaced my relative file calls to use .getAbsolutePath.

    e.g.

    (java.io.File. (.getAbsolutePath (java.io.File. "templates/index.html")))
    

    I’ve also changed it so static file requests use a absolute file path:

    (defroutes static-routes
      (GET ["/:filename" :filename #".*"] [filename]
           (response/file-response filename {:root (.getAbsolutePath (java.io.File. "public"))})))
    

    I haven’t just tried creating an uberjar, so I expect I might get some problems there.


    Just an update to this, using Compojure’s resources function seems to skip with problem entirely, also working without problems when creating an UberJar.

    So I no longer have “static-routes” defined anymore, I just use:

     (route/resources "/")
    

    And have the files in my resources/public directory in the root directory of my project.

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

Sidebar

Related Questions

Let's say I'm outputting a post title and in our database, it's Hello Y’all
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have a view passing on information from a database: def serve_article(request, id): served_article
I am currently running into a problem where an element is coming back from
this is what i have right now Drawing an RSS feed into the php,
I am confused How to use looping for Json response Array in another Array.
I've got a string that has curly quotes in it. I'd like to replace
I have a small JavaScript validation script that validates inputs based on Regex. I
I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.

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.