【发布时间】:2013-11-04 20:29:01
【问题描述】:
我正在尝试使用 glassfish 4 上部署的应用程序中的 truevfs 库。如果在独立的 java-se 应用程序中使用下面的代码效果很好,但在 glassfish 内部使用时无法查找文件系统提供程序。
这应该有效吗?我有什么选择?
代码:
Path uriPath = new TPath(new URI("http://localhost:8080/mytar.tar"));
try (FileSystem zipfs = FileSystems.newFileSystem(uriPath, null)) {
Path pathInZipfile = zipfs.getPath("/"); // <-- error thrown here
...
}
pom:
<dependency>
<groupId>net.java.truevfs</groupId>
<artifactId>truevfs-profile-default</artifactId>
<version>0.10.4</version>
<type>pom</type>
</dependency>
和错误:
Caused by: java.nio.file.ProviderNotFoundException: Provider not found
at java.nio.file.FileSystems.newFileSystem(FileSystems.java:403)
【问题讨论】:
标签: jakarta-ee glassfish-4 serviceloader truevfs