simple-robot / simpler-robot

Simple Robot,一个bot风格的Kotlin多平台事件调度框架,异步高效、Java友好!/ A Bot-style Kotlin Multiplatform event scheduling framework, asynchronous and high-performance, java-friendly! 🐱😼😻😸
https://simbot.forte.love
GNU Lesser General Public License v3.0
520 stars 43 forks source link

启动报错Run boot app failure: kotlin/streams/jdk8/StreamsKt #585

Closed Textowhtml closed 1 year ago

Textowhtml commented 1 year ago

版本号

v3.0.0

附加版本

这是版本依赖

simbot.example simbot-boot-normal-java 0 17 3.0.0-RC.2 3.0.0.0-M5 love.forte.simbot.boot simboot-core ${simbot.version} love.forte.simbot.component simbot-component-mirai-core ${simbot-mirai.version} org.apache.maven.plugins maven-compiler-plugin 17 17 UTF-8

下面是配置文件 { "component": "simbot.mirai", "code": 1437542624, "passwordInfo": { "type": "text", "text": "xxxxx" }, "config": { "protocol": "ANDROID_WATCH", "deviceInfo": { "type": "auto" }, "recallMessageCacheStrategyConfig": { "type": "invalid" } } }

问题描述

启动时报错, 已经通过滑块验证及短信验证

复现方式

启动时报错

相关日志

