KingPrimes / NyxBot

warframe status bot
https://github.com/KingPrimes/NyxBot
MIT License
17 stars 7 forks source link

[BUG] 程序获取时间空指针 #35

Closed 502y closed 4 months ago

502y commented 4 months ago

问题描述

程序启动后,获取时间后空指针异常导致无法正常运行。

环境信息

请填写以下信息:

重现步骤

以nohup启动程序 nohup java -jar bot/nyx/NyxBot.jar --server.port = 8080 &

期待的正确结果

程序正常运行

相关日志输出

ERROR 2024-06-28 17:27:00  [taskExecutor-2 - 1862]  .a.i.SimpleAsyncUncaughtExceptionHandler : Unexpected exception occurred invoking async method: public void com.nyx.bot.task.TaskWarframeStatus.execute()

java.lang.NullPointerException: localDateTime
        at java.base/java.util.Objects.requireNonNull(Objects.java:235)
        at java.base/java.time.ZonedDateTime.ofLocal(ZonedDateTime.java:369)
        at java.base/java.time.ZonedDateTime.of(ZonedDateTime.java:295)
        at com.alibaba.fastjson2.JSONReaderUTF16.readZonedDateTimeX(JSONReaderUTF16.java:6109)
        at com.alibaba.fastjson2.JSONReader.readMillisFromString(JSONReader.java:1712)
        at com.alibaba.fastjson2.reader.ObjectReaderImplDate.readDate(ObjectReaderImplDate.java:98)
        at com.alibaba.fastjson2.reader.ObjectReaderImplDate.readObject(ObjectReaderImplDate.java:71)
        at com.alibaba.fastjson2.reader.ORG_40_8_Arbitration.readObject(Unknown Source)
        at com.alibaba.fastjson2.reader.ORG_11_22_GlobalStates.readObject(Unknown Source)
        at com.alibaba.fastjson2.JSON.parseObject(JSON.java:1002)
        at com.alibaba.fastjson2.JSONObject.parseObject(JSONObject.java:1991)
        at com.nyx.bot.task.TaskWarframeStatus.execute(TaskWarframeStatus.java:25)
        at jdk.internal.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:351)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:196)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:765)
        at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:113)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
        at java.base/java.lang.Thread.run(Thread.java:840)

附加信息

github-actions[bot] commented 4 months ago

Hello! Thank you for filing an issue.

If this is a bug report, please include relevant logs to help us debug the problem.

9ikj commented 4 months ago

下载 action构建的试试

502y commented 4 months ago

感谢,程序能够正常运行了。 但是会有一些不影响正常使用的错误

 WARN 2024-06-28 22:30:02  [main - 100240]  o.h.t.s.i.ExceptionHandlerLoggedImpl     : GenerationTarget encountered exception accepting command : Error executing DDL "alter table if exists riven_trend alter column is_date set data type timestamp(6)" via JDBC [Cannot parse "TIMESTAMP" constant "1705401435000";]

org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "alter table if exists riven_trend alter column is_date set data type timestamp(6)" via JDBC [Cannot parse "TIMESTAMP" constant "1705401435000";]
        at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:94)
        at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:574)
        at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:514)
        at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.migrateTable(AbstractSchemaMigrator.java:333)
        at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:84)
        at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:232)
        at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:117)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:286)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.lambda$process$5(SchemaManagementToolCoordinator.java:145)
        at java.base/java.util.HashMap.forEach(HashMap.java:1421)
        at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:142)
        at org.hibernate.boot.internal.SessionFactoryObserverForSchemaExport.sessionFactoryCreated(SessionFactoryObserverForSchemaExport.java:37)
        at org.hibernate.internal.SessionFactoryObserverChain.sessionFactoryCreated(SessionFactoryObserverChain.java:35)
        at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:315)
        at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:450)
        at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1507)
        at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:75)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:390)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:409)
        at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:396)
        at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:366)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1833)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1782)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:600)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:326)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:324)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:200)
        at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1234)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:952)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
        at com.nyx.bot.NyxBotApplication.main(NyxBotApplication.java:17)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:91)
        at org.springframework.boot.loader.launch.Launcher.launch(Launcher.java:53)
        at org.springframework.boot.loader.launch.JarLauncher.main(JarLauncher.java:58)
Caused by: org.h2.jdbc.JdbcSQLDataException: Cannot parse "TIMESTAMP" constant "1705401435000"; SQL statement:
INSERT INTO "PUBLIC"."RIVEN_TREND_COPY_3_0"("ID", "IS_DATE", "NEW_DOT", "NEW_NUM", "OLD_DOT", "OLD_NUM", "TREND_NAME", "TYPE") OVERRIDING SYSTEM VALUE SELECT "ID", "IS_DATE", "NEW_DOT", "NEW_NUM", "OLD_DOT", "OLD_NUM", "TREND_NAME", "TYPE" FROM "PUBLIC"."RIVEN_TREND" [22007-224]
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:518)
        at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
        at org.h2.message.DbException.get(DbException.java:212)
        at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:88)
        at org.h2.value.Value.convertToTimestamp(Value.java:2001)
        at org.h2.value.Value.convertTo(Value.java:1174)
        at org.h2.value.Value.convertForAssignTo(Value.java:1113)
        at org.h2.table.Column.validateConvertUpdateSequence(Column.java:369)
        at org.h2.table.Table.convertInsertRow(Table.java:936)
        at org.h2.command.dml.Insert.addRow(Insert.java:229)
        at org.h2.command.dml.Insert.insertRows(Insert.java:203)
        at org.h2.command.dml.Insert.update(Insert.java:135)
        at org.h2.command.dml.DataChangeStatement.update(DataChangeStatement.java:74)
        at org.h2.command.CommandContainer.update(CommandContainer.java:169)
        at org.h2.command.Command.executeUpdate(Command.java:256)
        at org.h2.command.ddl.AlterTableAlterColumn.execute(AlterTableAlterColumn.java:649)
        at org.h2.command.ddl.AlterTableAlterColumn.cloneTableStructure(AlterTableAlterColumn.java:561)
        at org.h2.command.ddl.AlterTableAlterColumn.copyData(AlterTableAlterColumn.java:343)
        at org.h2.command.ddl.AlterTableAlterColumn.update(AlterTableAlterColumn.java:229)
        at org.h2.command.CommandContainer.update(CommandContainer.java:169)
        at org.h2.command.Command.executeUpdate(Command.java:256)
        at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:262)
        at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:231)
        at com.zaxxer.hikari.pool.ProxyStatement.execute(ProxyStatement.java:94)
        at com.zaxxer.hikari.pool.HikariProxyStatement.execute(HikariProxyStatement.java)
        at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:80)
        ... 43 common frames omitted
Caused by: java.lang.IllegalArgumentException: 170540143-50-0
        at org.h2.util.DateTimeUtils.parseDateValue(DateTimeUtils.java:194)
        at org.h2.util.DateTimeUtils.parseTimestamp(DateTimeUtils.java:338)
        at org.h2.value.ValueTimestamp.parse(ValueTimestamp.java:86)
        ... 65 common frames omitted