XStream
  1. XStream
  2. XSTR-565

Unmarshal fails for the marshalled XML

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      java version "1.5.0_11" Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_11-b03) Java HotSpot(TM) Client VM (build 1.5.0_11-b03, mixed mode)

      Description

      We're getting following error while trying to unmarshal XML which was successfully marshalled

      Code segment
      ============

      private Map deserialize2Map(String serializedStream) {
      if (serializedStream == null)

      { return null; }

      XStream xstream = new XStream();

      try

      { xstream.omitField(Class.forName("org.springframework.webflow.execution.repository.impl.FlowExecutionSnapshotGroup"), "snapshots"); }

      catch (ClassNotFoundException e)

      { e.printStackTrace(); }

      return (Map) xstream.fromXML(serializedStream);

      }

      Results in the same exception even after directing as mentioned below for the reported field to omit from the deserialization

      xstream.omitField(Class.forName("org.springframework.webflow.execution.repository.impl.FlowExecutionSnapshotGroup"), "snapshots");

      Any help would be greatly appreciated

      ========= stack trace starts from here ===============================================

      com.thoughtworks.xstream.converters.ConversionException: Cannot construct class java.lang.Class : Class com.thoughtworks.xstream.converters.reflection.ExternalizableConverter can not access a member of class org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot with modifiers "public"
      ---- Debugging information ----
      message : Cannot construct class java.lang.Class
      cause-exception : java.lang.IllegalAccessException
      cause-message : Class com.thoughtworks.xstream.converters.reflection.ExternalizableConverter can not access a member of class org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot with modifiers "public"
      class : java.util.HashMap
      required-type : org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot
      path : /map/entry[3]/org.springframework.webflow.conversation.impl.ConversationContainer/conversations/org.springframework.webflow.conversation.impl.ContainedConversation/attributes/entry[3]/org.springframework.webflow.execution.repository.impl.SimpleFlowExecutionSnapshotGroup/snapshots/entry/org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot
      line number : 76
      -------------------------------

      ========= stack trace ends here ===============================================

      =========== Input XML for the above unmarshal routine starts here =====================

      <map>
      <entry>
      <string>org.springframework.web.servlet.i18n.SessionLocaleResolver.LOCALE</string>
      <locale>en_US</locale>
      </entry>
      <entry>
      <string>org.jsecurity.web.session.WebSession_INET_ADDRESS_SESSION_KEY</string>
      <java.net.Inet4Address resolves-to="java.net.InetAddress">
      <address>2130706433</address>
      <family>2</family>
      </java.net.Inet4Address>
      </entry>
      <entry>
      <string>webflowConversationContainer</string>
      <org.springframework.webflow.conversation.impl.ConversationContainer>
      <maxConversations>5</maxConversations>
      <sessionKey>webflowConversationContainer</sessionKey>
      <conversations>
      <org.springframework.webflow.conversation.impl.ContainedConversation>
      <container reference="../../.."/>
      <id class="org.springframework.webflow.conversation.impl.SimpleConversationId">
      <id class="int">1</id>
      </id>
      <lock class="org.springframework.webflow.conversation.impl.JdkConcurrentConversationLock">
      <lock class="java.util.concurrent.locks.ReentrantLock">
      <sync class="java.util.concurrent.locks.ReentrantLock$NonfairSync" serialization="custom">
      <java.util.concurrent.locks.AbstractQueuedSynchronizer>
      <default>
      <state>0</state>
      </default>
      </java.util.concurrent.locks.AbstractQueuedSynchronizer>
      <java.util.concurrent.locks.ReentrantLock_-Sync>
      <default/>
      </java.util.concurrent.locks.ReentrantLock_-Sync>
      </sync>
      </lock>
      <timeoutSeconds>30</timeoutSeconds>
      </lock>
      <attributes>
      <entry>
      <string>scope</string>
      <org.springframework.webflow.core.collection.LocalAttributeMap serialization="custom">
      <org.springframework.webflow.core.collection.LocalAttributeMap>
      <default>
      <attributes>
      <entry>
      <string>flashScope</string>
      <org.springframework.webflow.core.collection.LocalAttributeMap serialization="custom">
      <org.springframework.webflow.core.collection.LocalAttributeMap>
      <default>
      <attributes>
      <entry>
      <string>messagesMemento</string>
      <map/>
      </entry>
      </attributes>
      </default>
      </org.springframework.webflow.core.collection.LocalAttributeMap>
      </org.springframework.webflow.core.collection.LocalAttributeMap>
      </entry>
      </attributes>
      </default>
      </org.springframework.webflow.core.collection.LocalAttributeMap>
      </org.springframework.webflow.core.collection.LocalAttributeMap>
      </entry>
      <entry>
      <string>description</string>
      <null/>
      </entry>
      <entry>
      <string>flowExecutionSnapshotGroup</string>
      <org.springframework.webflow.execution.repository.impl.SimpleFlowExecutionSnapshotGroup>
      <snapshots>
      <entry>
      <int>1</int>
      <org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot>
      <int>555</int>
      <byte-array>H4sIAAAAAAAAAKVSPWgUQRR+ez/JJTnwh2BhIWIhiLh30ZCsSjCH5vBk7wI5/EEw3uzeu9tN9nbG
      mcnNBkHL2Ah2gmBroxaCjaCIaGMpVtpYphCxsbD07XFiICqID/YxfPvNft/79j36Ankl4TiXXVsJ
      GcbdjmQ9NFyu2ga9TsSNjXE3jNEOeyKyqwQsJOiv6ZDHNUL6M0c+PHj2aW8RIBHGsuhjkyusz2xi
      RLYbxqvYdkOli4eaV861bh3IDng5AEips/+i20Slhqrf7jXmNpafbw5UNeyIOFEX5RJ2SQqlhqIK
      uHFTlDASmvubkM8lUosi9NOxbJf7LKpoLUNvTWOdiZutty8uzd/+nAXLhXH2840iZTcdtpQOWyLi
      yUSQ2K5fAZxlKiA8P/rx1es9rXdZyFRhPOKsXWW+5rIGYzqQSGajdiJOzUNaRVOgvpOenIaxfoim
      6XOB6hrcgMKgT2xjQpJoGJXYQYmSEtktUKo0i9jH0zzWmGgyti9NIQg9lDHTw2S3pPr1zIXv7/NP
      76b/SMLB35ArntKSnG+5tPFw4vCbza6VAesyjPgRV0ijAK2ChgKPrw4QDTnBV7ixQMNIvdI4X3Hp
      0FhcqldckwEQ280t9IRer5Fz6aOgqKL7L68/vnPxSWawQB7sd5gz65S96aNl51i77E+Vp4an6Rmn
      TAX/WX9MWlDUuZgS1TAZaC1OlErGGHudBZzTGvUSYiTJDwK5WD5aAwAA</byte-array>
      <boolean>true</boolean>
      </org.springframework.webflow.execution.repository.snapshot.SerializedFlowExecutionSnapshot>
      </entry>
      </snapshots>
      <snapshotIds>
      <int>1</int>
      </snapshotIds>
      <maxSnapshots>30</maxSnapshots>
      </org.springframework.webflow.execution.repository.impl.SimpleFlowExecutionSnapshotGroup>
      </entry>
      <entry>
      <string>caption</string>
      <null/>
      </entry>
      <entry>
      <string>name</string>
      <string>loginOrRegister</string>
      </entry>
      </attributes>
      </org.springframework.webflow.conversation.impl.ContainedConversation>
      </conversations>
      <conversationIdSequence>1</conversationIdSequence>
      </org.springframework.webflow.conversation.impl.ConversationContainer>
      </entry>
      <entry>
      <string>org.jsecurity.web.DefaultWebSecurityManager_PRINCIPALS_SESSION_KEY</string>
      <org.jsecurity.subject.SimplePrincipalCollection>
      <realmPrincipals class="linked-hash-map">
      <entry>
      <string>JsecDbRealm</string>
      <linked-hash-set>
      <string>admin</string>
      </linked-hash-set>
      </entry>
      </realmPrincipals>
      </org.jsecurity.subject.SimplePrincipalCollection>
      </entry>
      <entry>
      <string>next</string>
      <string>http://www.yahoo.com</string>
      </entry>
      <entry>
      <string>org.codehaus.groovy.grails.FLASH_SCOPE</string>
      <org.codehaus.groovy.grails.web.servlet.GrailsFlashScope>
      <current/>
      <next/>
      </org.codehaus.groovy.grails.web.servlet.GrailsFlashScope>
      </entry>
      <entry>
      <string>flow</string>
      <Flow>
      <id>1</id>
      <name>default</name>
      <flowController>sling</flowController>
      <flowAction>loginOrRegister</flowAction>
      <saContext>SLINGIT_PORTAL</saContext>
      <saPolicy>MAS</saPolicy>
      <notes>defaulf flow, english, us</notes>
      <emailValidationTemplate></emailValidationTemplate>
      <created class="sql-timestamp">2009-03-25 08:54:00.0</created>
      <locale>en_US</locale>
      <version>0</version>
      <wordPairs class="org.hibernate.collection.PersistentSet">
      <initialized>false</initialized>
      <owner class="Flow" reference="../.."/>
      <cachedSize>-1</cachedSize>
      <role>Flow.wordPairs</role>
      <key class="long">1</key>
      <dirty>false</dirty>
      </wordPairs>
      </Flow>
      </entry>
      </map>

      =========== Input XML for the above unmarshal routine starts here =====================

      1. stacktrace.log
        24 kB
        Kalleri Faizel Rehiman

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Kalleri Faizel Rehiman
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: