cloud 2.8.2 中blade-report 打包docker镜像后,启动报错,但是IDEA中启动是好的,请问怎么解决?
2021-09-07 09:08:04.047 INFO 1 --- [ main] o.s.core.log.logger.BladeLogger : blade-report: BladeLogger init success!
_____ __________ __________________ _______ ________ ______________
__ / / /___ __ \___ ____/___ __ \__ __ \___ __ \___ __/__|__ \
_ / / / __ /_/ /__ __/ __ /_/ /_ / / /__ /_/ /__ / ____/ /
/ /_/ / _ _, _/ _ /___ _ ____/ / /_/ / _ _, _/ _ / _ __/
\____/ /_/ |_| /_____/ /_/ \____/ /_/ |_| /_/ /____/
........................................................................................................
. uReport, is a Chinese style report engine licensed under the Apache License 2.0, .
. which is opensource, easy to use,high-performance, with browser-based-designer. .
........................................................................................................
2021-09-07 09:08:04.846 WARN 1 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ureport.fontBuilder' defined in class path resource [ureport-core-context.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
2021-09-07 09:08:05.183 INFO 1 --- [ main] o.s.s.c.ThreadPoolTaskScheduler : Shutting down ExecutorService 'taskScheduler'
2021-09-07 09:08:05.189 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Shutting down ExecutorService 'applicationTaskExecutor'
2021-09-07 09:08:05.230 INFO 1 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closing ...
2021-09-07 09:08:05.242 INFO 1 --- [ main] com.alibaba.druid.pool.DruidDataSource : {dataSource-1} closed
2021-09-07 09:08:05.289 INFO 1 --- [ main] ConditionEvaluationReportLoggingListener :
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2021-09-07 09:08:05.341 ERROR 1 --- [ main] o.s.boot.SpringApplication : Application run failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ureport.fontBuilder' defined in class path resource [ureport-core-context.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:602)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$143/0000000020AAC630.getObject(Unknown Source)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
at org.springframework.boot.builder.SpringApplicationBuilder.run(SpringApplicationBuilder.java:140)
at org.springblade.core.launch.BladeApplication.run(BladeApplication.java:50)
at org.springblade.report.ReportApplication.main(ReportApplication.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.NullPointerException: null
at sun.awt.FontConfiguration.getVersion(Unknown Source)
at sun.awt.FontConfiguration.readFontConfigFile(Unknown Source)
at sun.awt.FontConfiguration.init(Unknown Source)
at sun.awt.X11FontManager.createFontConfiguration(Unknown Source)
at sun.font.SunFontManager$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at sun.font.SunFontManager.
at sun.awt.FcFontManager.
at sun.awt.X11FontManager.
at java.lang.J9VMInternals.newInstanceImpl(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at sun.font.FontManagerFactory$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Unknown Source)
at sun.font.FontManagerFactory.getInstance(Unknown Source)
at sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(Unknown Source)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source)
at sun.java2d.SunGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source)
at sun.java2d.HeadlessGraphicsEnvironment.getAvailableFontFamilyNames(Unknown Source)
at com.bstek.ureport.export.pdf.font.FontBuilder.setApplicationContext(FontBuilder.java:111)
at org.springframework.context.support.ApplicationContextAwareProcessor.invokeAwareInterfaces(ApplicationContextAwareProcessor.java:123)
at org.springframework.context.support.ApplicationContextAwareProcessor.postProcessBeforeInitialization(ApplicationContextAwareProcessor.java:100)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsBeforeInitialization(AbstractAutowireCapableBeanFactory.java:415)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1791)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
... 25 common frames omitted
给docker镜像安装字体试试。看下面的报错与字体有关
Caused by: java.lang.NullPointerException: null at sun.awt.FontConfiguration.getVersion(Unknown Source) at sun.awt.FontConfiguration.readFontConfigFile(Unknown Source) at sun.awt.FontConfiguration.init(Unknown Source) at sun.awt.X11FontManager.createFontConfiguration(Unknown Source) at sun.font.SunFontManager$2.run(Unknown Source)
扫一扫访问 Blade技术社区 移动端