[
https://issues.apache.org/jira/browse/SSHD-736?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16071962#comment-16071962
]
David Ostrovsky commented on SSHD-736:
--------------------------------------
Hi Lyor,
I'm sorry for answering only now. Somehow I managed to missed your last
comment. Sorry again.
Yes, we start the file system our self, and only in development mode, and not
in production code path, see at
com.google.gerrit.launcher.GerritLauncher.newZipFileSystem(GerritLauncher.java:375)
at: [1].
{code:java}
public static FileSystem newZipFileSystem(Path zip) throws IOException {
return FileSystems.newFileSystem(
URI.create("jar:" + zip.toUri()), Collections.<String,
String>emptyMap());
}
{code}
The idea behind it, that we shortcut some servlets in the development mode. In
production the underlying HTML code is vulcanized and minified and those
development servlets are not involved.
You can see this condition on one of two servlets:
{code:java}
@Provides
@Singleton
FontsDevServlet getFontsServlet(@Named(CACHE) Cache<Path, Resource> cache)
throws IOException {
return getPaths().isDev() ? new FontsDevServlet(cache,
getPaths().builder) : null;
}
{code}
Also note my another suggested workaround, at [2] to disable those servlets,
that would also fix the problem. As the matter of fact, the same code worked as
is in SSHD 1.2 but stopped working in SSHD 1.4.
To mention again, the current workarounds is to strip the offending service
definition in our build tool chain (Bazel):
{code}
# TODO(davido): Remove exlusion of file system provider, when this issue is
fixed:
# https://issues.apache.org/jira/browse/SSHD-736
maven_jar(
name = "sshd",
artifact = "org.apache.sshd:sshd-core:1.4.0",
exclude = ["META-INF/services/java.nio.file.spi.FileSystemProvider"],
sha1 = "c8f3d7457fc9979d1b9ec319f0229b89793c8e56",
)
{code}
> Filesystem collision in development environment
> -----------------------------------------------
>
> Key: SSHD-736
> URL: https://issues.apache.org/jira/browse/SSHD-736
> Project: MINA SSHD
> Issue Type: Question
> Affects Versions: 1.4.0
> Environment: Linux, Gerrit
> Reporter: David Ostrovsky
> Assignee: Goldstein Lyor
> Priority: Minor
>
> In the development environment, we are using java filesystem,
> to short circuit loading of servlets for the JavaScript Polymer UI.
> Since upgrade to 1.4.0 Gerrit refuses to start in such dev environment.
> I seems, that during start of FileSystem, it loads all file system providers
> on the classpath. Since sshd-core is on the lcasspath, it's trying to load
> also {{SftpFileSystemProvider}}, and is failing with class custom exception:
> [1].
> Note, that we don't do that when booting release gerrit version, so we
> do see this poblem only in the development environment.
> We have 2 work arounds so far: disable file system usage in gerrit in this
> code path: [2], or use custom built sshd-core version without this file[3]:
>
> {{sshd-core/src/main/filtered-resources/META-INF/services/java.nio.file.spi.FileSystemProvider}}
> * [1] http://paste.openstack.org/show/604912
> * [2] http://paste.openstack.org/show/604911
> * [3] http://paste.openstack.org/show/604917
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)