java - 无法通过命令行使用那边连接

标签 java maven truezip

我已经通过 Spring IDE 启用了 overthereconnection,但是当我尝试通过命令行运行我的 maven 构建的应用程序时,我收到此错误:

Exception in thread "main" java.util.ServiceConfigurationError: jar (Unknown file system scheme! May be the class path doesn't contain the respective driver module or it isn't set up correctly?)
        at de.schlichtherle.truezip.fs.FsAbstractCompositeDriver.newController(FsAbstractCompositeDriver.java:33)
        at de.schlichtherle.truezip.fs.FsDefaultManager.getController0(FsDefaultManager.java:95)
        at de.schlichtherle.truezip.fs.FsDefaultManager.getController(FsDefaultManager.java:78)
        at de.schlichtherle.truezip.file.TFile.getController(TFile.java:1497)
        at de.schlichtherle.truezip.file.TFile.parse(TFile.java:687)
        at de.schlichtherle.truezip.file.TFile.<init>(TFile.java:659)
        at de.schlichtherle.truezip.file.TFile.<init>(TFile.java:601)
        at nl.javadude.scannit.reader.TFiles.tFile(TFiles.java:23)
        at nl.javadude.scannit.reader.ArchiveEntrySupplier.withArchiveEntries(ArchiveEntrySupplier.java:23)
        at nl.javadude.scannit.Worker.scanFiles(Worker.java:59)
        at nl.javadude.scannit.Worker.scanURI(Worker.java:53)
        at nl.javadude.scannit.Worker.scan(Worker.java:46)
        at nl.javadude.scannit.Scannit.<init>(Scannit.java:41)
        at com.xebialabs.overthere.Overthere.boot(Overthere.java:74)
        at com.xebialabs.overthere.Overthere.<clinit>(Overthere.java:69)
        at com.emc.ondemand.agent.core.discovery.AnalyzeSelf.constructODEnvironmentForSingleHost(AnalyzeSelf.java:172)
        at com.emc.ondemand.agent.core.discovery.DiscoverEnvironment.discoverEnvironment(DiscoverEnvironment.java:85)
        at com.emc.ondemand.agent.core.discovery.DiscoverEnvironment.main(DiscoverEnvironment.java:48)

我的代码调用如下所示:

    // establish winrm connection to target host
    ConnectionOptions options = new ConnectionOptions(); 
    options.set(ADDRESS, myHost.getIP()); 
    options.set(USERNAME, user); 
    options.set(PASSWORD, pass); 
    options.set(OPERATING_SYSTEM, WINDOWS); 
    options.set(CONNECTION_TYPE, WINRM_NATIVE); // was not able to get WINRM_INTERNAL to work with processes
    connection = Overthere.getConnection("cifs", options);

这是我唯一的依赖项:

    <dependency>
        <groupId>com.xebialabs.overthere</groupId>
        <artifactId>overthere</artifactId>
        <version>4.2.1</version>
    </dependency>

它确实引入了正确的 Truezip 类,所以我不知道它到底意味着什么。

最佳答案

我猜你的依赖是一个 uber-JAR?请检查类路径上是否有名为 META-INF/services/de.schlichtherle.truezip.fs.spi.FsDriverService 的文件。其中,它需要包含以下条目:

de.schlichtherle.truezip.fs.archive.zip.ZipDriverService

如果情况并非如此,请联系 overthere Artifact 的创建者,并告诉他们他们似乎错误地从 TrueZIP 依赖​​项组装了他们的 Artifact 。

在所有情况下,您应该能够通过向类路径添加另一个依赖项来解决此问题:

<dependency>
  <groupId>de.schlichtherle.truezip</groupId>
  <artifactId>truezip-driver-zip</artifactId>
  <version>7.7.9</version>
</dependency>

关于java - 无法通过命令行使用那边连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35585879/

相关文章:

java - 在Android中从StackMob查询(匿名内部类)中提取对象的正确方法

java - 调用Applet时出现ClassNotFound异常

java - org.apache.derby.jdbc.ClientDriver 在哪里?

java - 通过 appassembler-maven-plugin 生成的脚本无法在 Spring Boot 应用程序中找到主类

java - 如何使用 TrueZip 创建 zip 文件?

java - 使用 Truezip 将新文件添加到 zip 存档

java - 如何在 Mule 连接器中添加下拉列表项?

linux - Java war 文件被错误地(?)检测为无效的 zip 文件

java - 为 Maven 插件运行单元测试时抛出异常 - ComponentLookupException::NoSuchElementException::RepositorySystem

java - TrueZip 随机访问功能