PDA

View Full Version : Error thrown during xaction execution



nashrul
10-30-2008, 06:57 AM
I try to create an xaction file that query the database and send report.
I keep query parameter in a table called solution. The solution table is like this:


create table solution (
id int(11) not null primary key auto_increment,
email varchar(25),
name varchar(30),
params varchar(30)
);
So, an entry in the solution table is like this:


email: abc@yahoo.com
name: solution1
params: unit_id:1;program_kerja_id:1
My xaction file (attached below) consists of sql lookup rule and java script (this is incomplete version, after java script component, there will be sql lookup rule and email component). But, when I run the solution, the following errors are thrown:



Debug: Starting execute of finance/folder1/solution2.xaction (org.pentaho.core.solution.SolutionEngine)
Debug: Getting runtime context and data (org.pentaho.core.solution.SolutionEngine)
Debug: Loading action sequence definition file (org.pentaho.core.solution.SolutionEngine)
Debug: audit: instanceId=a245277d-a66d-11dd-b5ba-c777e51b1ce8, objectId=org.pentaho.core.runtime.RuntimeContext, messageType=action_sequence_start (org.pentaho.core.runtime.RuntimeContext)
Error: JSRULE.ERROR_0003 - Javascript rule execution failed - org.mozilla.javascript.EvaluatorException: missing ; before statement (#10) (org.pentaho.plugin.javascript.JavascriptRule)
Error: RuntimeContext.ERROR_0012 - ActionDefinition for JavascriptRule did not execute successfully (org.pentaho.core.runtime.RuntimeContext)
Error: SolutionEngine.ERROR_0007 - Action sequence execution failed (org.pentaho.core.solution.SolutionEngine)
I noticed "missing ; before statement", and I look at the code and I am sure that I already append each statement with ";",so nothing is "missing".

Any help would be appreciated..
Thanks

Specification:
Kettle 3.0.4
Windows server 2003
pentaho 1.7.0
mysql 5.0
jre 1.5.0_09

pmalves
10-30-2008, 07:19 AM
are you absolutely sure that you're refreshing the solution repository?

pstoellberger
10-30-2008, 07:46 AM
i evaluated your javascript code here: http://www.teria.com/~koseki/memo/javascript/realtime_eval.html and it says "missing ;" as well
the error is thrown at the paramTemp = (java.lang.String)param[i].split(":"); line... do you really need to cast the result?
I don't know if this works but how about param[i].toString.split(":"); ?

-paul

nashrul
10-31-2008, 04:43 AM
I change my javascript code in js component like this:


param = new Array();
paramTemp = new Array();
param_val = new java.util.ArrayList();
if(rs != null) {

//getting parameters
params = rs.getValueAt(0,1).toString();
param = params.split(";");

//splitting parameters
for(i=0 ; i < param.length ; i++) {
paramTemp = param[i].toString().split(":");

param_val.add(paramTemp[1]) ;
}
}
//inserting parameter to sql query using param_val[i] forms
val1 = param_val.get(0);
val2 = param_val.get(1);

and it works now...
Thanks