Hi everybody
i am running kitchen on linux,but sometimes an error occured,the message is below:
this error is not occured every times ,i saw the code of Kettle i found the class KettleVFS handle the relative path and return a full path which use VFS
from the test i know when the fsManager is closed the error will occured and from the code the fsManager will colsed at the jvm exit,why fsManager closed when i init Kettle anybody can help me!
i am running kitchen on linux,but sometimes an error occured,the message is below:
Code:
Unable to get VFS File object for filename '/home/hadaemon/.kettle/plugins' : Could not find file with URI "/home/hadaemon/.kettle/plugins" because it is a relative path, and no base URI was provided.
Code:
fsm = new StandardFileSystemManager();
try {
fsm.setFilesCache(new WeakRefFilesCache());
fsm.init();
} catch (FileSystemException e) {
e.printStackTrace();
}
// Install a shutdown hook to make sure that the file system manager is closed
// This will clean up temporary files in vfs_cache
Runtime.getRuntime().addShutdownHook(new Thread(new Runnable(){
@Override
public void run() {
if (fsm != null) {
System.out.println("destroy");
fsm.close();
}
}
}));
Code:
FileSystemManager fsManager = getInstance().getFileSystemManager();
...
if(fsOptions != null) {
fileObject = fsManager.resolveFile(filename, fsOptions);
} else {
fileObject = fsManager.resolveFile(filename);
}
return fileObject;