[mule-user] CXF error with String [] parameter

1 view
Skip to first unread message

imv77

unread,
Feb 8, 2011, 2:26:56 PM2/8/11
to us...@mule.codehaus.org
Hi,
I am learning to write a service using Mule 2.2.1 -CXF. I have a simple sayHello( String hello) that returns a string. This mehthod and works. If I change the method signature to sayHello(String [] hello) and invoke the service with client modified to pass the string array if fails with the below error.

I am not sure what I am doing wrong. Any help is greatly appreciated.

Exception stack is:
1. wrong number of arguments (java.lang.IllegalArgumentException)
sun.reflect.NativeMethodAccessorImpl:-2 (null)
2. Component that caused exception is: SedaService{BackOfficeService}. Message p
ayload is of type: String[] (org.mule.api.service.ServiceException)
org.mule.component.DefaultLifecycleAdapter:216 (http://www.mulesource.org/docs
/site/current2/apidocs/org/mule/api/service/ServiceException.html)
********************************************************************************

Root Exception stack trace:
java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.mule.model.resolvers.AbstractEntryPointResolver.invokeMethod(Abst
ractEntryPointResolver.java:154)
at org.mule.model.resolvers.MethodHeaderPropertyEntryPointResolver.invok
e(MethodHeaderPropertyEntryPointResolver.java:105)
at org.mule.model.resolvers.DefaultEntryPointResolverSet.invoke(DefaultE
ntryPointResolverSet.java:50)
at org.mule.component.DefaultLifecycleAdapter.invoke(DefaultLifecycleAda
pter.java:205)
at org.mule.component.AbstractJavaComponent.invokeComponentInstance(Abst
ractJavaComponent.java:83)
at org.mule.component.AbstractJavaComponent.doInvoke(AbstractJavaCompone
nt.java:74)

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


Roko Kruze

unread,
Feb 8, 2011, 4:50:49 PM2/8/11
to us...@mule.codehaus.org
Hello,

Is the array you are sending in an object array or an ArrayList? You might be running into this issue: http://www.mulesoft.org/jira/browse/MULE-5380. If so please vote it up and comment on it.

HTH,
-Roko

imv77

unread,
Feb 8, 2011, 4:55:13 PM2/8/11
to us...@mule.codehaus.org
It is just java.lang.String []. Am I allowed to pass a String [] ?
Thanks for the help.

Roko Kruze

unread,
Feb 8, 2011, 8:09:09 PM2/8/11
to us...@mule.codehaus.org
Yes, it should be possible. Try putting your String[] within an array. This is due to the fact that Mule looks at an array and expands it thinking that each entry in the array in an argument to the method call.

HTH,
-Roko

Reply all
Reply to author
Forward
0 new messages