Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-31

NullPointerException in some application server. ex Domino

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      ex in Domino. I get below exception if file is in class path and start with '/'
      java.lang.NullPointerException
      java.io.File.(File.java:222)
      org.zkoss.zss.ui.Spreadsheet.getBook(Spreadsheet.java:316)
      org.zkoss.zss.ui.Spreadsheet.getSelectedSheet(Spreadsheet.java:413)
      org.zkoss.zss.ui.Spreadsheet.getColumnfreeze(Spreadsheet.java:689)
      org.zkoss.zss.ui.Spreadsheet.getMaxcolumnsInJSON(Spreadsheet.java:632)
      org.zkoss.zss.ui.Spreadsheet.setMaxcolumns(Spreadsheet.java:624)

      I think the code in Spreadsheet.getBook should check
      Executions.getCurrent().getDesktop().getWebApp().getRealPath(_src) return null or not first.

        Activity

        Hide
        dennis dennis added a comment -

        a example to fix

        String p = Executions.getCurrent().getDesktop().getWebApp().getRealPath(_src);
        if(p!=null){
        File file = new File(p);
        if (file.exists())

        { url = file.toURI().toURL(); }

        }else{
        url = Executions.getCurrent().getDesktop().getWebApp().getResource(_src);
        }

        Show
        dennis dennis added a comment - a example to fix String p = Executions.getCurrent().getDesktop().getWebApp().getRealPath(_src); if(p!=null){ File file = new File(p); if (file.exists()) { url = file.toURI().toURL(); } }else{ url = Executions.getCurrent().getDesktop().getWebApp().getResource(_src); }
        Hide
        samchuang samchuang added a comment -

        fixed 2011/7/28

        Show
        samchuang samchuang added a comment - fixed 2011/7/28
        Hide
        samchuang samchuang added a comment -

        fixed 2011/7/28

        Show
        samchuang samchuang added a comment - fixed 2011/7/28

          People

          • Assignee:
            samchuang samchuang
            Reporter:
            dennis dennis
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: