XStream
  1. XStream
  2. XSTR-770

Code bug in xStream 1.4.8 (java.lang.NoSuchFieldError: serializationMembers)

    Details

    • Type: Bug Bug
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.4.7
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None
    • JDK version and platform:
      1.7.0_71

      Description

      Same issue I raised on Git: https://github.com/maurotalevi/xstream/issues/1

      I am upgrading xStream 1.2 to xStream 1.4.8

      I get the following error on application startup:

      Caused by: java.lang.NoSuchFieldError: serializationMembers
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.(AbstractReflectionConverter.java:62)
      at com.thoughtworks.xstream.converters.reflection.ReflectionConverter.(reflection:ReflectionConverter.java):8)
      at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.(AnnotationReflectionConverter.java:49)
      ... 37 more

      It seems a code bug (in version 1.4.8). AbstractReflectionConverter class accesses serializationMembers field member of serializationMethodInvoker class, serializationMembers is moved to util package in 1.4.8 but access modifier is still default. Which could be an issue because AbstractReflectionConverter and SerializationMethodInvoker both are in the same package but SerializationMembers is in a different package, so access modifier should be changed to public or it should be accessed using getter methods.

      AbstractReflectionConverter.Java:

      Line 62: serializationMembers = serializationMethodInvoker.serializationMembers;

      SerializationMethodInvoker.Java
      Line 30: SerializationMembers serializationMembers = new SerializationMembers();

      As per documentation this class has been moved to util package. nt

      Please let me know if my understanding is correct or doing anything wrong here.

        Activity

        Hide
        Jörg Schaible added a comment -

        Actually I simply guess you have still an old version of XSteam on the classpath. How would we ever had a chance to compile this and run all unit tests? BTW, nothing has been moved regarding the API, the old classes have just been deprecated and call now the stuff at the new location.

        Show
        Jörg Schaible added a comment - Actually I simply guess you have still an old version of XSteam on the classpath. How would we ever had a chance to compile this and run all unit tests? BTW, nothing has been moved regarding the API, the old classes have just been deprecated and call now the stuff at the new location.
        Hide
        Vishal Vishnoi added a comment -

        Thanks for your help. You are right i had an old version in the classpath.
        -verbose:class command line option helped to find out which class is loaded from where.
        Sorry for the confusion.

        Show
        Vishal Vishnoi added a comment - Thanks for your help. You are right i had an old version in the classpath. -verbose:class command line option helped to find out which class is loaded from where. Sorry for the confusion.
        Vishal Vishnoi made changes -
        Field Original Value New Value
        Resolution Not A Bug [ 6 ]
        Status Open [ 1 ] Resolved [ 5 ]

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Vishal Vishnoi
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: