I have written an application that uses a custom java 7 FilesystemProvider.
To register this provider, it's necessary to put a file named java.nio.file.spi.FileSystemProvider into META-INF/services directory. When packaging this with one-jar I didn't get it working yet.
I already tried different things.
With having the META-INF/services folder only in my main.jar, I get the exception
java.nio.file.ProviderNotFoundException: Provider "ftp" not found".
So it looks like in this way the file is not even read by java.
Then I put the META-INF/services directly to the top level of packaged one-jar. This way it looks like the file is read correctly, because I get this exception:
java.util.ServiceConfigurationError: java.nio.file.spi.FileSystemProvider: Provider de.stiffi.nio.filesystemproviders.ftp.FTPFileSystemProvider not found
In this way it looks like the file inside META-INF/services is read but java can't find the FTPFileSystemProvider class. It doesn't matter if I put the class as a jar into the lib dir or if I put the .class files directly to main.jar.
Any idea? The only hint I found was on the one-jar homepage in the acknowledgements where Simon mentions that someone helped him with the "META-INF/services" thing.
Log in to post a comment.