时间:2021-05-19
excel导出在docker环境中总是失败 ,最直接的原因还是因为没有安装中文字体,解决方法如下:
DOCKER环境中没有安装中文字体,需要安装
java.lang.NullPointerException: null2020/5/29 上午8:40:11 at sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1264)2020/5/29 上午8:40:11 at sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:219)2020/5/29 上午8:40:11 at sun.awt.FontConfiguration.init(FontConfiguration.java:107)2020/5/29 上午8:40:11 at sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:776)2020/5/29 上午8:40:11 at sun.font.SunFontManager$2.run(SunFontManager.java:431)2020/5/29 上午8:40:11 at java.security.AccessController.doPrivileged(Native Method)2020/5/29 上午8:40:11 at sun.font.SunFontManager.<init>(SunFontManager.java:376)2020/5/29 上午8:40:11 at sun.awt.X11FontManager.<init>(X11FontManager.java:57)2020/5/29 上午8:40:11 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)2020/5/29 上午8:40:11 at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)2020/5/29 上午8:40:11 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)2020/5/29 上午8:40:11 at java.lang.reflect.Constructor.newInstance(Constructor.java:422)2020/5/29 上午8:40:11 at java.lang.Class.newInstance(Class.java:442)2020/5/29 上午8:40:11 at sun.font.FontManagerFactory$1.run(FontManagerFactory.java:83)2020/5/29 上午8:40:11 at java.security.AccessController.doPrivileged(Native Method)2020/5/29 上午8:40:11 at sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)2020/5/29 上午8:40:11 at java.awt.Font.getFont2D(Font.java:491)2020/5/29 上午8:40:11 at java.awt.Font.canDisplayUpTo(Font.java:2060)2020/5/29 上午8:40:11 at java.awt.font.TextLayout.singleFont(TextLayout.java:470)2020/5/29 上午8:40:11 at java.awt.font.TextLayout.<init>(TextLayout.java:531)2020/5/29 上午8:40:11 at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:254)2020/5/29 上午8:40:11 at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)2020/5/29 上午8:40:11 at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:77)2020/5/29 上午8:40:11 at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:636)2020/5/29 上午8:40:11 at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:657)2020/5/29 上午8:40:11 at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:71)2020/5/29 上午8:40:11 at com.chanjet.dsf.util.ExcelUtil.exportExcel(ExcelUtil.java:783)2020/5/29 上午8:40:11 at com.chanjet.dsf.base.BaseService.uploadExcel(BaseService.java:89)2020/5/29 上午8:40:11 at com.chanjet.dsf.goods.service.impl.GoodsServiceImpl.importExcel(GoodsServiceImpl.java:340)2020/5/29 上午8:40:11 at com.chanjet.dsf.goods.service.impl.GoodsServiceImpl$$FastClassBySpringCGLIB$$d268cc51.invoke(<generated>)2020/5/29 上午8:40:11 at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)2020/5/29 上午8:40:11 at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:685)2020/5/29 上午8:40:11 at com.chanjet.dsf.goods.service.impl.GoodsServiceImpl$$EnhancerBySpringCGLIB$$a0a512ec.importExcel(<generated>)2020/5/29 上午8:40:11 at com.chanjet.dsf.goods.controller.GoodsController.importExcel(GoodsController.java:105)2020/5/29 上午8:40:11 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)2020/5/29 上午8:40:11 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)2020/5/29 上午8:40:11 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)2020/5/29 上午8:40:11 at java.lang.reflect.Method.invoke(Method.java:497)2020/5/29 上午8:40:11 at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)2020/5/29 上午8:40:11 at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)2020/5/29 上午8:40:11 at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:106)2020/5/29 上午8:40:11 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)2020/5/29 上午8:40:11 at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)2020/5/29 上午8:40:11 at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)2020/5/29 上午8:40:11 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)2020/5/29 上午8:40:11 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)2020/5/29 上午8:40:11 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)2020/5/29 上午8:40:11 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)2020/5/29 上午8:40:11 at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)2020/5/29 上午8:40:11 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)2020/5/29 上午8:40:11 at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)2020/5/29 上午8:40:11 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)2020/5/29 上午8:40:11 at com.chanjet.dsf.filter.RefreshContextFilter.doFilter(RefreshContextFilter.java:29)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)2020/5/29 上午8:40:11 at com.chanjet.dsf.filter.WebLogMDCFilter.doFilter(WebLogMDCFilter.java:27)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)2020/5/29 上午8:40:11 at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)2020/5/29 上午8:40:11 at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)2020/5/29 上午8:40:11 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)2020/5/29 上午8:40:11 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)2020/5/29 上午8:40:11 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)2020/5/29 上午8:40:11 at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)2020/5/29 上午8:40:11 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)2020/5/29 上午8:40:11 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)2020/5/29 上午8:40:11 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)2020/5/29 上午8:40:11 at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:747)2020/5/29 上午8:40:11 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)2020/5/29 上午8:40:11 at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:367)2020/5/29 上午8:40:11 at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)2020/5/29 上午8:40:11 at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)2020/5/29 上午8:40:11 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1639)2020/5/29 上午8:40:11 at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)2020/5/29 上午8:40:11 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)2020/5/29 上午8:40:11 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)2020/5/29 上午8:40:11 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)2020/5/29 上午8:40:11 at java.lang.Thread.run(Thread.java:745)到此这篇关于excel导出在docker环境中总是失败的问题的文章就介绍到这了,更多相关docker excel失败内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
Docker镜像的导入导出本文介绍Docker镜像的导入导出,用于迁移、备份、升级等场景,准备环境如下:CentOS7.0Docker1.18导入导出命令介绍涉
本文介绍docker镜像的导入导出,用于迁移、备份、升级等场景,准备环境如下:centos7.0docker1.18导入导出命令介绍涉及的命令有export、i
一、原由当在一个集群环境中,我们需要用到docker启动一个服务的时候,如果总是指定固定的公开端口给docker运行的服务,那么将极大的限制了服务部署的灵活性和
(1)问题描述:为了更好地展示数据,Excel格式的数据文件往往比文本文件更具有优势,但是具体到python中,该如何导出数据到Excel呢?如果碰到需要导出大
因为前几天写了篇文章,用php-excel-reader类导入excel内容,顺便说些excel导出问题,我用的是simpleexcel,一个很简单的导出xls