cssxsh / mirai-openai-plugin

Mirai Console OpenAI ChatBot 插件
GNU Affero General Public License v3.0
130 stars 14 forks source link

1.0.4版本启动插件失败 #4

Closed gaylong9 closed 1 year ago

gaylong9 commented 1 year ago

mirai版本:2.13.2,插件版本1.0.4

12:44:16 [INFO] Verifying "net.mamoe:mirai-console" v2.13.2
12:44:16 [INFO] Verifying "net.mamoe:mirai-console-terminal" v2.13.2
12:44:17 [INFO] Verifying "net.mamoe:mirai-core-all" v2.13.2
12:44:17 [INFO] Verifying "org.itxtech:mcl-addon" v2.1.1
12:44:17 [INFO] Verifying "net.mamoe:chat-command" v0.5.1
12:44:17 [INFO] Verifying "xyz.cssxsh.mirai:mirai-openai-plugin"
12:44:17 [INFO] Updating "xyz.cssxsh.mirai:mirai-openai-plugin" to v1.0.4
Downloading mirai-openai-plugin-1.0.4.jar [==============================] 374.21 KB
Downloading mirai-openai-plugin-1.0.4.jar.sha1 [==============================] 40 B

插件通过mcl命令方式安装。

启动mcl时报错如下:

2022-12-08 12:44:26 E/mirai-openai-plugin: net.mamoe.mirai.console.internal.util.ServiceLoadException: Could not load service xyz.cssxsh.mirai.openai.MiraiOpenAiListener.
net.mamoe.mirai.console.internal.util.ServiceLoadException: Could not load service xyz.cssxsh.mirai.openai.MiraiOpenAiListener.
        at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:60)
        at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadAllServices(PluginServiceHelper.kt:42)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin$special$$inlined$services$2.invoke(MiraiOpenAiPlugin.kt:31)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin$special$$inlined$services$2.invoke(MiraiOpenAiPlugin.kt:27)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.getListeners(MiraiOpenAiPlugin.kt:24)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.onEnable(MiraiOpenAiPlugin.kt:55)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:131)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:305)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:35)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:50)
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:173)
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:175)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:336)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:508)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:177)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:176)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:54)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.base/java.lang.reflect.Method.invoke(Unknown Source)
        at org.itxtech.mcl.Utility.bootJars(Utility.java:86)
        at org.itxtech.mcl.Utility.bootJars(Utility.java:76)
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:98)
        at org.itxtech.mcl.module.builtin.Boot.boot(Boot.java:113)
        at org.itxtech.mcl.module.ModuleManager.phaseBoot(ModuleManager.java:123)
        at org.itxtech.mcl.Loader.lambda$start$4(Loader.java:196)
        at org.itxtech.mcl.Loader.tryCatching(Loader.java:151)
        at org.itxtech.mcl.Loader.start(Loader.java:196)
        at org.itxtech.mcl.Loader.main(Loader.java:84)
Caused by: java.lang.NoClassDefFoundError: io.ktor.client.plugins.contentnegotiation.ContentNegotiation
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.openai.OpenAiClient$http$1.invoke(OpenAiClient.kt:28)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.openai.OpenAiClient$http$1.invoke(OpenAiClient.kt:27)
        at legacy-compatibility-layer//io.ktor.client.HttpClientKt.HttpClient(HttpClient.kt:41)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.openai.OpenAiClient.<init>(OpenAiClient.kt:27)
        at mirai-openai-plugin-1.0.4.jar//xyz.cssxsh.mirai.openai.MiraiOpenAiListener.<clinit>(MiraiOpenAiListener.kt:27)
        at java.base/java.lang.Class.forNameImpl(Native Method)
        at java.base/java.lang.Class.forName(Unknown Source)
        at net.mamoe.mirai.console.internal.util.PluginServiceHelper.loadService(PluginServiceHelper.kt:51)
        ... 31 more
Caused by: java.lang.ClassNotFoundException: io.ktor.client.plugins.contentnegotiation.ContentNegotiation
        at java.base/java.net.URLClassLoader.findClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClassHelper(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginClassLoaderN.loadClass(JvmPluginClassLoader.kt:435)
        ... 39 more
cssxsh commented 1 year ago

at mirai-openai-plugin-1.0.4.jar

你这个下载出错了应该是 mirai-openai-plugin-1.0.4.mirai2.jar 删掉 plugins 里的 mirai-openai-plugin-1.0.4.jar

让他重新下载

gaylong9 commented 1 year ago

at mirai-openai-plugin-1.0.4.jar

你这个下载出错了应该是 mirai-openai-plugin-1.0.4.mirai2.jar 删掉 plugins 里的 mirai-openai-plugin-1.0.4.jar

让他重新下载

删掉后直接下载了plugin丢上去就好了... 感谢!