FileSystemException when I call deletePlugin after getExtensions

29 views
Skip to first unread message

pavlo.v...@gmail.com

unread,
Jul 24, 2017, 12:07:36 PM7/24/17
to pf4j
Hi, 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.

Can anybody help me?

Decebal Suiu

unread,
Jul 24, 2017, 4:36:46 PM7/24/17
to pf4j, pavlo.v...@gmail.com
Hi,

See what application/process uses that jar (use TaskManager from windows if your OS is windows). 

pavlo.v...@gmail.com

unread,
Jul 24, 2017, 4:51:17 PM7/24/17
to pf4j, pavlo.v...@gmail.com
jar is used only by my application (os windows)
if I don't use getExtensions(Class<T> type) method, deletePlugin(String pluginId) is successful

Decebal Suiu

unread,
Jul 28, 2017, 3:43:00 PM7/28/17
to pf4j, pavlo.v...@gmail.com

Decebal Suiu

unread,
Jul 28, 2017, 4:12:08 PM7/28/17
to pf4j, pavlo.v...@gmail.com
I pushed on Github a possible solution for your problem. Please use the updated SNAPSHOT version (1.4.0-SNAPSHOT) and check to see if the problem persist.

Decebal Suiu

unread,
Aug 1, 2017, 1:39:55 PM8/1/17
to pf4j, pavlo.v...@gmail.com
Any progress with testing? Did you encounter problems?
Reply all
Reply to author
Forward
0 new messages