XStream
  1. XStream
  2. XSTR-9

Cannot serialize primitive arrays

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Tuan Nguyen wrote:

      > Hi,
      >
      > Does XStream support the primitive data type array like long[] . int[] .....
      > When I try to serialize the java.util.BitSet and I have the following result
      > <entry>
      > <string>node-permission</string>
      > <exo.services.cms.model.NodePermission>
      > <bitset class="java.util.BitSet">
      > <bits class="long-array">
      > <long>3</long>
      > </bits>
      > </bitset>
      > </exo.services.cms.model.NodePermission>
      > </entry>
      >
      > But when I deserialize , I have an exception. It looks like XStream does not recomize the long[] in BitSet.
      >
      > Thank !
      >
      > Tuan Nguyen
      > www.exoplatform.org
      >
      > [junit] ------------- ---------------- ---------------
      > [junit] ------------- Standard Error -----------------
      > [junit] com.thoughtworks.xstream.alias.CannotResolveClassException: bits
      > [junit] at com.thoughtworks.xstream.alias.DefaultClassMapper.lookupType(DefaultCla
      > sMapper.java:70)
      > [junit] at com.thoughtworks.xstream.converters.collections.ArrayConverter.fromXML(
      > rrayConverter.java:32)
      > [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
      > fromXML(ObjectWithFieldsConverter.java:66)
      > [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
      > fromXML(ObjectWithFieldsConverter.java:66)
      > [junit] at com.thoughtworks.xstream.converters.collections.AbstractCollectionConve
      > ter.readItem(AbstractCollectionConverter.java:42)
      > [junit] at com.thoughtworks.xstream.converters.collections.MapConverter.fromXML(Ma
      > Converter.java:42)
      > [junit] at com.thoughtworks.xstream.converters.composite.ObjectWithFieldsConverter
      > fromXML(ObjectWithFieldsConverter.java:66)
      > [junit] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:112)
      > [junit] at com.thoughtworks.xstream.XStream.fromXML(XStream.java:104)
      > [junit] at exo.services.cms.model.impl.ObjectNodeConverterImpl.fromXml(ObjectNodeC

        People

        • Assignee:
          Unassigned
          Reporter:
          Joe Walnes
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: