simple-robot / simple-robot-v2

Simple Robot v2.x系列版本(归档)仓库 / Simple Robot,一个通用的bot风格事件调度框架,以灵活的统一标准来编写bot应用。
Apache License 2.0
2 stars 0 forks source link

求助,下载最新2.5.2版本启动不来 #6

Closed YOLO-MIC closed 1 year ago

YOLO-MIC commented 1 year ago

报错:

"C:\Program Files\Java\jdk\jdk1.8.0_212\bin\java.exe" "-javaagent:D:\Tools\Jetbrains\IntelliJ IDEA 2021.2\lib\idea_rt.jar=58627:D:\Tools\Jetbrains\IntelliJ IDEA 2021.2\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\charsets.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\deploy.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\javaws.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\jce.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\jfr.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\jsse.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\management-agent.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\plugin.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\resources.jar;C:\Program Files\Java\jdk\jdk1.8.0_212\jre\lib\rt.jar;C:\Users\24747\AllProjects\Intelligent idea\QQRobot\target\classes;D:\CodeEnvironment\Apache\Maven\repository\love\forte\simple-robot\core-spring-boot-starter\2.5.2\core-spring-boot-starter-2.5.2.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\boot\spring-boot-configuration-processor\2.5.0\spring-boot-configuration-processor-2.5.0.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\boot\spring-boot-autoconfigure\2.5.0\spring-boot-autoconfigure-2.5.0.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\boot\spring-boot\2.5.0\spring-boot-2.5.0.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-core\5.3.7\spring-core-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-jcl\5.3.7\spring-jcl-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-context\5.3.7\spring-context-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-aop\5.3.7\spring-aop-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-beans\5.3.7\spring-beans-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\springframework\spring-expression\5.3.7\spring-expression-5.3.7.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\simple-robot\core\2.5.2\core-2.5.2.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\simple-robot\api\2.5.2\api-2.5.2.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlinx\kotlinx-coroutines-core\1.6.4\kotlinx-coroutines-core-1.6.4.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlinx\kotlinx-coroutines-core-jvm\1.6.4\kotlinx-coroutines-core-jvm-1.6.4.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\catcode\1.0.0-BETA.1\catcode-1.0.0-BETA.1.jar;D:\CodeEnvironment\Apache\Maven\repository\org\slf4j\slf4j-api\1.7.36\slf4j-api-1.7.36.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\common\utils\1.0.7\utils-1.0.7.jar;D:\CodeEnvironment\Apache\Maven\repository\cn\hutool\hutool-core\5.7.19\hutool-core-5.7.19.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\common\language\1.0.7\language-1.0.7.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk8\1.7.21\kotlin-stdlib-jdk8-1.7.21.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlin\kotlin-stdlib-jdk7\1.7.21\kotlin-stdlib-jdk7-1.7.21.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlin\kotlin-reflect\1.7.21\kotlin-reflect-1.7.21.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\common\configuration\1.0.7\configuration-1.0.7.jar;D:\CodeEnvironment\Apache\Maven\repository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.12.5\jackson-dataformat-yaml-2.12.5.jar;D:\CodeEnvironment\Apache\Maven\repository\com\fasterxml\jackson\core\jackson-databind\2.11.3\jackson-databind-2.11.3.jar;D:\CodeEnvironment\Apache\Maven\repository\com\fasterxml\jackson\core\jackson-annotations\2.11.3\jackson-annotations-2.11.3.jar;D:\CodeEnvironment\Apache\Maven\repository\org\yaml\snakeyaml\1.27\snakeyaml-1.27.jar;D:\CodeEnvironment\Apache\Maven\repository\com\fasterxml\jackson\core\jackson-core\2.12.5\jackson-core-2.12.5.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlin\kotlin-stdlib\1.7.21\kotlin-stdlib-1.7.21.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\kotlin\kotlin-stdlib-common\1.7.21\kotlin-stdlib-common-1.7.21.jar;D:\CodeEnvironment\Apache\Maven\repository\org\jetbrains\annotations\13.0\annotations-13.0.jar;D:\CodeEnvironment\Apache\Maven\repository\love\forte\common\ioc\1.0.7\ioc-1.0.7.jar" com.hhj.QQRobotApplication
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.

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.0)

            _             _                _
   ___     (_)    _ __   | |__     ___    | |_
  (_-<     | |   | '  \  | '_ \   / _ \   |  _|
  /__/_   _|_|_  |_|_|_| |_.__/   \___/   _\__|
_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|_|"""""|
"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'"`-0-0-'
 |"""""| |"""""""|
_|Forte|_|Scarlet|
"`-0-0-'"`-0---0-'
            v2.5.2

Tips: 你知道吗?那些开头是“你知道吗?”的tips中的内容很多都是谎言,但同时也是事实。

Exception in thread "main" 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 love.forte.common.ioc.exception.NoSuchDependException: love.forte.simbot.api.sender.SenderFactory
class:     public final class love.forte.simbot.core.configuration.CoreMsgSenderFactoriesConfiguration
method:    public final MsgSenderFactories coreMsgSenderFactories(SenderFactory, SetterFactory, GetterFactory)
parameter: 0:senderFactory SenderFactory
    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 love.forte.common.ioc.exception.NoSuchDependException: love.forte.simbot.api.sender.SenderFactory
class:     public final class love.forte.simbot.core.configuration.CoreMsgSenderFactoriesConfiguration
method:    public final MsgSenderFactories coreMsgSenderFactories(SenderFactory, SetterFactory, GetterFactory)
parameter: 0:senderFactory SenderFactory
    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: love.forte.common.ioc.exception.NoSuchDependException: love.forte.simbot.api.sender.SenderFactory
class:     public final class love.forte.simbot.core.configuration.CoreMsgSenderFactoriesConfiguration
method:    public final MsgSenderFactories coreMsgSenderFactories(SenderFactory, SetterFactory, GetterFactory)
parameter: 0:senderFactory SenderFactory
    at love.forte.common.ioc.DependCenter$childMethodToEmptyInstanceSupplier$parameterSupplierList$1$1.invoke$lambda-0(DependCenter.kt:531)
    at love.forte.common.ioc.DependCenter.getOrThrow(DependCenter.kt:1033)
    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$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$$bf589d90.CGLIB$simbotApp$0(<generated>)
    at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration$$EnhancerBySpringCGLIB$$bf589d90$$FastClassBySpringCGLIB$$76d74bf3.invoke(<generated>)
    at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244)
    at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331)
    at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration$$EnhancerBySpringCGLIB$$bf589d90.simbotApp(<generated>)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
    ... 19 more

Process finished with exit code 1

maven 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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.hhj</groupId>
    <artifactId>QQRobot</artifactId>
    <version>1.0.4</version>
    <name>QQRobot</name>
    <description>QQRobot</description>
    <properties>
        <java.version>1.8</java.version>
        <skipTests>true</skipTests>
        <simbot.version>2.5.2</simbot.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>core-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>

</project>
ForteScarlet commented 1 year ago

核心启动器不具备具体功能,自然不存在送信器工厂。 你应当使用一个具体的组件启动器,例如 mirai 组件的启动器:

<dependency>
   <groupId>love.forte.simple-robot</groupId>
   <artifactId>component-mirai-spring-boot-starter</artifactId>
</dependency>
YOLO-MIC commented 1 year ago

还有新的问题 日志: 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() at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration$$EnhancerBySpringCGLIB$$82779009$$FastClassBySpringCGLIB$$b07cbba4.invoke() at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:244) at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) at love.forte.simbot.spring.autoconfigure.SimbotAppConfiguration$$EnhancerBySpringCGLIB$$82779009.simbotApp() at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154) ... 19 more Caused by: java.lang.NoClassDefFoundError: Could not initialize class kotlinx.serialization.json.Json at kotlinx.serialization.json.JsonKt.Json$default(Json.kt:185) at net.mamoe.mirai.utils.BotConfiguration.(BotConfiguration.kt:639) at love.forte.simbot.component.mirai.configuration.MiraiConfiguration.(MiraiConfiguration.kt:62) ... 94 more

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">

4.0.0
<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>

ForteScarlet commented 1 year ago

尝试添加如下依赖:

<dependency>
   <groupId>org.jetbrains.kotlinx</groupId>
   <artifactId>kotlinx-serialization-json-jvm</artifactId>
   <version>1.4.1</version> <!-- 如果失败则尝试 1.3.3 -->
</dependency>
YOLO-MIC commented 1 year ago

两个都尝试过了,但现在控制台输出卡在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的名称之所以叫做“猫猫码”而不是“猫码”是因为前者听上去比较可爱。

ForteScarlet commented 1 year ago

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的日志实现,请自行安装日志后根据日志提示操作,比如 log4jlogback ,亦或是 spring-boot-starter-logging 等。

YOLO-MIC commented 1 year ago

好的谢谢