Error while generating process diagram, image will not be stored in repository

Hi All,

I am getting below error in this code,

Deployment deploymentResponse = repositoryService.createDeployment().addBpmnModel(workflowName, workflowBpmn).deploy();

Kindly let me know when will this error occur and what should be done to fix this error.

Error Message

flowable-engine | [2022-08-18T09:38:54.054 UTC] [org.flowable.engine.impl.bpmn.deployer.ProcessDefinitionDiagramHelper] [66] [WARN ] [https-openssl-nio-9555-exec-10] Error while generating process diagram, image will not be stored in repository
flowable-engine | java.lang.NoClassDefFoundError: Could not initialize class sun.font.SunFontManager
flowable-engine | at java.desktop/sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:265)
flowable-engine | at java.desktop/sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:861)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramCanvas.initialize(DefaultProcessDiagramCanvas.java:220)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramCanvas.(DefaultProcessDiagramCanvas.java:179)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramGenerator.initProcessDiagramCanvas(DefaultProcessDiagramGenerator.java:1094)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramGenerator.generateProcessDiagram(DefaultProcessDiagramGenerator.java:621)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:536)
flowable-engine | at org.flowable.image.impl.DefaultProcessDiagramGenerator.generateDiagram(DefaultProcessDiagramGenerator.java:565)
flowable-engine | at org.flowable.engine.impl.bpmn.deployer.ProcessDefinitionDiagramHelper.createDiagramForProcessDefinition(ProcessDefinitionDiagramHelper.java:49)
flowable-engine | at org.flowable.engine.impl.bpmn.deployer.BpmnDeployer.createAndPersistNewDiagramsIfNeeded(BpmnDeployer.java:132)
flowable-engine | at org.flowable.engine.impl.bpmn.deployer.BpmnDeployer.deploy(BpmnDeployer.java:86)
flowable-engine | at org.flowable.engine.impl.persistence.deploy.DeploymentManager.deploy(DeploymentManager.java:62)
flowable-engine | at org.flowable.engine.impl.cmd.DeployCmd.executeDeploy(DeployCmd.java:135)
flowable-engine | at org.flowable.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:70)
flowable-engine | at org.flowable.engine.impl.cmd.DeployCmd.execute(DeployCmd.java:45)
flowable-engine | at org.flowable.engine.impl.interceptor.CommandInvoker$1.run(CommandInvoker.java:67)
flowable-engine | at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperation(CommandInvoker.java:140)
flowable-engine | at org.flowable.engine.impl.interceptor.CommandInvoker.executeOperations(CommandInvoker.java:114)
flowable-engine | at org.flowable.engine.impl.interceptor.CommandInvoker.execute(CommandInvoker.java:72)
flowable-engine | at org.flowable.engine.impl.interceptor.BpmnOverrideContextInterceptor.execute(BpmnOverrideContextInterceptor.java:26)
flowable-engine | at org.flowable.common.engine.impl.interceptor.TransactionContextInterceptor.execute(TransactionContextInterceptor.java:53)
flowable-engine | at org.flowable.common.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:105)
flowable-engine | at org.flowable.common.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:30)
flowable-engine | at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:56)
flowable-engine | at org.flowable.common.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:51)
flowable-engine | at org.flowable.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:99)
flowable-engine | at org.flowable.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:206)
flowable-engine | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
flowable-engine | at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
flowable-engine | at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
flowable-engine | at java.base/java.lang.reflect.Method.invoke(Method.java:566)
flowable-engine | at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
flowable-engine | at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
flowable-engine | at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
flowable-engine | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
flowable-engine | at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
flowable-engine | at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
flowable-engine | at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
flowable-engine | at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
flowable-engine | at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
flowable-engine | at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
flowable-engine | at javax.servlet.http.HttpServlet.service(HttpServlet.java:681)
flowable-engine | at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
flowable-engine | at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
flowable-engine | at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
flowable-engine | at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
flowable-engine | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
flowable-engine | at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
flowable-engine | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
flowable-engine | at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
flowable-engine | at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
flowable-engine | at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
flowable-engine | at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
flowable-engine | at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
flowable-engine | at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
flowable-engine | at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
flowable-engine | at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
flowable-engine | at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
flowable-engine | at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
flowable-engine | at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
flowable-engine | at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
flowable-engine | at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:890)
flowable-engine | at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1787)
flowable-engine | at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
flowable-engine | at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
flowable-engine | at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
flowable-engine | at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
flowable-engine | at java.base/java.lang.Thread.run(Thread.java:829)

Cheers,
Sriram B