"C:\Program Files\Java\jdk\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:59076,suspend=y,server=n -javaagent:D:/maven/repo/org/jetbrains/kotlinx/kotlinx-coroutines-core-jvm/1.6.4/kotlinx-coroutines-core-jvm-1.6.4.jar -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2022.2\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "C:\Users\Administrator\Desktop\simbot3-examples\simbot-examples\simbot-boot-example\simbot-boot-normal-java\target\classes;D:\maven\repo\love\forte\simbot\boot\simboot-core\3.0.0-RC.2\simboot-core-3.0.0-RC.2.jar;D:\maven\repo\love\forte\simbot\simbot-logger-jvm\3.0.0-RC.2\simbot-logger-jvm-3.0.0-RC.2.jar;D:\maven\repo\org\jetbrains\kotlin\kotlin-stdlib-common\1.8.0\kotlin-stdlib-common-1.8.0.jar;D:\maven\repo\love\forte\simbot\boot\simboot-api\3.0.0-RC.2\simboot-api-3.0.0-RC.2.jar;D:\maven\repo\love\forte\simbot\simbot-core\3.0.0-RC.2\simbot-core-3.0.0-RC.2.jar;D:\maven\repo\love\forte\simbot\simbot-api\3.0.0-RC.2\simbot-api-3.0.0-RC.2.jar;D:\maven\repo\love\forte\di\di-api\0.0.3\di-api-0.0.3.jar;D:\maven\repo\org\jetbrains\kotlinx\kotlinx-coroutines-jdk8\1.6.4\kotlinx-coroutines-jdk8-1.6.4.jar;D:\maven\repo\love\forte\simbot\boot\simboot-core-annotation\3.0.0-RC.2\simboot-core-annotation-3.0.0-RC.2.jar;D:\maven\repo\javax\inject\javax.inject\1\javax.inject-1.jar;D:\maven\repo\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\maven\repo\org\jetbrains\kotlinx\kotlinx-coroutines-core-jvm\1.6.4\kotlinx-coroutines-core-jvm-1.6.4.jar;D:\maven\repo\org\jetbrains\kotlinx\kotlinx-serialization-core-jvm\1.4.0\kotlinx-serialization-core-jvm-1.4.0.jar;D:\maven\repo\org\jetbrains\kotlin\kotlin-stdlib\1.7.10\kotlin-stdlib-1.7.10.jar;D:\maven\repo\org\jetbrains\annotations\13.0\annotations-13.0.jar;D:\maven\repo\org\jetbrains\kotlinx\kotlinx-serialization-json-jvm\1.4.0\kotlinx-serialization-json-jvm-1.4.0.jar;D:\maven\repo\love\forte\di\di-core\0.0.3\di-core-0.0.3.jar;D:\maven\repo\org\jetbrains\kotlin\kotlin-reflect\1.6.0\kotlin-reflect-1.6.0.jar;D:\maven\repo\love\forte\annotation-tool\kcore\0.6.3\kcore-0.6.3.jar;D:\maven\repo\love\forte\annotation-tool\api\0.6.3\api-0.6.3.jar;D:\maven\repo\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.8.0\kotlin-stdlib-jdk8-1.8.0.jar;D:\maven\repo\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.8.0\kotlin-stdlib-jdk7-1.8.0.jar;D:\maven\repo\love\forte\simbot\component\simbot-component-mirai-core\3.0.0.0-M5\simbot-component-mirai-core-3.0.0.0-M5.jar;D:\maven\repo\net\mamoe\mirai-core-jvm\2.14.0\mirai-core-jvm-2.14.0.jar;D:\maven\repo\net\mamoe\mirai-core-api-jvm\2.14.0\mirai-core-api-jvm-2.14.0.jar;D:\maven\repo\net\mamoe\mirai-console-compiler-annotations-jvm\2.14.0\mirai-console-compiler-annotations-jvm-2.14.0.jar;D:\maven\repo\org\bouncycastle\bcprov-jdk15on\1.64\bcprov-jdk15on-1.64.jar;D:\maven\repo\me\him188\kotlin-jvm-blocking-bridge-runtime-jvm\2.1.0-170.1\kotlin-jvm-blocking-bridge-runtime-jvm-2.1.0-170.1.jar;D:\maven\repo\me\him188\kotlin-dynamic-delegation-jvm\0.3.0-170.1\kotlin-dynamic-delegation-jvm-0.3.0-170.1.jar;D:\maven\repo\net\mamoe\mirai-core-utils-jvm\2.14.0\mirai-core-utils-jvm-2.14.0.jar;D:\maven\repo\org\jetbrains\kotlinx\kotlinx-serialization-protobuf-jvm\1.3.3\kotlinx-serialization-protobuf-jvm-1.3.3.jar;D:\maven\repo\org\jetbrains\kotlinx\atomicfu-jvm\0.18.3\atomicfu-jvm-0.18.3.jar;D:\maven\repo\org\apache\logging\log4j\log4j-api\2.19.0\log4j-api-2.19.0.jar;D:\maven\repo\io\netty\netty-handler\4.1.63.Final\netty-handler-4.1.63.Final.jar;D:\maven\repo\io\netty\netty-common\4.1.63.Final\netty-common-4.1.63.Final.jar;D:\maven\repo\io\netty\netty-resolver\4.1.63.Final\netty-resolver-4.1.63.Final.jar;D:\maven\repo\io\netty\netty-buffer\4.1.63.Final\netty-buffer-4.1.63.Final.jar;D:\maven\repo\io\netty\netty-transport\4.1.63.Final\netty-transport-4.1.63.Final.jar;D:\maven\repo\io\netty\netty-codec\4.1.63.Final\netty-codec-4.1.63.Final.jar;D:\maven\repo\org\slf4j\slf4j-simple\1.7.25\slf4j-simple-1.7.25.jar;D:\Program Files\JetBrains\IntelliJ IDEA 2022.2.4\lib\idea_rt.jar" simbot.example.Main Dsimbot.blockingRunner.disableWaitTimeout=true
Connected to the target VM, address: '127.0.0.1:59076', transport: 'socket'
[main] INFO love.forte.simbot.utils.BlockingRunner - Blocking runner wait timeout is enabled with wait timeout 1m. You can enable debug logging for 'love.forte.simbot.utils.BlockingRunner' for more stack information or disable it with the JVM parameter '-Dsimbot.blockingRunner.disableWaitTimeout=true'.
[main] INFO love.forte.simbot.application.ApplicationConfiguration - The size of components built is 1
Exception in thread "main" love.forte.simboot.core.SimbootApplicationException: Run boot app failure: kotlin/streams/jdk8/StreamsKt
    at love.forte.simboot.core.SimbootAppKt.runApp(SimbootApp.kt:208)
    at love.forte.simboot.core.SimbootAppKt.access$runApp(SimbootApp.kt:1)
    at love.forte.simboot.core.SimbootApp$run4J$1.invokeSuspend(SimbootApp.kt:150)
    at love.forte.simboot.core.SimbootApp$run4J$1.invoke(SimbootApp.kt)
    at love.forte.simboot.core.SimbootApp$run4J$1.invoke(SimbootApp.kt)
    at love.forte.simbot.application.ApplicationLauncherImpl.launch(ApplicationLauncher.kt:84)
    at love.forte.simbot.application.ApplicationLauncher$launchBlocking$1.invoke(ApplicationLauncher.kt)
    at love.forte.simbot.application.ApplicationLauncher$launchBlocking$1.invoke(ApplicationLauncher.kt)
    at kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt$createCoroutineUnintercepted$$inlined$createCoroutineFromSuspendFunction$IntrinsicsKt__IntrinsicsJvmKt$2.invokeSuspend(IntrinsicsJvm.kt:205)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.coroutines.ContinuationKt.startCoroutine(Continuation.kt:115)
    at love.forte.simbot.utils.DefaultRunInNoScopeBlockingStrategy.invoke(BlockingRunner.kt:398)
    at love.forte.simbot.utils.BlockingRunnerKt.runInNoScopeBlocking(BlockingRunner.kt:462)
    at love.forte.simbot.utils.BlockingRunnerKt.runInNoScopeBlocking$default(BlockingRunner.kt:459)
    at love.forte.simbot.utils.BlockingRunnerKt.$$runInBlocking(BlockingRunner.kt:503)
    at love.forte.simbot.application.ApplicationLauncher.launchBlocking(ApplicationLauncher.kt)
    at simbot.example.Main.main(Main.java:21)
