You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2019/03/04 15:56:12 UTC

[Bug 63230] New: ClassCastException on OpenJDK 11

https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

            Bug ID: 63230
           Summary: ClassCastException on OpenJDK 11
           Product: POI
           Version: 3.17-FINAL
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: POI Overall
          Assignee: dev@poi.apache.org
          Reporter: noa@salt-solutions.de
  Target Milestone: ---

Hello,

i running a java application on Linux maschines with openJdk 11. When creating
a worksheet like 

 SXSSFWorkbook workbook = new SXSSFWorkbook(-1);
 SXSSFSheet sheet = workbook.createSheet("testsheet");

i run into follwoing error:

 java.lang.ClassCastException: class sun.font.CompositeFont cannot be cast to
class sun.font.PhysicalFont (sun.font.CompositeFont and sun.font.PhysicalFont
are in module java.desktop of loader 'bootstrap') at
sun.font.SunFontManager.getDefaultPhysicalFont(SunFontManager.java:1086) ~[?:?]
at sun.font.SunFontManager.initialiseDeferredFont(SunFontManager.java:965)
~[?:?]
at sun.font.SunFontManager.findOtherDeferredFont(SunFontManager.java:903)
~[?:?]
at sun.font.SunFontManager.findDeferredFont(SunFontManager.java:919) ~[?:?]
at sun.font.SunFontManager.findFont2D(SunFontManager.java:2120) ~[?:?]
at java.awt.Font.getFont2D(Font.java:506) ~[?:?] at
java.awt.Font.canDisplayUpTo(Font.java:2246) ~[?:?]
at java.awt.font.TextLayout.singleFont(TextLayout.java:469) ~[?:?]
at java.awt.font.TextLayout.<init>(TextLayout.java:530) ~[?:?]
at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:273)
~[poi-4.0.1.jar!/:4.0.1]
at
org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
~[poi-ooxml-4.0.1.jar!/:4.0.1]
at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:82)
~[poi-ooxml-4.0.1.jar!/:4.0.1]
at
org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:664)
~[poi-ooxml-4.0.1.jar!/:4.0.1]
at
org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:685)
~[poi-ooxml-4.0.1.jar!/:4.0.1]

Everthing works fine with openJdk10 or if i run it under windows. 
Hope you can help?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|NEEDINFO                    |RESOLVED

--- Comment #5 from Dominik Stadler <do...@gmx.at> ---
There is a related question at
https://stackoverflow.com/questions/54554625/openjdk-11-java-lang-classcastexception-class-sun-font-compositefont-cannot-be,
but no solution or hint.

It seems OpenJDK does not include some font-related stuff any more and your
operating system is currently not providing any by itself. Maybe you can try to
install some font-related packages to see if that solves the problem.

See also the release notes at
https://www.oracle.com/technetwork/java/javase/11-relnote-issues-5012449.html#JDK-8191522 

Overall I don't think we can do much in Apache POI itself as the problem is a
combination of installed os-packages and OpenJDK 11.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO

--- Comment #3 from Dominik Stadler <do...@gmx.at> ---
We cannot reproduce this locally and also not in CI, we run our large set of
unit-tests against various versions of the JDK, so this seems to be something
that is caused by your local setup of font-related packages.

What exact operating system are you running? 

Can you also attach a list of font-related packages that are installed? I.e.
something like the output of "dpkg --list | grep -i font"?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

M. Noack <no...@salt-solutions.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|3.17-FINAL                  |4.0.x-dev

--- Comment #2 from M. Noack <no...@salt-solutions.de> ---
I did already. Sorry I did not mentioned it. Same problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

--- Comment #1 from PJ Fanning <fa...@yahoo.com> ---
Can you try with the latest POI release - 4.0.1?

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

--- Comment #4 from M. Noack <no...@salt-solutions.de> ---
We are running Suse Linux Enterprise Server 11.4. There are no font-related
packages installed.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


[Bug 63230] ClassCastException on OpenJDK 11

Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=63230

--- Comment #6 from Dominik Stadler <do...@gmx.at> ---
FYI, installing OpenJKD 11 on a bare Ubuntu system wants to install
"fontconfig" and "fonts-dejavu-core", maybe there are similar packages on Suse.

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org