Announcement

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

    Window Modal with HTMLPane keeps requesting indefinitely (SmartGWT / Jasperserver)

    Hello there,

    I'm trying to integrate a web application built with Smart GWT technology and a report server which is Jasper Report Server. What I'm trying to do is display the jasper reports inside a modal (Windows class with a HTMLPane inside). Inside the iFrame the Jasper report would be displayed with its viewer. This is the source that I'm using:

    Code:
        DataSource jasperDS = CrimsonDataSource.getDataSource("JasperReportDTO");
        Criteria criteria = new Criteria("report_id",reportId);
        jasperDS.fetchData(criteria, new DSCallback() {
    
          @Override
          public void execute(DSResponse dsResponse, Object data, DSRequest dsRequest) {
            Record[] recordArray = dsResponse.getData();
            if (recordArray != null && recordArray.length > 0) {
              Record record = recordArray[0];
    
              if(record != null && record.getAttribute("report_url") != null) {
                final String url = record.getAttribute("report_url") + parameters;
    
                final Window popupWindowModal = new Window();
                popupWindowModal.setTitle("Jasper Report Server");
                popupWindowModal.setWidth("1000px");
                popupWindowModal.setHeight("690px");
                popupWindowModal.setIsModal(true);
                popupWindowModal.setShowMinimizeButton(false);
                popupWindowModal.setShowModalMask(true);
                popupWindowModal.centerInPage();
                popupWindowModal.setCanDragReposition(false);
    
    
                final HTMLPane htmlPane = new HTMLPane();
                htmlPane.setHeight100();
                htmlPane.setWidth100();
                htmlPane.setContentsType(ContentsType.PAGE);
                htmlPane.setContentsURL(url);
    
                popupWindowModal.addItem(htmlPane);
                RootLayoutPanel.get().add(popupWindowModal);
    
              } else {
                LOGGER.info("No record found for this report.");
              }
            }
          }
        });
    Ok, first install the whole Jasper server in a local environment (on my computer) and it works correctly as I thought (with localhost). The report was displayed correctly in the iFrame ...

    Now, I have configured the Jasper server on a virtual machine hosted on AWS. Likewise, I have also deployed my application in another separate virtual machine, in the same hosting (both belong to a private network).

    When I access my web application (the one that is hosted on AWS) in my browser (my computer), when trying to open a Jasper report, the iframe stays loading forever. If I open the console and inspect the Network (Chrome) section, I notice that it is repeatedly calling the same resources, without ending ... (unless I close the browser).

    The IP that I'm using to access the server is the public one and I would like to know if I need a piece of code to avoid this behavior.

    If I make the application that is hosted on AWS run my local reporting server, if it is showing it ... (which confuses me a bit).

    #2
    Is it repeatedly requesting the main page HTML from the server? If so, that suggests that logic in the page delivered by Jasper is reloading the page, possibly because Jasper thinks it has detected an error condition or is trying to redirect to another URL.

    But we can’t tell you why it would do that if so - that would be something to ask on a Jasper forum.

    And if that is the problem, you can probably reproduce with a simple static HTML page with an iframe targeting the same Jasper URL.

    Another, less likely possibility would be that the SmartGWT iframe is continuously redrawing. That would be visible in the redraw count shown in the SmartGWT Developer Console, and the reason for the redraws would be logged in the “redraws” category.

    Comment

    Working...
    X