Skip to content
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

FileSystemException when I call deletePlugin after getExtensions #156

Closed
decebals opened this issue Jul 27, 2017 · 2 comments
Closed

FileSystemException when I call deletePlugin after getExtensions #156

decebals opened this issue Jul 27, 2017 · 2 comments

Comments

@decebals
Copy link
Member

decebals commented Jul 27, 2017

I try to use pf4j for dynamic loading plugins from jar files to my app and sometimes I need to update my jars, currently I have problem, getExtensions(Class<T> type) method blocks my jar file and I can't delete it by calling deletePlugin(String pluginId), I receive exception:

[main] INFO ro.fortsoft.pf4j.AbstractPluginManager - Stop plugin 'rule-plugin:0.0.1'
Exception in thread "main" java.lang.RuntimeException: java.nio.file.FileSystemException: d:\plugins\test-rules-1.0-SNAPSHOT.jar: The process cannot access the file because it is being used by another process.
        at ro.fortsoft.pf4j.BasePluginRepository.deletePluginPath(BasePluginRepository.java:75)
        at ro.fortsoft.pf4j.AbstractPluginManager.deletePlugin(AbstractPluginManager.java:301)
        at com.datawatch.PluginsApp.main(PluginsApp.java:47)
Caused by: java.nio.file.FileSystemException: d:\plugins\test-rules-1.0-SNAPSHOT.jar: The process cannot access the file because it is being used by another process.

For more information see https://groups.google.com/forum/#!topic/pf4j/NYVJ6KHqr-I.

@decebals
Copy link
Member Author

I think that the problem appears because I read a file (input stream, reader) and I forget to close it.

decebals added a commit that referenced this issue Jul 28, 2017
@janhoy
Copy link
Member

janhoy commented Sep 8, 2017

Closing. Please re-open or file a new issue if there are still problems :)

@janhoy janhoy closed this as completed Sep 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants