-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
FileWritableDataSource :file:/xx/xx.jar!/BOOT-INF/classes!/FlowRule.json (no such file or directory) #634
Comments
FileWritableDataSource :file:/xx/xx.jar!/BOOT-INF/classes!/FlowRule.json (no such file or directory)Issue DescriptionFileWritableDataSource :file:/xx/xx.jar!/BOOT-INF/classes!/FlowRule.json (no such file or directory) Describe what happened (or what feature you want)i wanted to load local FlowRule.json,when i run application with jar,i found the error. |
Hi, please check whether your file path is correct. |
file path is correct, when i use intellij ,it work.But ,when i package, use 'java -jar xx.jar',it faild. i think the reason is that the method **new File(path) ** cannot read the file in jar |
Maybe you can try this: https://stackoverflow.com/questions/20389255/reading-a-resource-file-from-within-jar |
Maybe we need Then we could write a overload constructor method to accept |
i know the way,but the load file in your sentinel-datasource-extension.jar,i cant rewrite |
you are right |
welcome to contribute. You could create pull request to enhance it. |
fine,i will do that,thanks @fangjian0423 @sczyh30 |
Contributions are welcomed :) |
[ISSUE#403] add the conf/plain_acl.yml file for acl_feature.
Issue Description
FileWritableDataSource :file:/xx/xx.jar!/BOOT-INF/classes!/FlowRule.json (没有那个文件或目录)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.(FileOutputStream.java:213)
at java.io.FileOutputStream.(FileOutputStream.java:162)
at com.alibaba.csp.sentinel.datasource.FileWritableDataSource.write(FileWritableDataSource.java:73)
at com.alibaba.csp.sentinel.command.handler.ModifyRulesCommandHandler.writeToDataSource(ModifyRulesCommandHandler.java:108)
at com.alibaba.csp.sentinel.command.handler.ModifyRulesCommandHandler.handle(ModifyRulesCommandHandler.java:68)
at com.alibaba.csp.sentinel.transport.command.http.HttpEventTask.run(HttpEventTask.java:89)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Describe what happened (or what feature you want)
i wanted to load local FlowRule.json,when i run application with jar,i found the error.
i think the new File(filepath) method dont work,when the file in jar
The text was updated successfully, but these errors were encountered: