#java #docker #alpine
#java #docker #alpine-linux
Вопрос:
я хочу использовать контейнер Tomcat Docker с Alpinelinux. Контейнер работает нормально. Но если я устанавливаю файл WAR моего приложения, я получаю это сообщение об ошибке:
ERROR SESSION FACADE: Error initializing graphic environment.
ERROR BASE ACTION: Allgemeiner Fehler -> Error initializing graphic
environment.
ERROR Error loading font family
net.sf.jasperreports.engine.fonts.InvalidFontException: Error loading font
"net/sf/jasperreports/fonts/icons/icons.ttf".
at
net.sf.jasperreports.engine.fonts.SimpleFontFace.loadFont(SimpleFontFace.jav
a:206)
at
net.sf.jasperreports.engine.fonts.SimpleFontFace.setTtf(SimpleFontFace.java:
167)
at
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFace(Si
mpleFontExtensionHelper.java:390)
at
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontFamily(
SimpleFontExtensionHelper.java:311)
at
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.parseFontExtensi
ons(SimpleFontExtensionHelper.java:259)
at
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensio
ns(SimpleFontExtensionHelper.java:230)
at
net.sf.jasperreports.engine.fonts.SimpleFontExtensionHelper.loadFontExtensio
ns(SimpleFontExtensionHelper.java:187)
at
net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.ensureFontExtension
s(FontExtensionsRegistry.java:93)
at
net.sf.jasperreports.engine.fonts.FontExtensionsRegistry.getExtensions(FontE
xtensionsRegistry.java:57)
at
net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(Defa
ultExtensionsRegistry.java:130)
at
net.sf.jasperreports.engine.util.JRStyledTextParser.<clinit>(JRStyledTextPar
ser.java:86)
at
net.sf.jasperreports.engine.fill.JRBaseFiller.<init>(JRBaseFiller.java:116)
at
net.sf.jasperreports.engine.fill.JRVerticalFiller.<init>(JRVerticalFiller.ja
va:79)
at
net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.ja
va:251)
at
net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:2
72)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:156)
at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:145)
at
net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:75
8)
at
net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.j
ava:1074)
at
com.lecare.lwc.core.service.implementation.ReportingServiceImpl.generateAkte
Handaktenbogen(Unknown Source)
at
com.lecare.lwc.core.service.implementation.ReportingServiceImpl$$FastClassBy
SpringCGLIB$$eb983928.invoke(<generated>)
at
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invoke
Joinpoint(CglibAopProxy.java:746)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:163)
at
org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(Abstract
TraceInterceptor.java:133)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:186)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Expos
eInvocationInterceptor.java:93)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:186)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.in
tercept(CglibAopProxy.java:688)
at
com.lecare.lwc.core.service.implementation.ReportingServiceImpl$$EnhancerByS
pringCGLIB$$b7e3e56b.generateAkteHandaktenbogen(<generated>)
at
com.lecare.lwc.core.facade.implementation.SessionFacadeImpl.generateAkteHand
aktenbogen(Unknown Source)
at
com.lecare.lwc.core.facade.implementation.SessionFacadeImpl$$FastClassBySpri
ngCGLIB$$c9d0726.invoke(<generated>)
at
org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
at
org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invoke
Joinpoint(CglibAopProxy.java:746)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:163)
at
org.springframework.aop.interceptor.AbstractTraceInterceptor.invoke(Abstract
TraceInterceptor.java:133)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:186)
at
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(Expos
eInvocationInterceptor.java:93)
at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Reflect
iveMethodInvocation.java:186)
at
org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.in
tercept(CglibAopProxy.java:688)
at
com.lecare.lwc.web.model.implementation.BusinessDelegateImpl$$EnhancerBySpri
ngCGLIB$$9db82c12.generateAkteHandaktenbogen(<generated>)
at
com.lecare.lwc.web.struts.action.std.akte.AkteHandaktenbogenAction.getStream
Info(Unknown Source)
at
com.lecare.lwc.web.struts.action.BaseDownloadAction.processDownload(Unknown
Source)
at
com.lecare.lwc.web.struts.action.BaseDownloadAction.executeChecked(Unknown
Source)
at com.lecare.lwc.web.struts.action.BaseAction.execute(Unknown
Source)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProces
sor.java:425)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:229)
at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1942)
at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:460)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:635)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:231)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:166)
at
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:166)
at
org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExp
ortFilter.java:52)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:166)
at com.lecare.lwc.web.filter.SecurityHeaderFilter.doFilter(Unknown
Source)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:166)
at com.lecare.lwc.web.filter.CommonHeaderFilter.doFilter(Unknown
Source)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:193)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:166)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:320)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.
invoke(FilterSecurityInterceptor.java:127)
at
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.
doFilter(FilterSecurityInterceptor.java:91)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:334)
at
org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(
ExceptionTranslationFilter.java:119)
at
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilte
r(FilterChainProxy.java:334)
at
org.springframework.security.web.session.SessionManagementFilter.doFilter(Se
ssionManagementFilter.java:137)
at
[..]
С изображением Ubuntu приложение работает нормально. Должен ли я установить графический интерфейс для этого
проблема? Есть у кого-нибудь рекомендации или другое решение?
Большое спасибо и с наилучшими пожеланиями,
Стефан
Комментарии:
1. Какие базовые образы вы используете для Ubuntu и Alpine?
2. У меня такая же проблема, вы решили? Я использую openjdk: 8-jre-alpine image,
Ответ №1:
на alpine шрифты не установлены.
RUN apk add --no-cache fontconfig msttcorefonts-installer
RUN fc-cache -f