Announcement

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

    RPCManager.exportContent with FacetChart broken.

    Hi,

    There is regression with exporting charts to PDF.

    The following sample works using build SmartClient Version: v9.1p_2014-10-10/Pro Deployment (built 2014-10-10).

    The following sample does not work with build SmartClient Version: v9.1p_2014-11-09/Pro Deployment (built 2014-11-09).

    Furthermore, the following sample still does not work with build SmartClient Version: v9.1p_2015-01-27/Pro Deployment (built 2015-01-27).


    Code:
            final FacetChart fc = new FacetChart();
            fc.setChartType(ChartType.PIE);
            fc.setShowTitle(Boolean.FALSE);
            fc.setFacets(new Facet("somefield", ""));
            fc.setValueProperty("somevalue");
            RecordList rl = new RecordList();
            Record r = new Record();
            r.setAttribute("somefield", "A");
            r.setAttribute("somevalue", 1);
            rl.add(r);
            fc.setData(rl);
            Window window = new Window();
            window.setWidth(400);
            window.setHeight(400);
            window.setTitle("Chart Window");
            window.addItem(fc);
    
            IButton downloadPdf1 = new IButton("Download FacetChart");
            downloadPdf1.setWidth(200);
            downloadPdf1.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() {
    
                @Override
                public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                    DSRequest reqProps = new DSRequest();
                    reqProps.setAttribute("skinName", "Enterprise");
                    reqProps.setAttribute("pdfName", "export");
                    RPCManager.exportContent(fc, reqProps);
                }
            });
    
            window.addItem(downloadPdf1);
            window.show();
    Thanks

    #2
    Can you elaborate on what's going wrong for you?

    Providing sample code is great, but it's not actually completely sufficient on its own since the problems between these different builds could be related to installation issues or only appear in specific configurations, such that, even with sample code, we might not reproduce whatever is ailing you.

    Comment


      #3
      Sure.
      Simply click the Download FacetChart button and you should be able to reproduce the issue.
      The request appears to be sent but nothing appears for download.

      Comment


        #4
        What are you seeing in the server-side logs for this request?

        Just to reiterate: if this is a deployment or configuration issue, we may not see the same error or an error at all. So we need the usual details.

        Comment


          #5
          I have attached a screenshot of what I gathered from the SmartClient Developer Console.

          I am not seeing any kind of errors in the Development Mode console, and this is the only logging I have at this point from the server.

          2015-01-28-19:05:11:619 -0500 INFO [http-bio-8080-exec-4] URL: '/xxxxx/xxxxx/sc/IDACall', User-Agent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Firefox/24.0': Moz (Gecko) with Accept-Encoding header
          2015-01-28-19:05:11:625 -0500 INFO [http-bio-8080-exec-4] CharSet used: UTF-8

          The sample was rather simple, so I was hoping you could simply run it locally and determine if the issue was reproducible on your end.

          Regards
          Attached Files

          Comment


            #6
            It's queued to be run just in case, but it resembles, and is in fact simpler than, several automated tests that are coming up green and several samples as well. So we anticipate a "works for me" result and it's best to gather more info so that more progress can be made when this pops to the top of the queue.

            So if you have the time:

            1. is this happening for all your charts, or for any subset you can identify (perhaps only those in Windows or only Pie charts)

            2. when you see server-side processing end abruptly seeming with no exception, in the JVM seemingly stuff in an infinite loop (ie do you see it soaking up CPU time with no other requests going on)

            Comment


              #7
              I have adjusted my log level for the server and found there is some kind of missing library dependency.

              Code:
              2015-01-29-08:59:39:265 -0500  DEBUG [qtp384403810-34] Invocation threw exception
              java.lang.NoClassDefFoundError: org/apache/batik/bridge/UserAgent
              	at com.isomorphic.contentexport.PdfExport.convertSvgImages(PdfExport.java:392)
              	at com.isomorphic.contentexport.PdfExport.convertAllSvgOccurrencesToBase64(PdfExport.java:381)
              	at com.isomorphic.contentexport.PdfExport.getPdfRenderer(PdfExport.java:277)
              	at com.isomorphic.contentexport.PdfExport.getPdfObject(PdfExport.java:77)
              	at com.isomorphic.rpc.BuiltinRPC.getPdfObject(BuiltinRPC.java:851)
              ...
              	at java.lang.Thread.run(Thread.java:744)
              Caused by: java.lang.ClassNotFoundException: org.apache.batik.bridge.UserAgent
              	at java.lang.ClassLoader.findClass(ClassLoader.java:531)
              	at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
              	at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
              	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:407)
              	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:383)
              	... 53 more
              I am surprised that a java.lang.NoClassDefFoundError would be logged on DEBUG rather than ERROR.

              I am wondering if a dependency changed between these builds that we don't have in our deployment. Looks like we need batik-bridge.jar with the later builds?

              Thanks
              Last edited by stonebranch2; 29 Jan 2015, 07:56. Reason: Added more of the stack trace.

              Comment


                #8
                I had a look at http://smartclient.com/smartgwtee-la...endencies.html and the requirements seem to imply that the batik* libraries should only be required for IE6-8, however, my issues are with FF and Chrome.
                (I verified and IE8 did indeed require those batik* libraries with the SmartClient Version: v9.1p_2014-10-10/Pro Deployment (built 2014-10-10))

                Code:
                ...
                Image Export, IE6-8 DrawPane PDF Export - These libraries are required to use RPCManager.exportImage() or if DrawPanes or FacetCharts are to be exported in IE6-8:
                       batik-anim, batik-awt-util, batik-bridge, batik-css, batik-dom, batik-ext, batik-gvt, batik-parser, batik-script, batik-svg-dom, batik-util, batik-xml, xml-apis-ext
                ....
                Additionally, to be able to export images or DrawPanes and FacetCharts in IE6-8, the following libraries are needed:
                  - Batik: batik-anim, batik-awt-util, batik-bridge, batik-css, batik-dom, batik-ext, batik-gvt, batik-parser, batik-script, batik-svg-dom, batik-util, batik-xml: Apache License, Version 2.0
                  - xml-commons External Components: xml-apis-ext: W3C Software Notice and License
                ...
                Last edited by stonebranch2; 29 Jan 2015, 08:20. Reason: Fixed note about IE8 and build SmartClient Version: v9.1p_2014-10-10/Pro Deployment (built 2014-10-10)

                Comment


                  #9
                  We have added the batik* libraries to our deployment and the newer builds now work.

                  Seems like a code change in the later builds made the batik* libraries a requirement whereas they were not previously.

                  Comment


                    #10
                    To summarize:

                    It appears that with build "v9.1p_2014-10-10/Pro Deployment (built 2014-10-10)", only IE6-8 had a dependency on the batik* libraries.

                    Now, with "v9.1p_2014-11-09/Pro Deployment (built 2014-11-09)" and later builds, the dependency for the batik* libraries would appear to apply for both Firefox and Chrome, which seems to be inconsistent with http://smartclient.com/smartgwtee-la...endencies.html.

                    Comment


                      #11
                      Hi Isomorphic,
                      Will you be following up with this case soon?
                      Thanks
                      Last edited by stonebranch2; 2 Feb 2015, 04:33.

                      Comment


                        #12
                        Yes, this will still be looked at, it's just no longer a functional issue per se (and the issue is well reported) so it got demoted in severity.

                        Comment

                        Working...
                        X