• HTTP JVM: com.ibm.xsp.exception.EvaluationExceptionEx: Error while executing JavaScript action expression

    By F. Kranenburg 1 decade ago

    We get multiple errors on the server console but the application is working fine.

    After investigating the problem, I have found the solution here http://everythinglotus.blogspot.com/2011/03/strange-xpage-error-on-console.html

     

    The bugs exist in the cc 'prtView' and 'prtViewCategories' in the beforerender response. When adding a try catch, the console will print the correct error. In our case 'doc' could not be found, so we changed the code so it checks if 'doc' is not null.

    Now the errors are gone!

    • Code

      By Michael Ulrich 1 decade ago

      Can you post your code here?

    • Using's F. Kranenburg's explanation I added the following code to the beforerenderresponse

      By Jim Romaine 1 decade ago

      From F. Kranenburg's original post I added the following to the "beforeRenderResponse" of the prtView and prtViewCategories custom controls and the issue appears to be resolved.

       

      Thanks for the solution.

       

      var lookup = context.getUrlParameter("lookupName");
      var db:NotesDatabase = database;
      var xview:NotesView=database.getView("vSysCat");
      var doc:NotesDocument=null;
      var contentType:String;

      try {
          doc:NotesDocument=xview.getDocumentByKey(lookup,true);
          if ( doc == null ) {
              requestScope.activeTab = "home";
          } else {
               contentType = doc.getItemValueString("contentType");        
              if(contentType == "prodDoc"){
                      requestScope.activeTab = "prodDoc";
                      //set the current productName and productVersion
                      var products = applicationScope.tabconfig.productDocNav;        
                      for(var i=0; i                     var productJSON = products.get(i);
                          var singleProduct = eval('('+productJSON+')');
                          //if this product's category lookup value equals the current
                          //lookup value, then set the request scope variables
                          //to this product's values
                          for(var j=0; j                         if(singleProduct.versions[j].category == lookup){
                                  requestScope.productName = singleProduct.name;
                                  requestScope.productVersion = singleProduct.versions[j].version;
                                  break;
                              }
                          }        
                      }        
                  }
                  else if(contentType == "learning"){
                      requestScope.activeTab = "learning";
                  }
                  else{
                      requestScope.activeTab = "home";
                  }
              }
      } catch (e) {
          print (e.toString());
      }