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
512 stars 44 forks source link

使用 @Filter 出现 java.lang.ClassNotFoundException: kotlin.text.jdk8.RegexExtensionsJDK8Kt #586

Closed Textowhtml closed 1 year ago

Textowhtml commented 1 year ago

版本号

v3.0.0

附加版本

配置文件

server:
  port: 8080
simbot:
  # 是否在bot注册完成后自动启动他们。
  # 默认为 true
  auto-start-bots: true
  bot-configuration-resources:
    - 'classpath:simbot-bots/*.bot*'
spring:
  lifecycle:
    timeout-per-shutdown-phase: 30s
  redis:
    host: xx
    password: xx
    port: 6379
    jedis:
      pool:
        max-idle: 8
        min-idle: 0
        max-active: 8
        max-wait: -1
      timeout: 0
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://xx
    username: xx
    password: jxxx
    hikari:
      maximum-pool-size: 10
      minimum-idle: 3
      max-lifetime: 30000
      connection-test-query: SELECT 1
  jpa:
    database-platform: org.hibernate.dialect.MySQL5InnoDBDialect
    show-sql: true
    hibernate:
      ddl-auto: update

依赖文件

<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.7.5</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>
    <groupId>simbot.example</groupId>
    <artifactId>spring-boot-web-java</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>spring-boot-web-java</name>
    <description>spring-boot-web-java</description>
    <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>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib-jdk8</artifactId>
            <version>1.8.0</version>
        </dependency>
        <dependency>
            <groupId>love.forte.simbot.boot</groupId>
            <artifactId>simboot-core-spring-boot-starter</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>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.1.212</version>
            <scope>runtime</scope>
        </dependency>
        <!-- mysql -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.11</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-redis</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.62</version>
        </dependency>
        <dependency>
            <groupId>com.tencentcloudapi</groupId>
            <artifactId>tencentcloud-sdk-java</artifactId>
            <version>3.1.13</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-quartz</artifactId>
        </dependency>
        <dependency>
            <groupId>org.java-websocket</groupId>
            <artifactId>Java-WebSocket</artifactId>
            <version>1.3.5</version>
        </dependency>
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <version>2.1.212</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>
    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>
</project>

问题描述

使用@Filter注解时报错

复现方式

监听到消息时 @Filter注解报错

相关日志

2023-02-11 21:06:09.617 ERROR 9900 --- [        task-11] l.f.s.c.e.SimpleEventListenerManagerImpl : Listener [DelegatedListener(KFunctionEventListener(isSuspend=false, targets=[EventKey(id=mirai.group_message)], binders=[love.forte.simboot.core.listener.MergedBinder@14d8c450, love.forte.simboot.core.listener.MergedBinder@5288a0ba, love.forte.simboot.core.listener.MergedBinder@18dde69b], caller=fun simbot.example.listener.MyGroupListener.macroQuery(love.forte.simbot.component.mirai.event.MiraiGroupMessageEvent!, kotlin.String!): love.forte.simbot.event.EventResult!))] process failed: love.forte.simboot.listener.BindException: Binder invoke failure

love.forte.simbot.event.EventListenerProcessingException: love.forte.simboot.listener.BindException: Binder invoke failure
    at love.forte.simbot.core.event.ListenerInvoker.invoke(SimpleEventListenerManagerImpl.kt:470) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2$1$1.invokeSuspend(SimpleEventListenerManagerImpl.kt:316) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2$1$1.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2$1$1.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.EventProcessingDirectInterceptEntrance.doIntercept(EventInterceptEntrance.kt:120) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2.invokeSuspend(SimpleEventListenerManagerImpl.kt:310) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl$doInvoke$2.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at kotlinx.coroutines.intrinsics.UndispatchedKt.startUndispatchedOrReturn(Undispatched.kt:89) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
    at kotlinx.coroutines.BuildersKt__Builders_commonKt.withContext(Builders.common.kt:169) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
    at kotlinx.coroutines.BuildersKt.withContext(Unknown Source) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl.doInvoke(SimpleEventListenerManagerImpl.kt:308) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.SimpleEventListenerManagerImpl.push(SimpleEventListenerManagerImpl.kt:295) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.component.mirai.internal.MiraiBotImplKt$registerEvents$1$invokeSuspend$$inlined$doHandler$3.invokeSuspend(MiraiBotImpl.kt:626) ~[simbot-component-mirai-core-3.0.0.0-M5.jar:na]
    at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) ~[kotlin-stdlib-1.6.21.jar:1.6.21-release-334(1.6.21)]
    at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) ~[kotlinx-coroutines-core-jvm-1.6.4.jar:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[na:na]
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[na:na]
    at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]
