You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by madppiper <pa...@mutschler.ch> on 2009/01/06 14:37:40 UTC

Odd ServiceValidationException in bsh script

Hey everyone.

I created a service of my own and tested it carefully within the webtools
component, where no errors occured (only 1 parameter is needed for input).
Unfortunately, when I try to run the very same service from within my bsh
script, it generates the following ServiceValidationException:

Message: Type check failed for field [runSolrQuery.queryResult]; expected
type is [org.apache.solr.common.SolrDocumentList]; actual type is
[org.apache.solr.common.SolrDocumentList]Type check failed for field
[runSolrQuery.queryHeader]; expected type is
[org.apache.solr.common.util.SimpleOrderedMap]; actual type is
[org.apache.solr.common.util.SimpleOrderedMap]



I thought that was very unusual, since the actual type matches the expected
type... 

Does anybody have an idea on what I am doing wrong?
The bsh script looks as the following:

[...]
String searchString = request.getParameter("SEARCH_STRING");
Map query =
dispatcher.runSync("runSolrQuery",UtilMisc.toMap("query",searchString));
[...]

And the service requires the following parameters:
[...]
		<attribute mode="IN" name="query" optional="false"
			type="String" />		
   <attribute name="queryResult"
type="org.apache.solr.common.SolrDocumentList" mode="OUT" optional="true"/>
   <attribute name="queryHighlight" type="Map" mode="OUT" optional="true"/>
   <attribute name="queryDebugMap"
type="org.apache.solr.common.SolrDocumentList" mode="OUT" optional="true"/>
   <attribute name="queryExplainMap"
type="org.apache.solr.common.SolrDocumentList" mode="OUT" optional="true"/>
   <attribute name="queryFacetQuery" type="Map" mode="OUT" optional="true"/>
  <attribute name="queryElapsedTime" type="Long" mode="OUT"
optional="true"/>
   <attribute name="queryQTime" type="Integer" mode="OUT" optional="true"/>
<attribute name="queryHeader"
type="org.apache.solr.common.util.SimpleOrderedMap" mode="OUT"
optional="true"/>
[...]
-- 
View this message in context: http://www.nabble.com/Odd-ServiceValidationException-in-bsh-script-tp21310481p21310481.html
Sent from the OFBiz - User mailing list archive at Nabble.com.


Re: Odd ServiceValidationException in bsh script

Posted by Adrian Crum <ad...@hlmksw.com>.
Try using standard Java interfaces in your service description instead 
of concrete class names.

-Adrian

madppiper wrote:
> hmm,
> 
> I tried to trace this back a little further and hoped that perhaps I only
> missed out on placing the dependent libs into the ofbiz common lib
> directory, but the error remains... 
> 
> Any thought would reaaaaally be appreciated. This entire affair doesn't make
> any sense to me. Why would the very same service run within the webtools
> component but not through the runsync command?!

Re: Odd ServiceValidationException in bsh script

Posted by madppiper <pa...@mutschler.ch>.
hmm,

I tried to trace this back a little further and hoped that perhaps I only
missed out on placing the dependent libs into the ofbiz common lib
directory, but the error remains... 

Any thought would reaaaaally be appreciated. This entire affair doesn't make
any sense to me. Why would the very same service run within the webtools
component but not through the runsync command?!
-- 
View this message in context: http://www.nabble.com/Odd-ServiceValidationException-in-bsh-script-tp21310481p21315823.html
Sent from the OFBiz - User mailing list archive at Nabble.com.