Hello lovely people... I am in the process of upgrading our app form a very old version of immutant (1.x.x) to version 2.x and running into a weird problem. in our code we do a (.getPath (<http://clojure.java.io/resource|clojure.java.io/resource> filename))
and on the 1.x version this points to the right files... on the version 2.x it goes to /content/.../.../...
and we are getting a FileNotFoundExp
Any idea what we are doing wrong here?
@thomas Are you running this app inside WildFly?
and what are you wanting to do with the resource? do you have to have it as a file? or will reading it as an inputstream suffice?
under 1.x, your app was exploded to a directory. Under 2.x, it is a jar, so io/resource
will give back a jar url, if I remember correctly
I am now
it is a file
under Wildfly, it won't be a file though - it will be an entry in a jar file
yes.
just as it would in an uberjar
I have seen that... but even then the path start with /content/.../...
it is a jar in a jar that has the file in it
most of the path is correct... just the first bit of it is wrong
can you share the full url you get back?
or maybe a VFS path
true
doh.. I can't seem to copy and paste the path from the virtualbox... 😞
no worries - if you (str url)
, does it start with vfs:
or jar:
?
let me try
Either way, it doesn't really matter I guess - if you have to treat it as a file, you'll have to write the jarentry out as one: (io/copy (io/input-stream (io/resource filename)) (io/file "/some/tmp/path"))
I guess I can treat it as stream...
the lib I use next can take a stream
ah, good deal
compiling...
ok that looks a lot better...
but what is the standard port for wildfly?
by default, it binds to localhost:8080, same as immutant 1.x
hmmmm. it says it failed to start...
but that is something for tomorrow.
let us know how it goes, we're here to help
Thank you for your help @tcrawley
my pleasure!
just restarted the wildfly server and now i get a 404 at least
🙂
yay! progress! :)