hectorqin / reader

阅读3服务器版,桌面端,iOS可用。后端 Kotlin + Spring Boot + Vert.x + Coroutine ;前端 Vue.js + Element。麻烦点点star,关注一下公众号【假装大佬】❗️ Demo服务器由于未备案已被关停,建议自行搭建
GNU General Public License v3.0
8.42k stars 5.24k forks source link

Docker 无法运行 #461

Closed z4jst closed 1 year ago

z4jst commented 1 year ago

环境:amd64; debian11、centos7.9 运行方式:docker 和 docker-compose 运行版本:hectorqin/reader:latest 问题:docker运行后,查看log,出现 READER 大字后就自动关机。 查看log,详细内容如下:

[] [main] 13:30:35.798 INFO ReaderApplicationKt - Starting ReaderApplicationKt on 5c60f004e68b with PID 6 (/app/bin/reader.jar started by root in /) [] [main] 13:30:35.799 DEBUG ReaderApplicationKt - Running with Spring Boot v2.1.6.RELEASE, Spring v5.1.8.RELEASE [] [main] 13:30:35.799 INFO ReaderApplicationKt - The following profiles are active: prod [] [main] 13:30:38.398 WARN AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'readerApplication': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError [] [main] 13:30:38.417 INFO ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. [] [main] 13:30:38.434 ERROR SpringApplication - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'readerApplication': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) at com.htmake.reader.ReaderApplicationKt.main(ReaderApplication.kt:73) 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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47) at org.springframework.boot.loader.Launcher.launch(Launcher.java:86) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: java.lang.ExceptionInInitializerError: null at io.vertx.core.net.impl.transport.Transport.eventLoopGroup(Transport.java:153) at io.vertx.core.impl.VertxImpl.(VertxImpl.java:143) at io.vertx.core.impl.VertxImpl.vertx(VertxImpl.java:92) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:40) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:32) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:27) at io.vertx.core.Vertx.vertx(Vertx.java:75) at com.htmake.reader.ReaderApplication$Companion$vertx$2.invoke(ReaderApplication.kt:34) at com.htmake.reader.ReaderApplication$Companion$vertx$2.invoke(ReaderApplication.kt:34) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.htmake.reader.ReaderApplication$Companion.getVertx(ReaderApplication.kt:34) at com.htmake.reader.ReaderApplication$Companion.vertx(ReaderApplication.kt:35) at com.htmake.reader.ReaderApplication.deployVerticle(ReaderApplication.kt:50) 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.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ... 25 common frames omitted Caused by: java.lang.IllegalArgumentException: availableProcessors: 0 (expected: > 0) at io.netty.util.internal.ObjectUtil.checkPositive(ObjectUtil.java:44) at io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:44) at io.netty.util.NettyRuntime$AvailableProcessorsHolder.availableProcessors(NettyRuntime.java:70) at io.netty.util.NettyRuntime.availableProcessors(NettyRuntime.java:98) at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:41) ... 45 common frames omitted [] [main] 13:33:39.275 INFO ReaderApplicationKt - Starting ReaderApplicationKt on ca337cf61fcb with PID 6 (/app/bin/reader.jar started by root in /) [] [main] 13:33:39.276 DEBUG ReaderApplicationKt - Running with Spring Boot v2.1.6.RELEASE, Spring v5.1.8.RELEASE [] [main] 13:33:39.276 INFO ReaderApplicationKt - The following profiles are active: prod [] [main] 13:33:42.098 WARN AnnotationConfigApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'readerApplication': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError [] [main] 13:33:42.106 INFO ConditionEvaluationReportLoggingListener -

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. [] [main] 13:33:42.128 ERROR SpringApplication - Application run failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'readerApplication': Invocation of init method failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:139) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:414) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1770) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:742) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:389) at org.springframework.boot.SpringApplication.run(SpringApplication.java:311) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1213) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1202) at com.htmake.reader.ReaderApplicationKt.main(ReaderApplication.kt:73) 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.boot.loader.MainMethodRunner.run(MainMethodRunner.java:47) at org.springframework.boot.loader.Launcher.launch(Launcher.java:86) at org.springframework.boot.loader.Launcher.launch(Launcher.java:50) at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:51) Caused by: java.lang.ExceptionInInitializerError: null at io.vertx.core.net.impl.transport.Transport.eventLoopGroup(Transport.java:153) at io.vertx.core.impl.VertxImpl.(VertxImpl.java:143) at io.vertx.core.impl.VertxImpl.vertx(VertxImpl.java:92) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:40) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:32) at io.vertx.core.impl.VertxFactoryImpl.vertx(VertxFactoryImpl.java:27) at io.vertx.core.Vertx.vertx(Vertx.java:75) at com.htmake.reader.ReaderApplication$Companion$vertx$2.invoke(ReaderApplication.kt:34) at com.htmake.reader.ReaderApplication$Companion$vertx$2.invoke(ReaderApplication.kt:34) at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74) at com.htmake.reader.ReaderApplication$Companion.getVertx(ReaderApplication.kt:34) at com.htmake.reader.ReaderApplication$Companion.vertx(ReaderApplication.kt:35) at com.htmake.reader.ReaderApplication.deployVerticle(ReaderApplication.kt:50) 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.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:363) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:307) at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:136) ... 25 common frames omitted Caused by: java.lang.IllegalArgumentException: availableProcessors: 0 (expected: > 0) at io.netty.util.internal.ObjectUtil.checkPositive(ObjectUtil.java:44) at io.netty.util.NettyRuntime$AvailableProcessorsHolder.setAvailableProcessors(NettyRuntime.java:44) at io.netty.util.NettyRuntime$AvailableProcessorsHolder.availableProcessors(NettyRuntime.java:70) at io.netty.util.NettyRuntime.availableProcessors(NettyRuntime.java:98) at io.netty.channel.MultithreadEventLoopGroup.(MultithreadEventLoopGroup.java:41) ... 45 common frames omitted

hectorqin commented 1 year ago

参考 #21

z4jst commented 1 year ago

谢谢,已解决。 在compose文件中readerwebview:字段上面一行,增加command: java -XX:ActiveProcessorCount=1 -jar /app/bin/reader.jar。修改数字1为CPU内核数量即可。