Announcement

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

    RPCManager - java.lang.Exception: Response has already been committed

    Hello,

    We ordered today a developer license of the PRO version 7.0.
    We currently use evaluation version 7.0RC2.
    we have a random message at the server side when we call

    Code:
    rpc.send(dsRequest, dsResponse);
    Here is the log message

    Code:
    === 2009-12-11 14:54:02,703 [80-1] INFO  DSResponse - DSResponse: List with 6 items
    === 2009-12-11 14:54:02,703 [80-1] WARN  RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()
    === 2009-12-11 14:54:02,703 [80-1] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2009-12-11 14:54:02,703 [80-1] DEBUG RPCManager - non-DMI response, dropExtraFields: true
    Here is the Select list which can't retry the data when we click on the pickerButton of iduniteGestion item

    Code:
          {name:"iduniteGestion", title:"Unite de gestion", width:"180px", autoFetchData:false, required:true,
                type:"select", optionDataSource:ListUniteGestionDS, displayField: "libelle_FR",  valueField: "id"
          }
    The problem occur when the server a bit slow to respond (about 200ms).

    Here is the entire javascript and after the FireBug Console sequence.

    Code:
    isc.RPCManager.actionURL = "smartAjax1";
    
    isc.DataSource.create({
       ID:"ListProdFrnDS",
       fields:[
          {name:"id", type:"text", primaryKey:"true" },
          {name:"libelle", type:"text"},
          {name:"categorieProd", type:"text"},
          {name:"idcategorieProd", type:"integer"},
          {name:"iduniteGestion", type:"integer"}
       ]
    });
    
    isc.DataSource.create({
       ID:"ListCategorieProdFrnDS",
       fields:[
          {name:"id", type:"sequence", primaryKey:"true" },
          {name:"libelle", type:"text"}
       ]
    });
    
    isc.DataSource.create({
       ID:"ListUniteGestionDS",
       fields:[
          {name:"id", type:"sequence", primaryKey:"true" },
          {name:"libelle_FR", type:"text"},
          {name:"libelle_IT", type:"text"},
          {name:"libelle_DE", type:"text"},
          {name:"libelle_ES", type:"text"},
          {name:"libelle_EN", type:"text"}
       ]});
    
    isc.ListGrid.create({
       ID:"GestProdFrnList",
       dataSource:ListProdFrnDS,
       autoFetchData: true,
       autoFitData:"vertical",
       autoFitMaxHeight:isc.Page.getHeight() - 165,
       canEdit: true,
       editEvent: "click",
       cellPadding:3,
       alternateRecordStyles:true,
       canReorderFields:false,
       canResizeFields:true,
       canSort:false,
       canRemoveRecords:true,
       groupStartOpen:"all",
       groupByField:"idcategorieProd",
       fields:[
          {name:"libelle", title:"Produit ou service", width:"100%", required:true},
          {name:"idcategorieProd", title:"Catégorie", width:"100%", autoFetchData:false, required:true,
               type:"select", optionDataSource:ListCategorieProdFrnDS, displayField: "libelle",  valueField: "id",
               getGroupValue : function (value, record, field, fieldName, grid) {
                  return record.categorieProd;
               }
          },
          {name:"iduniteGestion", title:"Unite de gestion", width:"180px", autoFetchData:false, required:true,
                type:"select", optionDataSource:ListUniteGestionDS, displayField: "libelle_FR",  valueField: "id"
          }
       ]
    });
    
    isc.ListGrid.create({
       ID:"GestCategorieProdFrnList",
       dataSource:ListCategorieProdFrnDS,
       autoFetchData: true,
       autoFitData:"vertical",
       autoFitMaxHeight:isc.Page.getHeight() - 165,
       cellPadding:3,
       canEdit: true,
       editEvent: "click",
       alternateRecordStyles:true,
       canReorderFields:false,
       canResizeFields:true,
       canRemoveRecords:true,
       fields:[
          {name:"libelle", title:"Catégorie", width:"100%", required:true}
       ]
    });
    
    isc.ListGrid.create({
       ID:"GestUniteGestionList",
       dataSource:ListUniteGestionDS,
       autoFetchData: true,
       width:"100%",
       autoFitData:"vertical",
       autoFitMaxHeight:isc.Page.getHeight() - 165,
       canEdit: true,
       editEvent: "click",
       cellPadding:3,
       alternateRecordStyles:true,
       canReorderRecords:true,
       canReorderFields:false,
       canResizeFields:true,
       canRemoveRecords:true,
       fields:[
          {name:"libelle_FR", title:"Français", width:"100%", required:true},
          {name:"libelle_IT", title:"Italien", width:"100%"},
          {name:"libelle_DE", title:"Allemand", width:"100%"},
          {name:"libelle_ES", title:"Espagnol", width:"100%"},
          {name:"libelle_EN", title:"Anglais", width:"100%"}
       ]
    });
    
    isc.SectionStack.create({
       ID: "GestProduitSectionStack",
       visibilityMode: "mutex",
       width: "100%", height: "100%",
       sections: [
          {title: "Produits", expanded: true, resizeable:false, canCollapse: true, 
             controls:[
                isc.refreshStackButton.create({click:"GestProdFrnList.invalidateCache();"}),
                isc.addStackButton.create({click:"GestProdFrnList.startEditingNew()"})
                ],
             items: [GestProdFrnList]
          },
          {title: "Catégories de produit", expanded: false, resizeable:false, canCollapse: true, 
             controls:[
                isc.refreshStackButton.create({click:"GestCategorieProdFrnList.invalidateCache();"}),
                isc.addStackButton.create({click:"GestCategorieProdFrnList.startEditingNew()"})
             ],
             items: [GestCategorieProdFrnList]
          },
          {title: "Unités de gestion", expanded: false, canCollapse: true, 
             controls:[
                isc.refreshStackButton.create({click:"GestUniteGestionList.invalidateCache();"}),
                isc.addStackButton.create({click:"GestUniteGestionList.startEditingNew()"})
             ],
             items: [GestUniteGestionList]
          }
       ]
    });
    
    function init_gest_produit(first_appel) {
       if (first_appel) {
          GestProduitPane.removeChild(GestProduitLoadMsg);
          GestProduitPane.addChild(GestProduitSectionStack);
       }
    }
    Here is the exchange sequence in the Firebug console

    First we retrieve as well the ListGrid with SelectIem content

    Code:
    _transaction	<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">2</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"></criteria><operationConfig xsi:type="xsd:Object"><dataSource>ListProdFrnDS</dataSource><operationType>fetch</operationType><textMatchStyle>substring</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">1000</endRow><componentId>GestProdFrnList</componentId><appID>builtinApplication</appID><operation>ListProdFrnDS_fetch</operation><oldValues xsi:type="xsd:Object"></oldValues></elem><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"></criteria><operationConfig xsi:type="xsd:Object"><dataSource>ListUniteGestionDS</dataSource><operationType>fetch</operationType></operationConfig><outputs xsi:type="xsd:List"><elem>libelle_FR</elem><elem>id</elem></outputs><appID>builtinApplication</appID><operation>ListUniteGestionDS_fetch</operation><oldValues xsi:type="xsd:Object"></oldValues></elem><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"></criteria><operationConfig xsi:type="xsd:Object"><dataSource>ListCategorieProdFrnDS</dataSource><operationType>fetch</operationType></operationConfig><outputs xsi:type="xsd:List"><elem>libelle</elem><elem>id</elem></outputs><appID>builtinApplication</appID><operation>ListCategorieProdFrnDS_fetch</operation><oldValues xsi:type="xsd:Object"></oldValues></elem></operations></transaction>
    Code:
    //isc_RPCResponseStart-->[
        {
            invalidateCache:false,
            endRow:3,
            data:[
                {
                    iduniteGestion:2,
                    idcategorieProd:1,
                    categorieProd:"Carburants, Huiles, Adblue",
                    id:1,
                    libelle:"Gaz"
                },
                {
                    iduniteGestion:3,
                    idcategorieProd:1,
                    categorieProd:"Carburants, Huiles, Adblue",
                    id:4,
                    libelle:"Shell Lubrifiants"
                },
                {
                    iduniteGestion:1,
                    idcategorieProd:2,
                    categorieProd:"Service",
                    id:2,
                    libelle:"Interim"
                },
                {
                    iduniteGestion:2,
                    idcategorieProd:3,
                    categorieProd:"Téléphonie",
                    id:3,
                    libelle:"Nb de lignes"
                }
            ],
            status:0,
            totalRows:4,
            startRow:0,
            isDSResponse:true
        },
        {
            invalidateCache:false,
            endRow:4,
            data:[
                {
                    id:3,
                    libelle_DE:"Liter",
                    libelle_EN:"Liter",
                    libelle_ES:"Liter",
                    libelle_FR:"Litre",
                    libelle_IT:"Liter"
                },
                {
                    id:4,
                    libelle_DE:"Cubic meter",
                    libelle_EN:"Cubic meter",
                    libelle_ES:"Cubic meter",
                    libelle_FR:"Mètre cube",
                    libelle_IT:"Cubic meter"
                },
                {
                    id:1,
                    libelle_DE:"Without",
                    libelle_EN:"Without",
                    libelle_ES:"Without",
                    libelle_FR:"Sans",
                    libelle_IT:"Without"
                },
                {
                    id:5,
                    libelle_DE:"Tonne",
                    libelle_EN:"Tonne",
                    libelle_ES:"Tonne",
                    libelle_FR:"Tonne",
                    libelle_IT:"Tonne"
                },
                {
                    id:2,
                    libelle_DE:"Unit",
                    libelle_EN:"Unit",
                    libelle_ES:"Unit",
                    libelle_FR:"Unité",
                    libelle_IT:"Unit"
                }
            ],
            status:0,
            totalRows:5,
            startRow:0,
            isDSResponse:true
        },
        {
            invalidateCache:false,
            endRow:22,
            data:[
                {
                    id:7,
                    libelle:"Administration"
                },
                {
                    id:21,
                    libelle:"Autoroutes"
                },
                {
                    id:22,
                    libelle:"Autres"
                },
                {
                    id:10,
                    libelle:"Cadeaux de fin d'année"
                },
                {
                    id:1,
                    libelle:"Carburants, Huiles, Adblue"
                },
                {
                    id:11,
                    libelle:"Formation"
                },
                {
                    id:12,
                    libelle:"Gaz"
                },
                {
                    id:13,
                    libelle:"Hygiène et Sécurité"
                },
                {
                    id:23,
                    libelle:"Incendie"
                },
                {
                    id:24,
                    libelle:"Informatique"
                },
                {
                    id:15,
                    libelle:"Intérim"
                },
                {
                    id:16,
                    libelle:"Location de Véhicule PL et VL"
                },
                {
                    id:25,
                    libelle:"Matériel roulant - Carrossier"
                },
                {
                    id:26,
                    libelle:"Matériel roulant - Levage et/ou manutention"
                },
                {
                    id:18,
                    libelle:"Matériel Roulant - Moteur"
                },
                {
                    id:19,
                    libelle:"Matériel Roulant - Pièces détachées"
                },
                {
                    id:27,
                    libelle:"Matériel roulant - Remorque"
                },
                {
                    id:28,
                    libelle:"Matériel roulant - Voiture"
                },
                {
                    id:29,
                    libelle:"Outillage et petit matériel"
                },
                {
                    id:30,
                    libelle:"Pneumatique"
                },
                {
                    id:2,
                    libelle:"Service"
                },
                {
                    id:3,
                    libelle:"Téléphonie"
                },
                {
                    id:31,
                    libelle:"Traversée mer"
                }
            ],
            status:0,
            totalRows:23,
            startRow:0,
            isDSResponse:true
        }
    ]//isc_RPCResponseEnd
    And when we click on the pickerButton of iduniteGestion item
    SmartClient try to retrieve SelectIem content once again and the WARN occurs

    Code:
    _transaction	<transaction xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xsi:type="xsd:Object"><transactionNum xsi:type="xsd:long">3</transactionNum><operations xsi:type="xsd:List"><elem xsi:type="xsd:Object"><criteria xsi:type="xsd:Object"></criteria><operationConfig xsi:type="xsd:Object"><dataSource>ListUniteGestionDS</dataSource><operationType>fetch</operationType><textMatchStyle>startsWith</textMatchStyle></operationConfig><startRow xsi:type="xsd:long">0</startRow><endRow xsi:type="xsd:long">75</endRow><componentId>isc_PickListMenu_217</componentId><appID>builtinApplication</appID><operation>ListUniteGestionDS_fetch</operation><oldValues xsi:type="xsd:Object"></oldValues></elem></operations></transaction>
    protocolVersion	1.0
    => Empty response....!

    Thanks you for your help, I found no answer on either the forum or in the doc.

    Pierre
    Last edited by jwpartners; 11 Dec 2009, 09:03.

    #2
    The problem appears to be with your server-side code - you must be making some calls to the httpServletResponse directly or perhaps calling RPCManager in an invalid sequence. If that doesn't clear it up, the server-side code is what you need to post.

    Comment


      #3
      the server-side code

      Hello,

      ok, here is the server side code.
      I d'ont make some calls to the httpServletResponse directly.
      But perhaps another thing wrong.

      Thanks you.

      Code:
         protected void traitement(HttpServletRequest request, HttpServletResponse response) throws Exception {
            RPCManager rpc;
            try {
               rpc = new RPCManager(request, response, out);
      
               for (Iterator i = rpc.getRequests().iterator(); i.hasNext();) {
                  Object req = i.next();
                  if (req instanceof RPCRequest) {
                     throw new Exception("This example expects only DSRequests");
                  }
                  DSRequest dsRequest = (DSRequest) req;
      
                  traiteDsRequest(dsRequest, rpc);
               }
            } catch (Exception ex) {
               log.fatal("FATAL AjaxServletSmart.traitement() :", ex);
            }
         }
         private void traiteDsRequest(DSRequest dsRequest, RPCManager rpc) throws Exception {
            String dsName = dsRequest.getDataSourceName();
            DataSource dataSource = dsRequest.getDataSource();
            DSResponse dsResponse = new DSResponse(dataSource);
            dsResponse.setSuccess();
            String operation = dsRequest.getOperationType();
      
            try {
               if (! traiteDataSource(dsName, operation, dsRequest, rpc, dsResponse)) {
                  // a datasource request that we don't care to override, just invoke
                  // default processing logic
                  rpc.send(dsRequest, dsRequest.execute());
               }
            } catch (Exception ex) {
               dsResponse.setFailure();
               dsResponse.setData("Erreur serveur: " + dsName + " / " + operation + ". " + ex.getMessage());
               rpc.send(dsRequest, dsResponse);
               ex.printStackTrace();
               throw new Exception(ex.getMessage()+ ". (" + dsName + " / " + operation+")");
            }
         }
      Code:
         protected boolean traiteDataSource(String dsName, String operation, DSRequest dsRequest, RPCManager rpc, DSResponse dsResponse) throws Exception {
            boolean dataSourceExiste = true;
            if ("ListAdherentDS".equals(dsName))
               traiteListAdherentDS(operation, dsRequest, rpc, dsResponse);
            else if ("DeclAchatCsvDS".equals(dsName))
               traiteDeclAchatCsvDS(operation, dsRequest, rpc, dsResponse);
            else if ("ListFreqDeclDS".equals(dsName))
               traiteListFreqDeclDS(operation, dsRequest, rpc, dsResponse);
            else if ("ListProdFrnDS".equals(dsName))
               traiteListProdFrnDS(operation, dsRequest, rpc, dsResponse);
            else if ("ListCategorieProdFrnDS".equals(dsName))
               traiteListCategorieProdFrnDS(operation, dsRequest, rpc, dsResponse);
            else if ("ListUniteGestionDS".equals(dsName))
               traiteListUniteGestionDS(operation, dsRequest, rpc, dsResponse);
            else if ("ListDateFinDeclDS".equals(dsName))
               traiteListDateFinDeclDS(operation, dsRequest, rpc, dsResponse);
            else
               dataSourceExiste = false;
            return dataSourceExiste;
         }
      ListProdFrnDS

      Code:
         private void traiteListProdFrnDS(String operation, DSRequest dsRequest, RPCManager rpc, DSResponse dsResponse) throws Exception {
            if (operation.equals(DataSource.OP_FETCH)) {
               long startRow = (int) dsRequest.getStartRow();
               long endRow = (int) dsRequest.getEndRow();
               FetchListe fetchListe = echangeDAO2.getProduitsFrn(startRow, endRow);
               if (fetchListe.list != null) {
                  dsResponse.setData(fetchListe.list);
                  dsResponse.setStartRow(startRow);
                  dsResponse.setEndRow(startRow + fetchListe.totalRows - 1);
               }
               dsResponse.setTotalRows(fetchListe.totalRows);
            } else if (operation.equals(DataSource.OP_UPDATE) || operation.equals(DataSource.OP_ADD)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               String libelleProd = (String) dsRequest.getFieldValue("libelle");
               Long idCategorie = (Long) dsRequest.getFieldValue("idcategorieProd");
               Long idUniteGestion = (Long) dsRequest.getFieldValue("iduniteGestion");// chg uniquement si pas de protocole dessus
               if (operation.equals(DataSource.OP_ADD)) {
                  UpdateObject updateObject = echangeDAO2.addProdFrn(id, libelleProd, idCategorie, idUniteGestion);
                  if (updateObject.retour == 1)
                     dsResponse.addError("libelle", "Ce libellé de produit est déjà utilisé");
                  else
                     dsResponse.setData(updateObject.object);
               } else { // update
                  Long oldIdUniteGestion = (Long) dsRequest.getOldValues().get("iduniteGestion");
                  if (oldIdUniteGestion.equals(idUniteGestion))
                     idUniteGestion = null;  // généralement déjà le cas...
                  UpdateObject updateObject = echangeDAO2.setProdFrn(id, libelleProd, idCategorie, idUniteGestion);
                  if (updateObject.retour == 1)
                     dsResponse.addError("iduniteGestion", "Modification interdite car ce produit est utilisé dans un protocole d'accord");
                  else if (updateObject.retour == 2)
                     dsResponse.addError("libelle", "Ce libellé de produit est déjà utilisé");
                  else
                     dsResponse.setData(updateObject.object);
               }
            } else if (operation.equals(DataSource.OP_REMOVE)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               UpdateObject updateObject = echangeDAO2.deleteProdFrn(id);
               if (updateObject.retour == 1) {
                  dsResponse.setStatus(DSResponse.STATUS_FAILURE);
                  dsResponse.setData("Ce produit est utilisé dans un protocole d'accord");
               } else
                  dsResponse.setData(updateObject.object);
            } else
               throw new Exception("operation non geree");
            rpc.send(dsRequest, dsResponse);
         }
      ListCategorieProdFrnDS

      Code:
         private void traiteListCategorieProdFrnDS(String operation, DSRequest dsRequest, RPCManager rpc, DSResponse dsResponse) throws Exception {
            if (operation.equals(DataSource.OP_FETCH)) {
               List list = echangeDAO2.getCategorieProdFrn();
               dsResponse.setData(list);
               // je renvoi tout inconditionnellement
               dsResponse.setStartRow(0);
               dsResponse.setEndRow(list.size() - 1);
               dsResponse.setTotalRows(list.size());
            } else if (operation.equals(DataSource.OP_UPDATE) || operation.equals(DataSource.OP_ADD)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               String libelle = (String) dsRequest.getFieldValue("libelle");
               UpdateObject updateObject;
               if (operation.equals(DataSource.OP_ADD))
                  updateObject = echangeDAO2.addCategorieProdFrn(libelle);
               else // update
                  updateObject = echangeDAO2.setCategorieProdFrn(id, libelle);
               if (updateObject.retour == 1)
                  dsResponse.addError("libelle", "Ce libellé existe déjà");
               else
                  dsResponse.setData(updateObject.object);
            } else if (operation.equals(DataSource.OP_REMOVE)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               UpdateObject updateObject = echangeDAO2.deleteCategorieProdFrn(id);
               if (updateObject.retour == 1) {
                  dsResponse.setStatus(DSResponse.STATUS_FAILURE);
                  dsResponse.setData("Cette catégorie de produit est utilisée par un produit");
               } else
                  dsResponse.setData(updateObject.object);
            } else
               throw new Exception("operation non geree");
            rpc.send(dsRequest, dsResponse);
         }
      ListUniteGestionDS

      Code:
         private void traiteListUniteGestionDS(String operation, DSRequest dsRequest, RPCManager rpc, DSResponse dsResponse) throws Exception {
            if (operation.equals(DataSource.OP_FETCH)) {
               List list = echangeDAO2.getTypeUniteGestion();
               dsResponse.setData(list);
               // je renvoi tout inconditionnellement
               dsResponse.setStartRow(0);
               dsResponse.setEndRow(list.size() - 1);
               dsResponse.setTotalRows(list.size());
            } else if (operation.equals(DataSource.OP_UPDATE) || operation.equals(DataSource.OP_ADD)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               String libelle_FR = (String) dsRequest.getFieldValue("libelle_FR");
               String libelle_IT = (String) dsRequest.getFieldValue("libelle_IT");
               String libelle_DE = (String) dsRequest.getFieldValue("libelle_DE");
               String libelle_ES = (String) dsRequest.getFieldValue("libelle_ES");
               String libelle_EN = (String) dsRequest.getFieldValue("libelle_EN");
               UpdateObject updateObject;
               if (operation.equals(DataSource.OP_ADD))
                  updateObject = echangeDAO2.addUniteGestion(libelle_FR, libelle_IT, libelle_DE, libelle_ES, libelle_EN);
               else // update
                  updateObject = echangeDAO2.setUniteGestion(id, libelle_FR, libelle_IT, libelle_DE, libelle_ES, libelle_EN);
               if (updateObject.retour == 1)
                  dsResponse.addError("libelle_FR", "Le libellé Français doit être unique");
               else
                  dsResponse.setData(updateObject.object);
            } else if (operation.equals(DataSource.OP_REMOVE)) {
               Long id = (Long) dsRequest.getFieldValue("id");
               if (id <= 2) {
                  dsResponse.setStatus(DSResponse.STATUS_FAILURE);
                  String[] tabStr = {"", "Sans", "Unité"};
                  dsResponse.setData("Cette unité de gestion fait partie des 2 unités obligatoire (Sans, Unité). Ici : "+tabStr[id.intValue()]);
               }
               else {
                  UpdateObject updateObject = echangeDAO2.deleteUniteGestion(id);
                  if (updateObject.retour == 1) {
                     dsResponse.setStatus(DSResponse.STATUS_FAILURE);
                     dsResponse.setData("Cette unité de gestion est utilisée par un produit");
                  } else
                     dsResponse.setData(updateObject.object);
               }
            } else
               throw new Exception("operation non geree");
            rpc.send(dsRequest, dsResponse);
         }

      Comment


        #4
        Try simplifying that down. Note that the cause could also be a filter servlet that is doing processing before the code you've shown is ever reached.

        You've also obviously implemented a bunch of code which must have been working at some point, so look for what you changed.

        Comment


          #5
          but what can cause this message

          === 2009-12-11 14:54:02,703 [80-1] WARN RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()

          i insist on the fact that issue occurs only if concescutives
          request which requires some time.
          On my post IN LOCAL MODE EVERYTHING WORKS WELL.
          But on the server which is more solicited i have this message.
          So, i reproduce this problem on my post in local mode by temporizing access to database.

          So what does this mean? "Response has already been committed"
          and this ? "unable to setNoCacheHeaders()"

          Comment


            #6
            It means that the servlet response has already had headers written out. See this core Java API servletResponse.isCommitted().

            So again, this is some kind of misuse of servlets on your part, eg, trying to write out a servlet response when the RPCManager is supposed to be allowed to write the entire response. Or a filter servlet is misbehaving. Or, something causing your code to run twice and create two RPCManagers - something of the kind.

            There's absolutely zero chance that SmartClient cuts off responses that take longer than 200ms, so inspect your application code closely to find the problem.

            Comment


              #7
              So,

              there was this line in this early call to the servlet:
              response.setContentType ( "text / html; charset = ISO-8859-1");
              response.setHeader ( "Cache-Control", "no-cache");
              also, I removed these lines and the warning no longer appears automatically.

              BUT the real problem persist.

              I found that whenever the client sends 2 successive requests (for 2 different components) and the both responses arrives after the second requests:
              So the second component does not receive and does not display data.

              Herei is the log of this sequence:

              First, the ListGrid request (containing the 2 selectList with their own datasource).
              All is good for this.

              Code:
              === 2009-12-12 19:19:36,250 [80-4] INFO  RequestContext - URL: '/echangeRC/smartAjax1', User-Agent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3) Ge
              cko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)': Moz (Gecko) with Accept-Encoding header
              === 2009-12-12 19:19:36,250 [80-4] DEBUG XML - Parsed XML from (in memory stream): 0ms
              === 2009-12-12 19:19:36,250 [80-4] DEBUG RPCManager - Processing 3 requests.
              === 2009-12-12 19:19:36,250 [80-4] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                  criteria:{},
                  operationConfig:{dataSource:"ListProdFrnDS", operationType:"fetch", textMatchStyle:"substring"},
                  startRow:0,
                  endRow:1000,
                  componentId:"GestProdFrnList",
                  appID:"builtinApplication",
                  operation:"ListProdFrnDS_fetch",
                  oldValues:{}
              }
              === 2009-12-12 19:19:36,250 [80-4] DEBUG RPCManager - Request #2 (DSRequest) payload: {
                  criteria:{},
                  operationConfig:{dataSource:"ListCategorieProdFrnDS", operationType:"fetch"},
                  outputs:["libelle", "id"],
                  appID:"builtinApplication",
                  operation:"ListCategorieProdFrnDS_fetch",
                  oldValues:{}
              }
              === 2009-12-12 19:19:36,250 [80-4] DEBUG RPCManager - Request #3 (DSRequest) payload: {
                  criteria:{},
                  operationConfig:{dataSource:"ListUniteGestionDS", operationType:"fetch"},
                  outputs:["libelle_FR", "id"],
                  appID:"builtinApplication",
                  operation:"ListUniteGestionDS_fetch",
                  oldValues:{}
              }
              Hibernate: select count(*) as col_0_0_ from prod_frn produitfou0_
              Hibernate: select produitfou0_.id as id124_0_, categoriep1_.id as id125_1_, typeuniteg2_.id as id122_2_, produitfou0_.libelle as libelle124_0_, produitfou0_.id_
              typeUnitegest as id3_124_0_, produitfou0_.id_categorie as id4_124_0_, categoriep1_.libelle as libelle125_1_, typeuniteg2_.libelle_FR as libelle2_122_2_, typeuni
              teg2_.libelle_IT as libelle3_122_2_, typeuniteg2_.libelle_DE as libelle4_122_2_, typeuniteg2_.libelle_ES as libelle5_122_2_, typeuniteg2_.libelle_EN as libelle6
              _122_2_ from prod_frn produitfou0_ inner join prod_frn_categorie categoriep1_ on produitfou0_.id_categorie=categoriep1_.id inner join typesunitegestion typeunit
              eg2_ on produitfou0_.id_typeUnitegest=typeuniteg2_.id order by categoriep1_.libelle, produitfou0_.libelle limit ?
              === 2009-12-12 19:19:41,546 [80-4] INFO  DSResponse - DSResponse: List with 22 items
              Now, i click anywhere in the grid (in editRow mode) and here is the second sequence :

              Requests for content selectList depart successively and the server returns all data nearly simultaneously after 7 seconds.
              So the second component does not see the data arrive and remains EMPTY !!!

              Code:
              Hibernate: select categoriep0_.id as id125_, categoriep0_.libelle as libelle125_ from prod_frn_categorie categoriep0_ order by categoriep0_.libelle
              === 2009-12-12 19:19:47,718 [80-4] INFO  DSResponse - DSResponse: List with 5 items
              Hibernate: select typeuniteg0_.id as id122_, typeuniteg0_.libelle_FR as libelle2_122_, typeuniteg0_.libelle_IT as libelle3_122_, typeuniteg0_.libelle_DE as libe
              lle4_122_, typeuniteg0_.libelle_ES as libelle5_122_, typeuniteg0_.libelle_EN as libelle6_122_ from typesunitegestion typeuniteg0_ order by typeuniteg0_.libelle_
              FR
              === 2009-12-12 19:19:52,703 [80-4] INFO  DSResponse - DSResponse: List with 6 items
              === 2009-12-12 19:19:52,703 [80-4] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
              === 2009-12-12 19:19:52,703 [80-4] DEBUG RPCManager - non-DMI response, dropExtraFields: true
              === 2009-12-12 19:19:52,703 [80-4] DEBUG RPCManager - non-DMI response, dropExtraFields: true
              === 2009-12-12 19:19:59,000 [80-1] INFO  RequestContext - URL: '/echangeRC/smartAjax1', User-Agent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3) Ge
              cko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)': Moz (Gecko) with Accept-Encoding header
              === 2009-12-12 19:19:59,000 [80-1] DEBUG XML - Parsed XML from (in memory stream): 0ms
              === 2009-12-12 19:19:59,000 [80-1] DEBUG RPCManager - Processing 1 requests.
              === 2009-12-12 19:19:59,000 [80-1] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                  criteria:{},
                  operationConfig:{dataSource:"ListCategorieProdFrnDS", operationType:"fetch", textMatchStyle:"startsWith"},
                  startRow:0,
                  endRow:75,
                  componentId:"isc_PickListMenu_140",
                  appID:"builtinApplication",
                  operation:"ListCategorieProdFrnDS_fetch",
                  oldValues:{}
              }
              Hibernate: select categoriep0_.id as id125_, categoriep0_.libelle as libelle125_ from prod_frn_categorie categoriep0_ order by categoriep0_.libelle
              === 2009-12-12 19:19:59,031 [80-3] INFO  RequestContext - URL: '/echangeRC/smartAjax1', User-Agent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3) Ge
              cko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)': Moz (Gecko) with Accept-Encoding header
              === 2009-12-12 19:19:59,031 [80-3] DEBUG XML - Parsed XML from (in memory stream): 0ms
              === 2009-12-12 19:19:59,031 [80-3] DEBUG RPCManager - Processing 1 requests.
              === 2009-12-12 19:19:59,031 [80-3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                  criteria:{},
                  operationConfig:{dataSource:"ListUniteGestionDS", operationType:"fetch", textMatchStyle:"startsWith"},
                  startRow:0,
                  endRow:75,
                  componentId:"isc_PickListMenu_142",
                  appID:"builtinApplication",
                  operation:"ListUniteGestionDS_fetch",
                  oldValues:{}
              }
              Hibernate: select typeuniteg0_.id as id122_, typeuniteg0_.libelle_FR as libelle2_122_, typeuniteg0_.libelle_IT as libelle3_122_, typeuniteg0_.libelle_DE as libe
              lle4_122_, typeuniteg0_.libelle_ES as libelle5_122_, typeuniteg0_.libelle_EN as libelle6_122_ from typesunitegestion typeuniteg0_ order by typeuniteg0_.libelle_
              FR
              === 2009-12-12 19:20:06,546 [80-3] INFO  DSResponse - DSResponse: List with 6 items
              === 2009-12-12 19:20:06,546 [80-1] INFO  DSResponse - DSResponse: List with 5 items
              === 2009-12-12 19:20:06,546 [80-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
              === 2009-12-12 19:20:06,546 [80-1] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
              === 2009-12-12 19:20:06,546 [80-3] DEBUG RPCManager - non-DMI response, dropExtraFields: true

              Comment


                #8
                Is this related to your previous posts? Before it was something about long requests, now simultaneous requests?

                You show server-side logs for two successful requests - so the question is what happens on the client - what is received, is there an error or warning, does that data match up to the settings on the component?

                Comment


                  #9
                  My problem is the same since the beginning. Only its interpretation evolves. It occurs when 2 requests are pending simultaneously. The problem is visible in Firebug, because the second component does not receive its data.

                  FireBug
                  Code:
                  POST http://localhost:8080/echangeRC/smartAjax1?isc_rpc=1&isc_v=7.0rc2&isc_xhr=1&isc_tnum=1     200 OK	456ms	ISC_Core...7.0rc2.js (ligne 1082)
                  Response
                  //isc_RPCResponseStart-->[
                      {
                          invalidateCache:false,
                          endRow:4,
                          data:[
                              {
                                  id:4,
                                  libelle:"Boulonerie"
                              },
                              {
                                  id:1,
                                  libelle:"Hydrocarbure"
                              },
                              {
                                  id:2,
                                  libelle:"Service MO"
                              },
                              {
                                  id:3,
                                  libelle:"Telecom"
                              },
                              {
                                  id:5,
                                  libelle:"vélos"
                              }
                          ],
                          status:0,
                          totalRows:5,
                          startRow:0,
                          isDSResponse:true
                      }
                  ]//isc_RPCResponseEnd
                  
                  POST http://localhost:8080/echangeRC/smartAjax1?isc_rpc=1&isc_v=7.0rc2&isc_xhr=1&isc_tnum=2         200 OK     	434ms	ISC_Core...7.0rc2.js (ligne 1082)
                  Response
                  no items found
                  Server LOG

                  Code:
                  === 2009-12-12 22:42:07,203 [80-2] INFO  RequestContext - URL: '/echangeRC/smartAjax1', User-Agent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3) Ge
                  cko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)': Moz (Gecko) with Accept-Encoding header
                  === 2009-12-12 22:42:07,203 [80-2] DEBUG XML - Parsed XML from (in memory stream): 0ms
                  === 2009-12-12 22:42:07,203 [80-2] DEBUG RPCManager - Processing 1 requests.
                  === 2009-12-12 22:42:07,203 [80-2] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                      criteria:{},
                      operationConfig:{dataSource:"ListCategorieProdFrnDS", operationType:"fetch", textMatchStyle:"startsWith"},
                      startRow:0,
                      endRow:75,
                      componentId:"isc_PickListMenu_140",
                      appID:"builtinApplication",
                      operation:"ListCategorieProdFrnDS_fetch",
                      oldValues:{}
                  }
                  Hibernate: select categoriep0_.id as id125_, categoriep0_.libelle as libelle125_ from prod_frn_categorie categoriep0_ order by categoriep0_.libelle
                  === 2009-12-12 22:42:07,234 [80-3] INFO  RequestContext - URL: '/echangeRC/smartAjax1', User-Agent: 'Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.1.3) Ge
                  cko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729)': Moz (Gecko) with Accept-Encoding header
                  === 2009-12-12 22:42:07,234 [80-3] DEBUG XML - Parsed XML from (in memory stream): 0ms
                  === 2009-12-12 22:42:07,234 [80-3] DEBUG RPCManager - Processing 1 requests.
                  === 2009-12-12 22:42:07,234 [80-3] DEBUG RPCManager - Request #1 (DSRequest) payload: {
                      criteria:{},
                      operationConfig:{dataSource:"ListUniteGestionDS", operationType:"fetch", textMatchStyle:"startsWith"},
                      startRow:0,
                      endRow:75,
                      componentId:"isc_PickListMenu_142",
                      appID:"builtinApplication",
                      operation:"ListUniteGestionDS_fetch",
                      oldValues:{}
                  }
                  Hibernate: select typeuniteg0_.id as id122_, typeuniteg0_.libelle_FR as libelle2_122_, typeuniteg0_.libelle_IT as libelle3_122_, typeuniteg0_.libelle_DE as libe
                  lle4_122_, typeuniteg0_.libelle_ES as libelle5_122_, typeuniteg0_.libelle_EN as libelle6_122_ from typesunitegestion typeuniteg0_ order by typeuniteg0_.libelle_
                  FR
                  === 2009-12-12 22:42:07,656 [80-2] INFO  DSResponse - DSResponse: List with 5 items
                  === 2009-12-12 22:42:07,656 [80-2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
                  === 2009-12-12 22:42:07,703 [80-3] INFO  DSResponse - DSResponse: List with 6 items
                  === 2009-12-12 22:42:07,703 [80-3] WARN  RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()
                  === 2009-12-12 22:42:07,703 [80-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
                  === 2009-12-12 22:42:07,703 [80-3] DEBUG RPCManager - non-DMI response, dropExtraFields: true

                  Comment


                    #10
                    Where is "no items found" coming from? Are you saying the server is actually returning this string? If so, that's not coming from SmartClient server code, look for your own code that is doing that.

                    If that's not literally what the server is returning, check the RPC tab to see what SmartClient is actually receiving.

                    This is most likely going to turn out to be a threading issue in your code. Recall that servlets are multi-threaded by default, so look for problems like storing the httpServletRequest as an instance variable.

                    Comment


                      #11
                      "no items found" coming from Firebug console (in Firefox).

                      This means that SmartClient receive nothing.

                      My Servlet extends HttpServlet (thus multi-threaded).

                      But don't you think the problem is this message (in the server LOG) ?

                      === 2009-12-12 22:42:07,703 [80-3] WARN RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()

                      Code:
                      === 2009-12-12 22:42:07,656 [80-2] INFO  DSResponse - DSResponse: List with 5 items
                      === 2009-12-12 22:42:07,656 [80-2] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
                      === 2009-12-12 22:42:07,703 [80-3] INFO  DSResponse - DSResponse: List with 6 items
                      === 2009-12-12 22:42:07,703 [80-3] WARN  RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()
                      === 2009-12-12 22:42:07,703 [80-3] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=ISO-8859-1
                      === 2009-12-12 22:42:07,703 [80-3] DEBUG RPCManager - non-DMI response, dropExtraFields: true

                      Comment


                        #12
                        Can you re-read the previous message please - you seem to have missed most of it.

                        Comment


                          #13
                          I read your message, can you specify which part you think ?

                          do you mean this message can provide for a threading issue ?

                          === 2009-12-12 22:42:07,703 [80-3] WARN RPCManager - java.lang.Exception: Response has already been committed, unable to setNoCacheHeaders()

                          this message does not appear every time.
                          but every time it appear the client receive nothing !!!

                          Comment


                            #14
                            1. check the RPC tab in the Developer Console to see what the client actually received

                            2. audit your code for threading issues such as holding onto the httpServletRequest or response as an instance variable

                            Comment


                              #15
                              1) I could not use the developer console. But I am sure that the browser receives nothing.

                              2) ..."such as holding onto the httpServletRequest or response as an instance variable"... have you an example or a link to teach me ?

                              Comment

                              Working...
                              X