immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
2015-11-30T14:43:16.000155Z

@jaen: immutant.util/at-exit

2015-11-30T14:45:06.000156Z

and i don't think you can do (-> resource file) even outside the container if that resource is coming from an archive on the classpath

jaen 2015-11-30T14:58:07.000157Z

@jcrossley3: thanks a lot. Yeah, I noticed that later on when tried to make a uberjar, that only file:// protocol works, both vfs:// and jar:// don't, that said jolpin couldn't find migrations when deployed inside Wildfly for some reason. Granted, I might have messed classpaths somehow, I know next to nothing about deploying Java.

2015-11-30T15:09:56.000159Z

@jaen: i would expect joplin to be able to find any resources on the classpath whether inside or outside the container

jaen 2015-11-30T15:13:03.000160Z

@jcrossley3: So did I, but for some reason when I had $PROJECT_ROOT/db added to resource paths and used migrations/jdbc as the directory (relative to db) outside of container it worked, insider of the container it refused to work and I couldn't figure out why. In the end I patched joplin to work with vfs:// resources, but maybe this isn't the right solution indeed.

2015-11-30T15:17:34.000161Z

hmm, i could see vfs being a problem there, actually 😞

2015-11-30T15:19:12.000162Z

vfs has been a bit of a bane for us for years

2015-11-30T15:22:19.000163Z

still, i wouldn't have expected joplin to care about the resources' protocol, though if it's trying to construct new paths from relative parts, it might.

jaen 2015-11-30T15:25:17.000164Z

Yeah, it's kinda vexing you expect to get a File, but VirtualFile is not a File. I'm not sure what the problem exactly was, here's how the lookup code looks in vanilla joplin - https://github.com/juxt/joplin/blob/master/joplin.core/src/joplin/core.clj#L73-L102 - there are three cases (relative file path, folder on classpath, folder inside a jar on classpath) and for some reason inside Wildfly none of the three caught it when I debugged.

jaen 2015-11-30T15:25:28.000167Z

Outside of it all was well.

2015-11-30T15:31:54.000168Z

that VirtualFile replicates most of File's methods but doesn't extend File reveals a limitation of OOP, IMHO

2015-11-30T15:32:22.000169Z

but it's not clear to me from glancing at that code why none of those cases triggered

jaen 2015-11-30T15:35:49.000170Z

Yeah, not being able to add to a hierarchy from the outside is a pretty big limitation, I agree. Well, I expected the "search in jars on the classpath" to work but somehow it didn't, maybe I'm just misunderstanding how jars/classpath work, I'll try again later (maybe I missed something obvious), but the VFS workaround is quite enough for now.

2015-11-30T15:40:41.000171Z

cool

jaen 2015-11-30T17:39:04.000172Z

@jcrossley3: judging by the feature demo when deploying standalone by uberjar the SSL keystores should work if they are located under resource root, right? I can't seem to get it to work for some reason. Should the files paths be relative to project root or resource root?

2015-11-30T17:45:04.000173Z

@jaen: this is without wildfly, right?

jaen 2015-11-30T17:46:04.000174Z

@jcrossley3: Yes, this is without Widlfly.

2015-11-30T17:47:24.000175Z

the paths for the certs should be relative to the CWD when you invoke the uberjar

2015-11-30T17:48:20.000176Z

java -jar target/demo-standalone.jar http2? false

jaen 2015-11-30T17:49:02.000177Z

Aaaah

jaen 2015-11-30T17:49:09.000178Z

So it's looking relative to where you run Java from

jaen 2015-11-30T17:49:14.000179Z

It's not looking inside the jar

2015-11-30T17:49:18.000180Z

correct

jaen 2015-11-30T17:49:21.000181Z

Ok, that explaisn a lot.

2015-11-30T17:49:26.000183Z

:simple_smile:

jaen 2015-11-30T17:49:38.000184Z

Thanks!

2015-11-30T17:49:44.000185Z

sure thing!

2015-11-30T17:51:00.000186Z

@jaen: you can use absolute paths, too, of course

2015-11-30T17:51:13.000187Z

but the feature-demo is using relative ones

jaen 2015-11-30T17:52:30.000188Z

Right; I was just somehow confused thinking the lookup differes between out of uberjar and inside it, that is it would look relative to the jar when run from uberjar. Not sure why did I think that. This cleared it up for me.

2015-11-30T17:52:43.000189Z

cool

2015-11-30T17:55:21.000190Z

@jaen: if using wildfly, relative paths will be resolved using the working directory from where you started wildfly

jaen 2015-11-30T17:56:00.000191Z

Right, that makes sense. That said, aren't those options ignored then anyway and you have to configure the listener in Wildfly?

2015-11-30T17:56:19.000192Z

er... yeah. good point. :simple_smile:

jaen 2015-11-30T17:57:13.000193Z

I mean, I'm not sure, I think they should be (like host and :port), but didn't check that its' the case.

2015-11-30T17:57:54.000194Z

yeah, all of that ssl/http2 config ultimately resolves to a :configuration builder, which will be ignored within wildfly

jaen 2015-11-30T17:59:00.000195Z

Yeah, but what I mean is - maybe, I didn't check - it tries to read keystore files before the configuration builder is ignored, which would result in an exception.

2015-11-30T17:59:34.000196Z

yeah, probably

jaen 2015-11-30T17:59:43.000197Z

So if that's the case I would have to not specify those explicitly, which I'm doing when deploying to Wildfly just to be sure, but I don't know if it's necessary.

2015-11-30T18:00:23.000198Z

i can't decide whether that's a bug or not :simple_smile:

2015-11-30T18:01:43.000199Z

the whole "configuration-is-ignored-when-in-wildfly" thing is troublesome to me. our thinking was that those two user bases would never intersect

jaen 2015-11-30T18:09:44.000201Z

I'm mostly intersecting only because I can't decide which makes more sense to me yet

jaen 2015-11-30T18:11:35.000202Z

Wildfly is actually pretty enticing in how it just lets you drop the war inside and don't bother with anything else.

jaen 2015-11-30T18:40:49.000203Z

Fixed the keystores, works well now, thanks again!

2015-11-30T18:42:59.000204Z

any time!