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

NullPointerException while handling date in SimpleTypeMapper.java

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.5.1
    • Fix Version/s: 1.6.0
    • Component/s: databinding
    • Labels:
    • Environment:
      WIndows/Solaris

      Description

      NPE in SimpleTypeMapper.java while handling date attribute of Java bean.
      I convert a Javabean into an OMElement using BeanUtil.getPullParser() which internally uses the SimpleTypeMapper.getStringValue(). Below is the exception stack trace:

      java.lang.NullPointerException
      at org.apache.axis2.databinding.typemapping.SimpleTypeMapper.getStringValue(SimpleTypeMapper.java:297)
      at org.apache.axis2.databinding.utils.BeanUtil.getPropertyQnameList(BeanUtil.java:154)
      at org.apache.axis2.databinding.utils.BeanUtil.getPullParser(BeanUtil.java:67)

      All this occurs from here of SimpleTypeMapper.java:

      MessageContext messageContext = MessageContext.getCurrentMessageContext();
      AxisService axisServce = messageContext.getAxisService();
      // if the user has given a pirticualr timezone we use it.
      if (axisServce.getParameter("TimeZone") != null)

      { zulu.setTimeZone(TimeZone.getTimeZone((String)axisServce.getParameter("TimeZone").getValue())); }

      see? If your MessageContext.getCurrentMessageContext() is null then axisService is null too.

      Can you please fix this ASAP in axis2-1.5.1?

      Thanks in advance,
      Vasant

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              vasant.vs Vasant Shirol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: