You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by samsam007 <le...@gmail.com> on 2012/08/04 15:07:56 UTC
java.lang.IllegalArgumentException: argument type mismatch
Hi, with a multi tiers project, I am using spring mvc 3.1, CXF 2.
When I submit data via a submit-form, I meet the following exception:
[code]
22:43:29,916 FINE [org.apache.cxf.phase.PhaseInterceptorChain]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) Invoking handleMessage on
interceptor org.apache.cxf.ws.policy.PolicyOutInterceptor@24250536
22:43:29,917 FINE [org.apache.cxf.phase.PhaseInterceptorChain]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) Invoking handleMessage on
interceptor org.apache.cxf.jaxws.interceptors.HolderOutInterceptor@1d867c00
22:43:29,917 FINE [org.apache.cxf.jaxws.interceptors.HolderOutInterceptor]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) op: [OperationInfo:
{http://service.vendor.houseware/}create]
22:43:29,917 FINE [org.apache.cxf.jaxws.interceptors.HolderOutInterceptor]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) op.hasOutput(): true
22:43:29,917 FINE [org.apache.cxf.jaxws.interceptors.HolderOutInterceptor]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) op.getOutput().size(): 1
22:43:29,918 FINE [org.apache.cxf.phase.PhaseInterceptorChain]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) Invoking handleMessage on
interceptor org.apache.cxf.jaxws.interceptors.SwAOutInterceptor@5b7fe066
22:43:29,918 FINE [org.apache.cxf.phase.PhaseInterceptorChain]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) Invoking handleMessage on
interceptor
org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor@28657778
*22:43:29,920 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3)
*java.lang.IllegalArgumentException: argument type mismatch*
22:43:29,920 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at*
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:43:29,921 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
22:43:29,921 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
22:43:29,921 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
java.lang.reflect.Method.invoke(Method.java:597)
22:43:29,921 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.databinding.AbstractWrapperHelper.createWrapperObject(AbstractWrapperHelper.java:99)
22:43:29,921 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.jaxws.interceptors.WrapperClassOutInterceptor.handleMessage(WrapperClassOutInterceptor.java:105)
22:43:29,922 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
22:43:29,922 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:531)
22:43:29,922 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:461)
22:43:29,922 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:364)
22:43:29,923 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:317)
22:43:29,923 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:88)
22:43:29,923 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:134)
22:43:29,923 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
*$Proxy109.create(Unknown Source)
22:43:29,924 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
ix.vendor.AddressManagerBean.create(AddressManagerBean.java:185)*
22:43:29,924 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22:43:29,924 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
22:43:29,924 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
22:43:29,924 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
java.lang.reflect.Method.invoke(Method.java:597)
22:43:29,925 ERROR [stderr]
(http-portal.ixsystems.com.au-192.168.1.20-8080-3) at
org.jboss.as.ee.component.ManagedReferenceMethodInterceptorFactory$ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptorFactory.java:72)
[/code]
Is there any way I can track down the error?
Any suggestion is well appreciated.
Thanks
Sam
--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-IllegalArgumentException-argument-type-mismatch-tp5712055.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: java.lang.IllegalArgumentException: argument type mismatch
Posted by samsam007 <le...@gmail.com>.
here is Netbeans generated service code for the "create" method:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlType;
/**
* <p>Java class for create complex type.
*
* <p>The following schema fragment specifies the expected content contained
within this class.
*
* <pre>
* <complexType name="create">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="arg0"
type="{http://www.w3.org/2001/XMLSchema}int"/>
* <element name="arg1"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="arg2"
type="{http://www.w3.org/2001/XMLSchema}base64Binary" minOccurs="0"/>
* <element name="arg3"
type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* </sequence>
* </restriction>
* </complexContent>
* </complexType>
* </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "create", propOrder = {
"arg0",
"arg1",
"arg2",
"arg3"
})
public class Create {
protected int arg0;
protected String arg1;
protected byte[] arg2;
protected String arg3;
/**
* Gets the value of the arg0 property.
*
*/
public int getArg0() {
return arg0;
}
/**
* Sets the value of the arg0 property.
*
*/
public void setArg0(int value) {
this.arg0 = value;
}
/**
* Gets the value of the arg1 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getArg1() {
return arg1;
}
/**
* Sets the value of the arg1 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArg1(String value) {
this.arg1 = value;
}
/**
* Gets the value of the arg2 property.
*
* @return
* possible object is
* byte[]
*/
public byte[] getArg2() {
return arg2;
}
/**
* Sets the value of the arg2 property.
*
* @param value
* allowed object is
* byte[]
*/
public void setArg2(byte[] value) {
this.arg2 = value;
}
/**
* Gets the value of the arg3 property.
*
* @return
* possible object is
* {@link String }
*
*/
public String getArg3() {
return arg3;
}
/**
* Sets the value of the arg3 property.
*
* @param value
* allowed object is
* {@link String }
*
*/
public void setArg3(String value) {
this.arg3 = value;
}
}
--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-IllegalArgumentException-argument-type-mismatch-tp5712055p5712057.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: java.lang.IllegalArgumentException: argument type mismatch
Posted by samsam007 <le...@gmail.com>.
Just a follow up,
The Netbeans generated service code is simply String types, as shown below:
WebMethod
@WebResult(targetNamespace = "")
@RequestWrapper(localName = "create", targetNamespace =
"http://service.vendor.houseware/", className =
"houseware.vendor.service.Create")
@ResponseWrapper(localName = "createResponse", targetNamespace =
"http://service.vendor.houseware/", className =
"houseware.vendor.service.CreateResponse")
public int create(
@WebParam(name = "arg0", targetNamespace = "")
String arg0,
@WebParam(name = "arg1", targetNamespace = "")
String arg1,
@WebParam(name = "arg2", targetNamespace = "")
String arg2,
@WebParam(name = "arg3", targetNamespace = "")
String arg3,
@WebParam(name = "arg4", targetNamespace = "")
String arg4,
@WebParam(name = "arg5", targetNamespace = "")
String arg5,
@WebParam(name = "arg6", targetNamespace = "")
String arg6,
@WebParam(name = "arg7", targetNamespace = "")
String arg7,
@WebParam(name = "arg8", targetNamespace = "")
String arg8,
@WebParam(name = "arg9", targetNamespace = "")
String arg9);
A corresponding session bean is coded as follow:
@Override
public Integer create(String country,
String state,
String postcode,
String suburb,
String email_address,
String contact,
String fax,
String phone,
String address1,
String address2) {
Integer ret = -1;
try {
logger.debug("===AddressManagerBean before calling create...");
logger.debug("===country:"+country);
logger.debug("===state:"+state);
logger.debug("===suburb:"+suburb);
logger.debug("===email_addresss:"+email_address);
logger.debug("===contact:"+contact);
logger.debug("===fax:"+fax);
logger.debug("===phone:"+phone);
logger.debug("===address1:"+address1);
logger.debug("===address2:"+address2);
ret = callRemote().create(
country,
state,
postcode,
suburb,
email_address,
contact,
fax,
phone,
address1,
address2);
logger.debug("===AddressManagerBean create() return
result:"+ret);
} catch (Exception e) {
throw new RuntimeException(e);
}
return ret;
}
private houseware.vendor.service.AddressService callRemote() {
houseware.vendor.service.AddressService port =
service.getAddressServiceImplPort();
return port;
}
--
View this message in context: http://cxf.547215.n5.nabble.com/java-lang-IllegalArgumentException-argument-type-mismatch-tp5712055p5712056.html
Sent from the cxf-user mailing list archive at Nabble.com.