Caused by: java.lang.NoClassDefFoundError: kotlin/streams/jdk8/StreamsKt
    at love.forte.simboot.core.utils.ResourcesScanner$lookup$1.invokeSuspend(ResourcesScanner.kt:66)
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
    at kotlin.sequences.SequenceBuilderIterator.hasNext(SequenceBuilder.kt:127)
    at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:316)
    at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
    at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:316)
    at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
    at kotlin.sequences.FlatteningSequence$iterator$1.ensureItemIterator(Sequences.kt:316)
    at kotlin.sequences.FlatteningSequence$iterator$1.hasNext(Sequences.kt:303)
    at kotlin.sequences.TransformingSequence$iterator$1.hasNext(Sequences.kt:214)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
    at kotlin.sequences.FilteringSequence$iterator$1.calcNext(Sequences.kt:169)
    at kotlin.sequences.FilteringSequence$iterator$1.hasNext(Sequences.kt:194)
    at kotlin.collections.CollectionsKt__MutableCollectionsKt.addAll(MutableCollections.kt:131)
    at love.forte.simboot.core.application.BeanContainerBuilderImpl.build(BeanContainerBuilder.kt:275)
    at love.forte.simboot.core.application.BootApplicationBuilderImpl.build(BootApplication.kt:433)
    at love.forte.simboot.core.application.Boot.create(BootApplication.kt:89)
    at love.forte.simbot.application.Applications.createSimbotApplication(Applications.kt:65)
    at love.forte.simboot.core.SimbootAppKt.runApp(SimbootApp.kt:207)
    ... 16 more
Caused by: java.lang.ClassNotFoundException: kotlin.streams.jdk8.StreamsKt
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
    ... 36 more
Disconnected from the target VM, address: '127.0.0.1:59076', transport: 'socket'

Process finished with exit code 1

其他补充

No response

ForteScarlet commented 1 year ago

提供项目的完整依赖信息

Textowhtml commented 1 year ago

<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

4.0.0
<groupId>simbot.example</groupId>
<artifactId>simbot-boot-normal-java</artifactId>
<version>0</version>

<properties>
    <java.version>17</java.version>
    <simbot.version>3.0.0-RC.2</simbot.version>
    <simbot-mirai.version>3.0.0.0-M5</simbot-mirai.version>
</properties>

<dependencies>
    <dependency>
        <groupId>love.forte.simbot.boot</groupId>
        <artifactId>simboot-core</artifactId>
        <version>${simbot.version}</version>
    </dependency>

    <dependency>
        <groupId>love.forte.simbot.component</groupId>
        <artifactId>simbot-component-mirai-core</artifactId>
        <version>${simbot-mirai.version}</version>
    </dependency>
</dependencies>

<build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>17</source>
                <target>17</target>
                <encoding>UTF-8</encoding>
            </configuration>
        </plugin>
    </plugins>
</build>

ForteScarlet commented 1 year ago

临时增加依赖解决:

    <dependency>
      <groupId>org.jetbrains.kotlin</groupId>
      <artifactId>kotlin-stdlib</artifactId>
      <version>1.8.0</version>
    </dependency>

后续版本会修复此问题,或直接使用 simboot-core-spring-boot-starter 也不会有此问题

问题修复需要等待 kotlinx-coroutines 下一个默认为 Kotlin v1.8.x 的版本发布