我想在服务器中使用 TrueZIP 7.7 库来解压缩用户上传的档案。我不打算使用加密档案,尤其是因为这是一个服务器,所以我不需要 Swing 弹出窗口来请求密钥。然而,当我为解压缩文件创建了一些简单的测试时,它因以下错误而失败:
java.util.ServiceConfigurationError: de.schlichtherle.truezip.key.spi.KeyManagerService: Provider de.schlichtherle.truezip.fs.archive.zip.raes.PromptingKeyManagerService could not be instantiated: java.lang.NoClassDefFoundError: de/schlichtherle/truezip/swing/EnhancedPanel
at java.util.ServiceLoader.fail(ServiceLoader.java:207)
at java.util.ServiceLoader.access$100(ServiceLoader.java:164)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:353)
at java.util.ServiceLoader$1.next(ServiceLoader.java:421)
at de.schlichtherle.truezip.key.sl.KeyManagerLocator$Boot.<clinit>(KeyManagerLocator.java:60)
at de.schlichtherle.truezip.key.sl.KeyManagerLocator.get(KeyManagerLocator.java:41)
at de.schlichtherle.truezip.key.AbstractKeyManagerProvider.get(AbstractKeyManagerProvider.java:22)
at de.schlichtherle.truezip.fs.archive.zip.KeyController.getKeyManager(KeyController.java:62)
at de.schlichtherle.truezip.fs.archive.zip.KeyController.sync(KeyController.java:129)
at de.schlichtherle.truezip.fs.FsDecoratingController.sync(FsDecoratingController.java:131)
at de.schlichtherle.truezip.fs.FsFalsePositiveArchiveController.sync(FsFalsePositiveArchiveController.java:480)
at de.schlichtherle.truezip.fs.FsManager.sync(FsManager.java:105)
at de.schlichtherle.truezip.fs.FsDefaultManager.sync(FsDefaultManager.java:190)
at de.schlichtherle.truezip.fs.FsSyncShutdownHook$Hook.run(FsSyncShutdownHook.java:93)
Caused by: java.lang.NoClassDefFoundError: de/schlichtherle/truezip/swing/EnhancedPanel
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at de.schlichtherle.truezip.fs.archive.zip.raes.PromptingKeyManagerService.<init>(PromptingKeyManagerService.java:37)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:345)
... 11 more
Caused by: java.lang.ClassNotFoundException: de.schlichtherle.truezip.swing.EnhancedPanel
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 31 more
是否可以完全禁用 TrueZIP 密钥管理,或者至少确保它不需要任何 Swing 组件来提取 ZIP 文件?