Caused by: love.forte.simboot.listener.BindException: Binder invoke failure
    at love.forte.simboot.core.listener.MergedBinder.arg-gIAlu-s(KFunctionListenerProcessor.kt:590) ~[simboot-core-3.0.0-RC.2.jar:na]
    at love.forte.simboot.listener.FunctionalBindableEventListener.invokeCall(FunctionalBindableEventListener.kt:109) ~[simboot-api-3.0.0-RC.2.jar:na]
    at love.forte.simboot.listener.FunctionalBindableEventListener.invoke$suspendImpl(FunctionalBindableEventListener.kt:103) ~[simboot-api-3.0.0-RC.2.jar:na]
    at love.forte.simboot.listener.FunctionalBindableEventListener.invoke(FunctionalBindableEventListener.kt) ~[simboot-api-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.DelegatedEventListener.invoke(SimpleListenerProxy.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2$1.invokeSuspend(SimpleEventListenerManagerImpl.kt:433) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2$1.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2$1.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.EventListenerDirectInterceptEntrance.doIntercept(EventInterceptEntrance.kt:169) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.EventListenerDirectInterceptEntrance.doIntercept(EventInterceptEntrance.kt:163) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2.invokeSuspend(SimpleEventListenerManagerImpl.kt:432) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner$runner$2.invoke(SimpleEventListenerManagerImpl.kt) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.EventListenerDirectInterceptEntrance.doIntercept(EventInterceptEntrance.kt:169) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.EventListenerDirectInterceptEntrance.doIntercept(EventInterceptEntrance.kt:163) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$AbstractFunctionRunner.runner(SimpleEventListenerManagerImpl.kt:430) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$SuspendFunctionRunner.invoke(SimpleEventListenerManagerImpl.kt:458) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker$SuspendFunctionRunner.invoke(SimpleEventListenerManagerImpl.kt:453) ~[simbot-core-3.0.0-RC.2.jar:na]
    at love.forte.simbot.core.event.ListenerInvoker.invoke(SimpleEventListenerManagerImpl.kt:464) ~[simbot-core-3.0.0-RC.2.jar:na]
    ... 18 common frames omitted
Caused by: java.lang.NoClassDefFoundError: kotlin/text/jdk8/RegexExtensionsJDK8Kt
    at love.forte.simboot.filter.MatcherParameters.get(RegexMatcherValue.kt:86) ~[simboot-api-3.0.0-RC.2.jar:na]
    at love.forte.simboot.filter.RegexMatcherValue.getParam(RegexMatcherValue.kt:55) ~[simboot-api-3.0.0-RC.2.jar:na]
    at love.forte.simboot.core.binder.KeywordBinder$Required.arg-gIAlu-s(KeywordBinder.kt:71) ~[simboot-core-3.0.0-RC.2.jar:na]
    at love.forte.simboot.core.listener.MergedBinder.arg_gIAlu_s$invoke(KFunctionListenerProcessor.kt:546) ~[simboot-core-3.0.0-RC.2.jar:na]
    at love.forte.simboot.core.listener.MergedBinder.arg-gIAlu-s(KFunctionListenerProcessor.kt:565) ~[simboot-core-3.0.0-RC.2.jar:na]
    ... 36 common frames omitted
Caused by: java.lang.ClassNotFoundException: kotlin.text.jdk8.RegexExtensionsJDK8Kt
    ... 41 common frames omitted

其他补充

No response

ForteScarlet commented 1 year ago

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

更换为

        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
            <version>1.8.0</version>
        </dependency>
ForliyScarlet commented 1 year ago

此issue已经在「等待反馈」状态下5日未应答。如果在「陈旧」状态下逾期2日将会被视为无效过期并关闭。

ForliyScarlet commented 1 year ago

此issue已经在「陈旧」状态下逾期2日未应答, 视为无效过期并关闭。