Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    SmartGWT Pro 5.1 Excel export fail with Apache POI 3.17

    Hi Isomorfic,

    I have an issue where Smartgwt is used on web server (TomCat based) to extend standard functionality with Web Rich Application.

    We have a licence for SmartGWT Pro 5.1 (v10.1p_2016-02-05Pro)
    Also tested with latest night build (SmartGWT Pro 5.1 2020-02-18)
    and using GWT 2.7.0
    compiling on Java 8
    Runtime environment:
    openjdk version "11.0.3" 2019-04-16
    OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3+7)

    Our web server after upgarde now contains Apache POI 3.17. And SmartGWT is now taking those POI lib files. During Excel export (OOXML) we get error:

    Code:
    2020/02/24 15:08:35.984 | java.lang.InternalError: java.lang.reflect.InvocationTargetException
    2020/02/24 15:08:35.985 |     at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:86)
    2020/02/24 15:08:35.985 |     at java.base/java.security.AccessController.doPrivileged(Native Method)
    2020/02/24 15:08:35.985 |     at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:74)
    2020/02/24 15:08:35.985 |     at java.desktop/java.awt.Font.getFont2D(Font.java:497)
    2020/02/24 15:08:35.985 |     at java.desktop/java.awt.Font.canDisplayUpTo(Font.java:2246)
    2020/02/24 15:08:35.985 |     at java.desktop/java.awt.font.TextLayout.singleFont(TextLayout.java:469)
    2020/02/24 15:08:35.985 |     at java.desktop/java.awt.font.TextLayout.<init>(TextLayout.java:530)
    2020/02/24 15:08:35.985 |     at org.apache.poi.ss.util.SheetUtil.getDefaultCharWidth(SheetUtil.java:275)
    2020/02/24 15:08:35.985 |     at org.apache.poi.xssf.streaming.AutoSizeColumnTracker.<init>(AutoSizeColumnTracker.java:117)
    2020/02/24 15:08:35.985 |     at org.apache.poi.xssf.streaming.SXSSFSheet.<init>(SXSSFSheet.java:82)
    2020/02/24 15:08:35.985 |     at org.apache.poi.xssf.streaming.SXSSFWorkbook.createAndRegisterSXSSFSheet(SXSSFWorkbook.java:658)
    2020/02/24 15:08:35.985 |     at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:650)
    2020/02/24 15:08:35.985 |     at org.apache.poi.xssf.streaming.SXSSFWorkbook.createSheet(SXSSFWorkbook.java:90)
    2020/02/24 15:08:35.985 |     at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:384)
    2020/02/24 15:08:35.985 |     at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:630)
    2020/02/24 15:08:35.985 |     at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:454)
    2020/02/24 15:08:35.985 |     at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1254)
    2020/02/24 15:08:35.985 |     at com.isomorphic.rpc.RPCManager.send(RPCManager.java:694)
    2020/02/24 15:08:35.985 |     at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:187)
    2020/02/24 15:08:35.985 |     at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:152)
    2020/02/24 15:08:35.985 |     at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
    2020/02/24 15:08:35.985 |     at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
    2020/02/24 15:08:35.985 |     at javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
    2020/02/24 15:08:35.985 |     at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
    2020/02/24 15:08:35.985 |     at javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.985 |     at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.985 |     at com.niku.union.web.filter.ResponseHeaders.doFilter(ResponseHeaders.java:73)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.985 |     at com.niku.union.web.filter.ResponseSecurityHeaders.doFilter(ResponseSecurityHeaders.java:158)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.985 |     at com.niku.union.web.filter.ClarityContentFilter.doFilter(ClarityContentFilter.java:153)
    2020/02/24 15:08:35.985 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.986 |     at com.niku.union.web.filter.XSSFilter.doFilter(XSSFilter.java:88)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.986 |     at com.niku.union.web.filter.TenantSetupFilter.doFilter(TenantSetupFilter.java:55)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.986 |     at com.niku.union.web.filter.CharsetFilter.doFilter(CharsetFilter.java:45)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.filters.AddDefaultCharsetFilter.doFilter(AddDefaultCharsetFilter.java:89)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140)
    2020/02/24 15:08:35.986 |     at com.niku.union.web.valves.ErrorPageRedirectValve.invoke(ErrorPageRedirectValve.java:63)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:650)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87)
    2020/02/24 15:08:35.986 |     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342)
    2020/02/24 15:08:35.986 |     at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800)
    2020/02/24 15:08:35.986 |     at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
    2020/02/24 15:08:35.986 |     at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806)
    2020/02/24 15:08:35.986 |     at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498)
    2020/02/24 15:08:35.986 |     at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
    2020/02/24 15:08:35.986 |     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    2020/02/24 15:08:35.986 |     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    2020/02/24 15:08:35.986 |     at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    2020/02/24 15:08:35.986 |     at java.base/java.lang.Thread.run(Thread.java:834)
    2020/02/24 15:08:35.986 | Caused by: java.lang.reflect.InvocationTargetException
    2020/02/24 15:08:35.986 |     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    2020/02/24 15:08:35.986 |     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    2020/02/24 15:08:35.986 |     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    2020/02/24 15:08:35.986 |     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:84)
    2020/02/24 15:08:35.986 |     ... 67 more
    2020/02/24 15:08:35.986 | Caused by: java.lang.NullPointerException
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:225)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:107)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:719)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:367)
    2020/02/24 15:08:35.986 |     at java.base/java.security.AccessController.doPrivileged(Native Method)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:312)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35)
    2020/02/24 15:08:35.986 |     at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56)
    2020/02/24 15:08:35.986 |     ... 72 more
    To reproduce the same issue I used SmartGWT example "builtinds" with code extension (see attachment "BuiltInDS.java")
    Also replaced SmartGWT libs:
    1. poi-3.13-20150929.jar
    2. poi-ooxml-3.13-20150929.jar
    3. poi-ooxml-schemas-3.13-20150929.jar
    4. xbean.jar (version 2.4.0)
    with the ones downloaded from Apache POI:
    1. poi-3.17.jar
    2. poi-ooxml-3.17.jar
    3. poi-ooxml-schemas-3.17.jar
    4. poi-scratchpad-3.17.jar
    5. commons-collections4-4.1.jar
    6. curvesapi-1.04.jar
    7. xmlbeans-2.6.0.jar
    Running from Eclipse getting also error:
    Code:
    === 2020-02-24 14:29:20,088 [0-27] DEBUG ExcelDataExport - Export streaming mode: true
    java.lang.NoSuchMethodError: org.apache.poi.ss.usermodel.CellStyle.setVerticalAlignment(S)V
    at com.isomorphic.rpc.ExcelDataExport$HeaderStyle.createHeaderStyle(ExcelDataExport.java:309)
    at com.isomorphic.rpc.ExcelDataExport$HeaderStyle.<init>(ExcelDataExport.java:275)
    at com.isomorphic.rpc.ExcelDataExport.getExportObject(ExcelDataExport.java:443)
    at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:645)
    at com.isomorphic.rpc.DataExport.exportResultSet(DataExport.java:454)
    at com.isomorphic.rpc.RPCManager.completeResponse(RPCManager.java:1262)
    at com.isomorphic.rpc.RPCManager.send(RPCManager.java:695)
    at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:183)
    at com.isomorphic.servlet.IDACall.processRequest(IDACall.java:148)
    at com.isomorphic.servlet.IDACall._processRequest(IDACall.java:119)
    at com.isomorphic.servlet.IDACall.doPost(IDACall.java:79)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
    at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:162)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
    at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:428)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.handler.RequestLogHandler.handle(RequestLogHandler.java:68)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
    at org.eclipse.jetty.server.Server.handle(Server.java:370)
    at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
    at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:960)
    at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1021)
    at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
    at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
    at org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:668)
    at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
    at java.lang.Thread.run(Thread.java:748)
    I see 3 possible solutions:
    1. Fix SmartGWT 5.1 to support POI 3.17
    2. Somehow force only SmartGWT to load older POI 3.13
    3. Buy Licence for SmartGWT 12 which now supports POI 3.17 (the least our company wants to do)
    What would be Your suggestions?
    Attached Files
    Last edited by tvizgaitis; 24 Feb 2020, 07:15.

    #2
    It actually looks like you have more than one version of POI and/or dependent libraries in the classpath - these don't look like incompatibilities between POI and SmartGWT but just scrambled libraries. Start there.

    Comment

    Working...
    X