Hi @MohanReddy and welcome to the forum.
The problem here seems to be something in your underlying service, which you’re calling.
From the exception I would say, you are using some library that needs fonts on the os. Locally that’s no problem, but your build server is probably headless and has no corresponding fonts installed.
Is this exception happening during testing?
If so then maybe it would be better to mock the real functionality in the unit test.
Yes there will definitely be no fonts on the github runner, as that is running headless.
As I said mock that call to some library, which needs the fonts, in your unit test (at least that’s still what I think it is, where this code is called).
I am calling the code from Junit Testing.
Actually, I have a service task which is using Expression for setting up one of the variables. While Evaluation it will call the One of the Service which will produce the PDF document. While Preparing the PDF document. I am getting the sun Microsoft fonts are not available.
For generating PDF documents you probably need fonts.
So I think you have two possible alternatives:
Mock away the creation of the PDF document to just test the process and how the token moves
Move the build of your project to a github runner where fonts are installed
Also look at the library whether you can provide fonts as resources on the classpath and not rely on those installed on the operating system. Might also be an option.
But same functionality has been working from long ago. All of a sudden GitHub pipeline giving me error that it can’t find the fonts. It is because of missing fonts from server, I think.