Page 1 of 1

java.lang.IllegalArgumentException: The path of an ForwardCo

Posted: Thu Dec 06, 2012 3:47 pm
by pixus
Hello Everyone,
I'm trying the ScriptActions in the documentation.
In that case I was trying the one Example to load all customer data for given email address:

Code: Select all

$Customer.loadCustDBStructure()
$Customer.resetCustParameters()
$Customer.setCustomerID(0)
#set($custId=$Customer.findByKeyColumn("username", "myUsername"))
#set($requestParameters = $ScriptHelper.newHashMap().putAll($Customer.getCustomerDataFromDb()))
But I get the following error, made by my last code row.
java.lang.IllegalArgumentException: The path of an ForwardConfig cannot be null

In fact, without the last code row, it works fine and the CustomerId obtained is the correct one.

Where I'm wrong?
Thanks you!

Re: java.lang.IllegalArgumentException: The path of an Forwa

Posted: Fri Dec 21, 2012 11:48 am
by pixus
of course, the solution.

It just needs to use a different variable name instead of "$requestParameters" in this code line

Code: Select all

#set($requestParameters = $ScriptHelper.newHashMap().putAll($Customer.getCustomerDataFromDb()))
with this, no error

Code: Select all

#set([b]$theNameYouPrefer[/b] = $ScriptHelper.newHashMap().putAll($Customer.getCustomerDataFromDb()))

Re: java.lang.IllegalArgumentException: The path of an Forwa

Posted: Thu Mar 07, 2013 9:57 am
by maschoff
$requestParameters is a predefined variable which holds all parameters of the current request. In general you should not overwrite this vaiable but use it to read or write single request parameters (see first lines of ScriptActions documentation).