-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resource not found by dependency jar #2
Comments
Hello, I am assuming that you creating RandomFullName in this sample project. RandomFullName is a strategy which relies on PickFromFile which internally uses FlatFileContentStore to load the .dat file. FlatFileContentStore uses File(this::class.java.getResource("/data/").path) to load all the resources present under /data/ directory. Since, FlatFileContentStore uses File(..) it probably is not able to access resources outside JAR. But, will check and come back to you. |
That's correct. I copied (and modified the RandomFullName to the sample project) which indeed uses the class FlatFileContentStore from data-anon.jar file.
That clarifies a bit. I assumed that as long as the resources are in the class path it should be able to find the file, but that might not be the case then. Thanks for looking into this! I said it before, nice project this is! |
Thanks for the feedback .. we will get back to you shortly |
I've modified this sample project quite a bit. I added a new
RandomFullName
strategy that actually uses seperate resource files for male and female first names. It basically is a modified version of thecom.github.dataanon.strategy.name.RandomFullName
class.I build the executable jar file with
mvn package
, but when running the jar file it gives me the following error about the resource not being found, although its in the jar file.I'm not very experienced with java/kotlin, but if I understand this correctly: the resource inside the generated jar-file must be accessible from the dependency-jar (
data-anon-0.9.4.jar
), but somehow does not have access.The pom.xml is pretty much unchanged from this sample project (except for a few extra dependencies).
I've put quite some time now in this issue and it's driving me crazy 😏 . Any idea how this can solved? Thanks a lot!!
The text was updated successfully, but these errors were encountered: