axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 12800] New: - Zero-length strings cannot be deserialized - solution included
Date Thu, 19 Sep 2002 07:36:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12800>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12800

Zero-length strings cannot be deserialized - solution included

           Summary: Zero-length strings cannot be deserialized - solution
                    included
           Product: Axis
           Version: current (nightly)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Serialization/Deserialization
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: nbrennan@touchcorp.com


If my client gets back an 'empty' tag in a complex type, I get this stack trace:

java.lang.StringIndexOutOfBoundsException: String index out of range: 0
        at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement
(SimpleDeserializer.java:224)
        at org.apache.axis.encoding.DeserializerImpl.endElement
(DeserializerImpl.java:494)
        at org.apache.axis.encoding.DeserializationContextImpl.endElement
(DeserializationContextImpl.java:932)
        at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:164)
        at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
        at org.apache.axis.encoding.DeserializerImpl.startElement
(DeserializerImpl.java:369)
        at org.apache.axis.encoding.ser.BeanDeserializer.startElement
(BeanDeserializer.java:167)
        at org.apache.axis.encoding.DeserializationContextImpl.startElement
(DeserializationContextImpl.java:896)
        at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:158)
        at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
        at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:244)
        at org.apache.axis.message.RPCElement.getParams(RPCElement.java:268)
        at org.apache.axis.client.Call.invoke(Call.java:1862)
        at org.apache.axis.client.Call.invoke(Call.java:1768)
        at org.apache.axis.client.Call.invoke(Call.java:1306)
        at com.touchcorp.soap.ihire.IHirebindingStub.getHireFromCustomerLicence
(IHirebindingStub.java:257)
        at com.touchcorp.remote.party.MystHireService.getHireFromCustomerLicence
(MystHireService.java:141)
        at com.touchcorp.remote.party.MystHireService.main
(MystHireService.java:188)
[ERROR] Call - -Exception: <java.lang.StringIndexOutOfBoundsException: String 
index out of range: 0>
Exception in thread "main" AxisFault
 faultCode: {http://xml.apache.org/axis/}Server.userException
 faultString: java.lang.StringIndexOutOfBoundsException: String index out of 
range: 0
 faultActor: null
 faultDetail:
        stackTrace: java.lang.StringIndexOutOfBoundsException: String index out 
of range: 0
        at org.apache.axis.encoding.ser.SimpleDeserializer.onEndElement
(SimpleDeserializer.java:224)
        at org.apache.axis.encoding.DeserializerImpl.endElement
(DeserializerImpl.java:494)
        at org.apache.axis.encoding.DeserializationContextImpl.endElement
(DeserializationContextImpl.java:932)
        at org.apache.axis.message.SAX2EventRecorder.replay
(SAX2EventRecorder.java:164)
        at org.apache.axis.message.MessageElement.publishToHandler
(MessageElement.java:681)
        at org.apache.axis.encoding.DeserializerImpl.startElement
(DeserializerImpl.java:369)
...
(goes FOREVER)

All that need be done to rectify this is to perform the simplest sanity test
on line 209 of org.apache.axis.encoding.ser.SimpleDeserializer.java:

replace:
    if (isNil) {
            value = null;
            return;
        }
with:
    if (isNil || val == null || val.length() == 0) {
            value = null;
            return;
        }

Someone REALLY needs to make this code industrial-strength.  Where I work, null-
checking is mandatory.

Mime
View raw message