When I invoke a java service with input string parameter I obtain the error One of the parameters' class couldn't be loaded for method returnString(String) of class es.bancopopular.easy.toFast.varPosition.Sum.. Another method in this java service without input parameter run ok, but I can't invoke correctly any method with input parameters My java class is very simple:
package es.bancopopular.easy.toFast.varPosition;
public class Sum {
Integer result=0;
int resultInt=0;
public void initialize(){
this.result = 0;
this.resultInt=0;
}
public Integer getResult(){
return ++result;
}
public int getResultInt(){
return ++resultInt;
}
public int returnInt (int num){
return num;
}
public Integer returnInteger (Integer num){
return num;
}
public String returnString (String str){
return str;
}
}
The query declaration is
[query public test(str:String) : String =
invoke ('es.bancopopular.easy.toFast.varPosition.Sum',
'returnString(String)',
Sequence{str}
)
/]
And the invocation from template is
Returned text: [test('Hello world')/]
could anyone help with this code? Any help will be appreciated
Thank's in advance
Everything seems to be correct instead of passing parameter to function. Please pass the parameter with fully qualified type as follows:
[query public test(str:String) : String =
invoke ('es.bancopopular.easy.toFast.varPosition.Sum',
'returnString(java.lang.String)',
Sequence{str}
)
/]
Hope this may help you.