Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-493

When using BeanUtil at the RPCMessageReceiver(i.e.), axis2 gets NullPointerException using java styled propert names such as contextType(setContextType/getContextType)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 0.94
    • 0.95
    • databinding
    • None
    • WinXP SP2 on Intel P-IV 1GB RAM, Jboss4.0.3SP1 + Tomcat 5.5, J2DK1.4.2_10, axis0.94

    Description

      When you try to make a RPC call, at the class org.apache.axis2.databinding.utils.BeanUtil,
      when deserializing the message context at the method

      public static Object deserialize(Class beanClass, OMElement beanElement) throws AxisFault
      (...)

      It populates the properties HashMap with
      properties.put(proprty.getName(), proprty); // at line 123

      but, few lines below, it gets the localname from the message part and tries to find a property (from the properties hash) with that localname.
      PropertyDescriptor prty = (PropertyDescriptor) properties.get(partsLocalName.toLowerCase()); //at line 134

      The problem is that it performs a toLowerCase() onto the localname (string) passing it as the key to the hash but at line 123 it uses the "as is" property name (from the property descriptor).

      So, if i.e. you use contextType (setContextType/getContextType) as the property name, it will never find it. You have to use contexttype (setContexttype/getContexttype) as the property name (not java style).

      Well, i hope this will help you guys.

      Keep up the excellent work!!!

      See ya.
      Fabio

      Attachments

        1. Mail.java
          1 kB
          Fabio Costa
        2. src.zip
          5 kB
          Fabio Costa

        Activity

          People

            Unassigned Unassigned
            fabiowillow Fabio Costa
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: