axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Garcia (JIRA)" <>
Subject [jira] Created: (AXIS2-1883) Integer nillable property of input parameter bean cannot be null (NumberFormatException in SimpleTypeMapper)
Date Mon, 18 Dec 2006 09:42:20 GMT
Integer nillable property of input parameter bean cannot be null (NumberFormatException in

                 Key: AXIS2-1883
             Project: Apache Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: databinding
    Affects Versions: 1.1
            Reporter: David Garcia

A property of a complex type is defined like this:

<xs:complexType name="SomeBean">
    <xs:element name="someInt" nillable="true" type="xs:int"/>

That complex type is used as the input parameter of a service´s operation and is defined
like this:

public class SomeBean {
   private Integer someInt;
   ...getters & setters...

Then, trying to set that property to "nil" is not allowed.
That is, if the input message is something like this:

    <someInt xmlns:nil="" nil:nil="true"/>

then the following exception is thrown in the server:

java.lang.NumberFormatException: For input string: ""
        at java.lang.NumberFormatException.forInputString(
        at java.lang.Integer.parseInt(
        at java.lang.Integer.<init>(
        at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getSimpleTypeObject(
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(
        at org.apache.axis2.databinding.utils.BeanUtil.processObject(
        at org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(
        at org.apache.axis2.databinding.utils.BeanUtil.deserialize(
        at org.apache.axis2.rpc.receivers.RPCUtil.processRequest(
        at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(
        at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(
        at org.apache.axis2.engine.AxisEngine.receive(
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
        at org.apache.axis2.transport.http.AxisServlet.doPost(
        at javax.servlet.http.HttpServlet.service(
        at javax.servlet.http.HttpServlet.service(

The only way to make it work is to change "someInt"´s type to "int" and pass "0" as default
value, although most time this workaround is not desirable as it breaks the operation´s semantics.

Thanks in advance.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message