Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fj-doc-mod-poi] On linux sometimes you may get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet() #10

Open
fugerit79 opened this issue Jan 4, 2023 · 0 comments
Assignees
Labels
bug Something isn't working fj-doc-mod-poi Affects only fj-doc-mod-poi wontfix This will not be worked on

Comments

@fugerit79
Copy link
Member

fugerit79 commented Jan 4, 2023

On linux server with no graphical interface, is possible to get the an error when invoking :
at org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet()
For instance on :
at org.fugerit.java.doc.mod.poi.BasicPoiTypeHandler.handle()

Tested on jdk : jdk-11.0.16.1 (for linux arm)

Fix : install the fontconfig package on your system. (source)

Here is a sample stack trace for version fj-doc-mod-poi version 0.7.2

java.lang.InternalError: java.lang.reflect.InvocationTargetException
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
	at java.desktop/java.awt.Font.getFont2D(Font.java:497)
	at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2250)
	at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
	at java.desktop/java.awt.font.TextLayout.<init>(TextLayout.java:530)
	at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273)
	at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:248)
	at org.apache.poi.ss.util.SheetUtil.getColumnWidth(SheetUtil.java:233)
	at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:555)
	at org.apache.poi.xssf.usermodel.XSSFSheet.autoSizeColumn(XSSFSheet.java:537)
	at org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet(PoiUtils.java:17)
	at org.fugerit.java.doc.mod.poi.PoiUtils.autoSizeColumns(PoiUtils.java:25)
	at org.fugerit.java.doc.mod.poi.BasicPoiTypeHandler.handle(BasicPoiTypeHandler.java:292)
	at org.fugerit.java.doc.lib.simpletable.SimpleTableDocConfig.processSimpleTable(SimpleTableDocConfig.java:60)
	at org.fugerit.java.doc.playground.doc.GenerateRest.validate(GenerateRest.java:142)
	at org.fugerit.java.doc.playground.doc.GenerateRest_ClientProxy.validate(Unknown Source)
	at org.fugerit.java.doc.playground.doc.GenerateRest$quarkusrestinvoker$validate_9602abc43de303ad70b38c0fbaa7c81272957d46.invoke(Unknown Source)
	at org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
	at io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:114)
	at org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:145)
	at io.quarkus.vertx.core.runtime.VertxCoreRecorder$14.runWith(VertxCoreRecorder.java:576)
	at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2449)
	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1478)
	at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
	at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:29)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
	at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
	... 28 more
Caused by: java.lang.NullPointerException
	at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
	at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
	at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
	at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
	at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:379)
	at java.base/java.security.AccessController.doPrivileged(Native Method)
	at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:324)
	at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
	at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
@fugerit79 fugerit79 added bug Something isn't working wontfix This will not be worked on labels Jan 4, 2023
@fugerit79 fugerit79 self-assigned this Jan 4, 2023
@fugerit79 fugerit79 changed the title On linux is possible to get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet() On linux sometimes you may get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet() Jan 4, 2023
@fugerit79 fugerit79 added the fj-doc-mod-poi Affects only fj-doc-mod-poi label Jan 4, 2023
@fugerit79 fugerit79 changed the title On linux sometimes you may get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet() [fj-doc-mod-poi] On linux sometimes you may get a java.lang.InternalError on org.fugerit.java.doc.mod.poi.PoiUtils.resizeSheet() Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fj-doc-mod-poi Affects only fj-doc-mod-poi wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant