Uploaded image for project: 'Pentaho Data Integration - Kettle'
  1. Pentaho Data Integration - Kettle
  2. PDI-8830

The java script step cannot call alert() any more, the transformation dies with SWTinvalidThreadAccess Exception (fails in 4.4 M4, works in 4.3)

    Details

    • Type: Bug
    • Status: Closed
    • Severity: High
    • Resolution: Fixed
    • Affects Version/s: 4.4.0 GA (4.8.0 GA Suite Release)
    • Component/s: Step
    • Labels:
      None
    • PDI Sub-component:
    • Notice:
      When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.

      Description

      Calling Alert() in a javascript step causes an exception, and the transformation terminates.

      Minimal sample attached. This sample works in 4.3 as expected.

      The following samples we ship with PDI break because of this error:
      samples/transformations/JavaScript - Parse XML.ktr
      samples/transformations/General - Annotated SOAP Web Service call.ktr
      samples/transformations/JavaScript - process all fields per row.ktr
      samples/transformations/String date with time to Date using metadata conversion.ktr

      Stack Trace:

      2012/10/30 12:16:02 - Spoon - Logging goes to file:///var/folders/h2/ksxk_qk12y712379ckh3fpyc0000gn/T/spoon_304c6810-2283-11e2-b724-57077efae662.log
      2012/10/30 12:16:05 - class org.pentaho.agilebi.platform.JettyServer - WebServer.Log.CreateListener localhost:10001
      2012/10/30 12:16:05 - Version checker - OK
      2012/10/30 12:18:28 - Spoon - Transformation opened.
      2012/10/30 12:18:28 - Spoon - Launching transformation [test]...
      2012/10/30 12:18:28 - Spoon - Started the transformation execution.
      2012/10/30 12:18:28 - test - Dispatching started for transformation [test]
      2012/10/30 12:18:28 - Transformation metadata - Natural sort of steps executed in 1 ms (2 time previous steps calculated)
      2012/10/30 12:18:28 - Generate Rows.0 - Finished processing (I=0, O=0, R=0, W=2, U=0, E=0)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - Optimization level set to 9.
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Unexpected error
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : org.pentaho.di.core.exception.KettleValueException:
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Javascript error:
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Wrapped org.eclipse.swt.SWTException: Invalid thread access (script#3)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) :
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:458)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.processRow(ScriptValuesMod.java:689)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.trans.step.RunThread.run(RunThread.java:50)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at java.lang.Thread.run(Thread.java:680)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Caused by: org.mozilla.javascript.WrappedException: Wrapped org.eclipse.swt.SWTException: Invalid thread access (script#3)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:183)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.FunctionObject.call(FunctionObject.java:413)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.optimizer.OptRuntime.callName(OptRuntime.java:97)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.gen.script_1._c_script_0(script:3)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.gen.script_1.call(script)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3178)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.gen.script_1.call(script)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.gen.script_1.exec(script)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesMod.addValues(ScriptValuesMod.java:377)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : ... 3 more
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Caused by: org.eclipse.swt.SWTException: Invalid thread access
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.SWT.error(SWT.java:4282)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.SWT.error(SWT.java:4197)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.SWT.error(SWT.java:4168)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.widgets.Widget.error(Widget.java:774)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.widgets.Widget.checkWidget(Widget.java:569)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.widgets.Dialog.checkParent(Dialog.java:165)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.widgets.Dialog.<init>(Dialog.java:127)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.eclipse.swt.widgets.MessageBox.<init>(MessageBox.java:98)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.ui.spoon.Spoon.messageBox(Spoon.java:7892)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.pentaho.di.trans.steps.scriptvalues_mod.ScriptValuesAddedFunctions.Alert(ScriptValuesAddedFunctions.java:1325)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at java.lang.reflect.Method.invoke(Method.java:597)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
      2012/10/30 12:18:28 - Modified Java Script Value.0 - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : ... 12 more
      2012/10/30 12:18:28 - Modified Java Script Value.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)
      2012/10/30 12:18:28 - Spoon - The transformation has finished!!
      2012/10/30 12:18:28 - test - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Errors detected!
      2012/10/30 12:18:28 - test - ERROR (version 4.4.0-GA, build 17527 from 2012-10-29 20.25.00 by buildguy) : Errors detected!
      2012/10/30 12:18:28 - test - test
      2012/10/30 12:18:28 - test - test
      2012/10/30 12:19:38 - Spoon - Spoon
      2012/10/30 12:19:47 - Spoon - Save as...
      2012/10/30 12:19:47 - Spoon - Save file as...
      2012/10/30 12:19:49 - Spoon - Starting job...
      2012/10/30 12:19:51 - Spoon - Job has ended.

      1. test.ktr
        9 kB
        Slawomir Chodnicki
      1. 4.3_works.png
        71 kB
      2. 4.4.M4_breaks.png
        66 kB

        Activity

        Hide
        mcasters Matt Casters added a comment -

        For a lot of people (including me) this would be a blocker for this release.

        Show
        mcasters Matt Casters added a comment - For a lot of people (including me) this would be a blocker for this release.
        Hide
        mcasters Matt Casters added a comment -

        Fixed checked into revisions 17529, 30 & 31 for branches/4.4.0, 4.4.1 and 4.4.0-GA

        Show
        mcasters Matt Casters added a comment - Fixed checked into revisions 17529, 30 & 31 for branches/4.4.0, 4.4.1 and 4.4.0-GA
        Hide
        ceverett Carter Everett (Inactive) added a comment - - edited

        this is validated on Ubuntu 10.04 and Windows 7 with M5

        Show
        ceverett Carter Everett (Inactive) added a comment - - edited this is validated on Ubuntu 10.04 and Windows 7 with M5
        Hide
        mburgess Matt Burgess added a comment -

        I verified this with the M5 PDI installer on Windows 7 and Ubuntu 12 (both 64-bit).

        Show
        mburgess Matt Burgess added a comment - I verified this with the M5 PDI installer on Windows 7 and Ubuntu 12 (both 64-bit).

          People

          • Assignee:
            Unassigned
            Reporter:
            schodnicki Slawomir Chodnicki (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: