Google Visualization API Plugin
  1. Google Visualization API Plugin
  2. GPGOOGLEVISUALIZATIONAPI-1

MissingMethodException for StringEscapeUtils.escapeJavaScript(Integer)

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Grails-Google-Visualization-API 0.2.2
    • Labels:
      None
    • Environment:
      Grails 1.3.1, google-visualization-0.2.2 and google-visualization-0.2.3

      Description

      I get this message since upgrading from 0.2.1

      Error processing GroovyPageView: Error executing tag <gvisualization:columnCoreChart>: groovy.lang.MissingMethodException: No signature of method: static org.apache.commons.lang.StringEscapeUtils.escapeJavaScript() is applicable for argument types: (java.lang.Integer) values: [0] Possible solutions: escapeJavaScript(java.lang.String), escapeJavaScript(java.io.Writer, java.lang.String), unescapeJavaScript(java.lang.String), unescapeJavaScript(java.io.Writer, java.lang.String), decodeJavaScript() at C:/Java/Workspaces/oyoc/oyoc/grails-app/views/reports/index.gsp:87

        Activity

        Hide
        Benjamin Muschko added a comment -

        Looks to me like you are trying to a use a Integer data type where a String is expected. There are two places in the code that changed with version 0.2.2. I am escaping 'string' column data type values and org.grails.plugins.google.visualization.data.Cell labels. Unfortunately, your stack trace doesn't tell me which one it is.

        My guess is that you are defining a 'string' column data type but use an Integer data type as value in the data you pass in or you pass. The other chance could be that the second parameter value you pass into the Cell object (the label) is a Integer data type value.

        Let me know if that works for you. If it doesn't please send me an example of your data and taglib declaration.

        Show
        Benjamin Muschko added a comment - Looks to me like you are trying to a use a Integer data type where a String is expected. There are two places in the code that changed with version 0.2.2. I am escaping 'string' column data type values and org.grails.plugins.google.visualization.data.Cell labels. Unfortunately, your stack trace doesn't tell me which one it is. My guess is that you are defining a 'string' column data type but use an Integer data type as value in the data you pass in or you pass. The other chance could be that the second parameter value you pass into the Cell object (the label) is a Integer data type value. Let me know if that works for you. If it doesn't please send me an example of your data and taglib declaration.
        Hide
        Scott Warren added a comment -

        You are right I had a column defined as a "string" however the values in the array where Integers. Would it hurt to put "?.toString()" in the code before passing it to Escape?

        Show
        Scott Warren added a comment - You are right I had a column defined as a "string" however the values in the array where Integers. Would it hurt to put "?.toString()" in the code before passing it to Escape?
        Hide
        Benjamin Muschko added a comment -

        Yes, certainly. I will handle String data type values gracefully with the next version of the plugin.

        Show
        Benjamin Muschko added a comment - Yes, certainly. I will handle String data type values gracefully with the next version of the plugin.

          People

          • Assignee:
            Benjamin Muschko
            Reporter:
            Scott Warren
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: