-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Hi, We deploy our application as war with embedded Tomcat. During the initialization mutagen.initialize("org/example/cassandra/migrations") fails to find the resources within the "org/example/cassandra/migrations" which is available under WEB-INF/classes/. The reason, I believe, is because of the URI parsing logic and reading in ResourceScanner. While running, ResourceScanner.getResources() will identify the URL of the migrations path as "jar:file:/var/lib/exmaple.war!/WEB-INF/classes!/org/example/cassandra/migrations". Note the "!" after "classes". ResourceScanner.getResources(URI, Pattern) method parses the URI string by the first "!" character and tries to match it ResourceScanner.getResourcesFromJarFile() against a entry name. The entry names will come up as "/WEB-INF/classes/org/example/cassandra/migrations" for a CQL file within that directory and fails against comparison with rest of the split string "/WEB-INF/classes!/org/example/cassandra/migrations", eventually resulting in exception "Could not find resources on path org/example/cassandra/migrations ..".
Tentative solution
- parse the string and replace "!" char, so that "WEB-INF/classes!/.." becomes "WEB-INF/classes/..", so that "resourcePathPrefix" in ResourceScanner.getResourcesFromJarFile() works during comparison.