Closed YOLO-MIC closed 1 year ago
核心启动器不具备具体功能,自然不存在送信器工厂。 你应当使用一个具体的组件启动器,例如 mirai 组件的启动器:
<dependency>
<groupId>love.forte.simple-robot</groupId>
<artifactId>component-mirai-spring-boot-starter</artifactId>
</dependency>
还有新的问题 日志: ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.5.0)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
_() _ / / ____ / / / / / ` \/ \/ \/ / ( ) / / / / / / // / // / / /__/// // //_._/__/__/ @ForteScarlet v2.5.2
Tips: 你知道吗?catCode的规范来源于CQ码。
ERROR SpringApplication Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'simbotContext' defined in love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [love.forte.simbot.core.SimbotContext]: Factory method 'simbotApp' threw exception; nested exception is java.lang.reflect.InvocationTargetException
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:638)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1334)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:564)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:524)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:335)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:333)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:944)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:583)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:438)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:337)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1336)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1325)
at com.hhj.QQRobotApplication.main(QQRobotApplication.java:17)
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [love.forte.simbot.core.SimbotContext]: Factory method 'simbotApp' threw exception; nested exception is java.lang.reflect.InvocationTargetException
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185)
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:653)
... 18 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at love.forte.common.ioc.DependCenter$constrInstance$2.invoke(DependCenter.kt:450)
at love.forte.common.ioc.DependCenter$constrInstance$2.invoke(DependCenter.kt:450)
at love.forte.common.ioc.DependCenter.inject0$lambda-10(DependCenter.kt:264)
at love.forte.common.ioc.DependCenter.inject0$lambda-12(DependCenter.kt:279)
at love.forte.common.ioc.DependCenter.inject0$lambda-14(DependCenter.kt:291)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt:298)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt:215)
at love.forte.common.ioc.DependCenter.getOrThrow(DependCenter.kt:1032)
at love.forte.common.ioc.DependCenter$childMethodToEmptyInstanceSupplier$parameterSupplierList$1$1.invoke(DependCenter.kt:530)
at love.forte.common.ioc.DependCenter$childMethodToEmptyInstanceSupplier$parameterSupplierList$1$1.invoke(DependCenter.kt:529)
at love.forte.common.ioc.DependCenter$childMethodToEmptyInstanceSupplier$1.invoke(DependCenter.kt:601)
at love.forte.common.ioc.DependCenter$childMethodToEmptyInstanceSupplier$1.invoke(DependCenter.kt:589)
at love.forte.common.ioc.DependCenter$injectChildren$3.invoke$lambda-1(DependCenter.kt:362)
at love.forte.common.ioc.DependCenter$injectChildren$3.invoke$lambda-4(DependCenter.kt:374)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt:298)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt:215)
at love.forte.common.ioc.DependCenter.getOrThrow(DependCenter.kt:1032)
at love.forte.common.ioc.DependCenter$constrInstance$parameterGetterList$1$4.invoke(DependCenter.kt:442)
at love.forte.common.ioc.DependCenter$constrInstance$parameterGetterList$1$4.invoke(DependCenter.kt:442)
at love.forte.common.ioc.DependCenter$constrInstance$1.invoke(DependCenter.kt:447)
at love.forte.common.ioc.DependCenter$constrInstance$1.invoke(DependCenter.kt:447)
at love.forte.common.ioc.DependCenter.inject0$lambda-10(DependCenter.kt:264)
at love.forte.common.ioc.DependCenter.inject0$lambda-12(DependCenter.kt:279)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt:298)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt:215)
at love.forte.common.ioc.DependCenter.getOrThrow(DependCenter.kt:1032)
at love.forte.common.ioc.DependCenter$constrInstance$parameterGetterList$1$4.invoke(DependCenter.kt:442)
at love.forte.common.ioc.DependCenter$constrInstance$parameterGetterList$1$4.invoke(DependCenter.kt:442)
at love.forte.common.ioc.DependCenter$constrInstance$1.invoke(DependCenter.kt:447)
at love.forte.common.ioc.DependCenter$constrInstance$1.invoke(DependCenter.kt:447)
at love.forte.common.ioc.DependCenter.inject0$lambda-10(DependCenter.kt:264)
at love.forte.common.ioc.DependCenter.inject0$lambda-12(DependCenter.kt:279)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt:298)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt:215)
at love.forte.common.ioc.DependCenter.getOrThrow(DependCenter.kt:1032)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$funcs$1$instance$2.invoke(DependCenter.kt:663)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$funcs$1$instance$2.invoke(DependCenter.kt:662)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$funcs$1$1.invoke(DependCenter.kt:735)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$funcs$1$1.invoke(DependCenter.kt:733)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$2.invoke(DependCenter.kt:743)
at love.forte.common.ioc.DependCenter$instanceInjectFunc$2.invoke(DependCenter.kt:742)
at love.forte.common.ioc.DependCenter.inject0$lambda-10(DependCenter.kt:265)
at love.forte.common.ioc.DependCenter.inject0$lambda-12(DependCenter.kt:279)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt)
at love.forte.common.ioc.DependCenters$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(DependCenter.kt:298)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt)
at love.forte.common.ioc.BeanDependBuilder$sam$love_forte_common_ioc_InstanceSupplier$0.invoke(BeanDepend.kt:215)
at love.forte.common.ioc.DependCenter.init(DependCenter.kt:102)
at love.forte.simbot.core.SimbotApp.initDependCenter(SimbotApp.kt:435)
at love.forte.simbot.core.SimbotApp.run$core(SimbotApp.kt:280)
at love.forte.simbot.core.SimbotApp$Run.run(SimbotApp.kt:509)
at love.forte.simbot.core.SimbotApp.run(SimbotApp.kt)
at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration.simbotApp(SimbotAppConfiguration.java:77)
at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration$$EnhancerBySpringCGLIB$$82779009.CGLIB$simbotApp$1(
Process finished with exit code 1
pom: <?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">
<groupId>com.hhj</groupId>
<artifactId>QQRobot</artifactId>
<version>1.0.4</version>
<name>QQRobot</name>
<description>QQRobot</description>
<properties>
<simbot.version>2.5.2</simbot.version>
<kotlin.version>1.4.30</kotlin.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>love.forte.simple-robot</groupId>
<artifactId>parent</artifactId>
<version>${simbot.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>love.forte.simple-robot</groupId>
<artifactId>component-mirai-spring-boot-starter</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<excludes>
<exclude>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
</exclude>
</excludes>
</configuration>
</plugin>
</plugins>
</build>
尝试添加如下依赖:
<dependency>
<groupId>org.jetbrains.kotlinx</groupId>
<artifactId>kotlinx-serialization-json-jvm</artifactId>
<version>1.4.1</version> <!-- 如果失败则尝试 1.3.3 -->
</dependency>
两个都尝试过了,但现在控制台输出卡在tips QQ登录状态还是离线
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
. _ _ /\ / '_ () \ \ \ \ ( ( )\ | ' | '| | ' \/ ` | \ \ \ \ \/ _)| |)| | | | | || (| | ) ) ) ) ' |__| .|| ||| |\, | / / / / =========|_|==============|__/=//// :: Spring Boot :: (v2.5.0)
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
へ /|
/\7 ∠_/
/ │ /
│ Z _,< / /ヽ │ ヽ / 〉 Y
/ /
イ● 、 ● ⊂⊃〈 /
() へ | \〈
>ー 、_ ィ │ //
/ へ / ノ<| \\
ヽノ (/ │//
7 |/
>―r ̄ ̄`ー―_l
simbot@ForteScarlet
v2.5.2
Tips: 你知道吗?catCode的名称之所以叫做“猫猫码”而不是“猫码”是因为前者听上去比较可爱。
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
你并没有安装任何SLF4J-api的日志实现,请自行安装日志后根据日志提示操作,比如 log4j
或 logback
,亦或是 spring-boot-starter-logging
等。
好的谢谢
报错:
maven pom: