cssxsh / mirai-openai-plugin

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

mirai启动时报java.lang.NoSuchMethodError,插件无法正常启用 #7

Closed enjoyuruf closed 1 year ago

enjoyuruf commented 1 year ago
2022-12-20 20:45:48 E/mirai-openai-plugin: java.lang.NoSuchMethodError: 'net.mamoe.mirai.console.plugin.jvm.JvmPluginClasspath xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.getJvmPluginClasspath()'
java.lang.NoSuchMethodError: 'net.mamoe.mirai.console.plugin.jvm.JvmPluginClasspath xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.getJvmPluginClasspath()'
        at xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.access$getJvmPluginClasspath(MiraiOpenAiPlugin.kt:14)
        at xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin$special$$inlined$services$1.invoke(MiraiOpenAiPlugin.kt:33)
        at xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin$special$$inlined$services$1.invoke(MiraiOpenAiPlugin.kt:31)
        at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
        at xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.getConfig(MiraiOpenAiPlugin.kt:25)
        at xyz.cssxsh.mirai.openai.MiraiOpenAiPlugin.onEnable(MiraiOpenAiPlugin.kt:40)
        at net.mamoe.mirai.console.internal.plugin.JvmPluginInternal.internalOnEnable$mirai_console(JvmPluginInternal.kt:113)
        at net.mamoe.mirai.console.internal.plugin.BuiltInJvmPluginLoaderImpl.enable(BuiltInJvmPluginLoaderImpl.kt:122)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt)
        at net.mamoe.mirai.console.plugin.jvm.JvmPluginLoader$BuiltIn.enable(JvmPluginLoader.kt:36)
        at net.mamoe.mirai.console.plugin.PluginManager.enablePlugin(PluginManager.kt:129)
        at net.mamoe.mirai.console.internal.plugin.PluginManagerImpl.enableAllLoadedPlugins$mirai_console(PluginManagerImpl.kt:172)
        at net.mamoe.mirai.console.internal.MiraiConsoleImplementationBridge.doStart$mirai_console(MiraiConsoleImplementationBridge.kt:214)
        at net.mamoe.mirai.console.MiraiConsoleImplementation$Companion.start(MiraiConsoleImplementation.kt:276)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon(MiraiConsoleTerminalLoader.kt:152)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.startAsDaemon$default(MiraiConsoleTerminalLoader.kt:151)
        at net.mamoe.mirai.console.terminal.MiraiConsoleTerminalLoader.main(MiraiConsoleTerminalLoader.kt:47)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.itxtech.mcl.Utility.bootMirai(Utility.java:84)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:138)
        at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:226)
        at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1692)
        at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1013)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:109)
        at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:412)
        at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3578)
        at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:107)
        at org.mozilla.javascript.ArrowFunction.call(ArrowFunction.java:43)
        at org.mozilla.javascript.InterfaceAdapter.invokeImpl(InterfaceAdapter.java:155)
        at org.mozilla.javascript.InterfaceAdapter.lambda$invoke$0(InterfaceAdapter.java:105)
        at org.mozilla.javascript.Context.call(Context.java:554)
        at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:522)
        at org.mozilla.javascript.InterfaceAdapter.invoke(InterfaceAdapter.java:105)
        at org.mozilla.javascript.jdk18.VMBridge_jdk18$1.invoke(VMBridge_jdk18.java:126)
        at com.sun.proxy.$Proxy4.run(Unknown Source)
        at org.itxtech.mcl.script.ScriptManager.phaseBoot(ScriptManager.java:101)
        at org.itxtech.mcl.Loader.start(Loader.java:128)
        at org.itxtech.mcl.Loader.main(Loader.java:53)

启动时没有提示输入OPENAI_TOKEN,而是报了这样的错误,插件没有正常启用。config文件夹中也没有生成相应的配置文件,请问该如何解决。 我同时还使用了MiraiNativePatPat插件,但我也尝试过将这两个插件删除,单独使用该插件启动mirai,仍然报以上错误。 以下为mirai配置:

Running MiraiConsole v2.8.2, built on 2021-11-20 00:35:26.
Frontend Terminal: version 2.8.2, provided by Mamoe Technologies

Permission Service: Built In Permission Service

Plugins: PatPat v2.0.1, MiraiNative v2.0.5-cp, mirai-openai-plugin v1.0.6
cssxsh commented 1 year ago

Running MiraiConsole v2.8.2

你的 mirai console 版本有点太古早了吧

enjoyuruf commented 1 year ago

建议使用的版本是?

cssxsh commented 1 year ago

建议使用的版本是?

2.12.0+