XStream
  1. XStream
  2. XSTR-644

serializing Collections.synchronizedList and co fails with exception

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Not A Bug
    • Affects Version/s: 1.3.1
    • Fix Version/s: None
    • Component/s: Annotations
    • Labels:
      None
    • JDK version and platform:
      jdk 1.6_22 on Windows XP Spring 3.0.5.RELEASE

      Description

      I am beginner to webservice. I was trying to write Restful webservice and i followed http://www.stupidjavatricks.com/?p=54. This example works for me. But when i tried to implement the same on my code base it failed with below exception:

      org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.oxm.MarshallingFailureException: XStream marshalling exception; nested exception is com.thoughtworks.xstream.converters.ConversionException: Could not call java.util.concurrent.ConcurrentHashMap.writeObject() : Could not call java.util.Collections$SynchronizedList.writeObject() : Cannot reference implicit element ---- Debugging information ---- implicit-element : [EasyMock for class com.pyramid.qls.computeinvoker.Task] referencing-element : /batchProgressMetrics/batchProgressUpdater/context/servletContext/context/attributes/java.util.concurrent.ConcurrentHashMap/org.springframework.web.context.support.XmlWebApplicationContext/servletConfig/config/parent/lifecycle/listeners/org.apache.catalina.core.StandardHost_-MemoryLeakTrackingListener/outer-class/listeners/org.apache.catalina.connector.MapperListener/connector/service/connectors/org.apache.catalina.connector.Connector[2]/container/thread/group/threads/java.lang.Thread/threadLocals/table/java.lang.ThreadLocal_-ThreadLocalMap_-Entry[11]/value/org.easymock.classextension.internal.ClassProxyFactory_-1/val_-handler/delegate/control/state/behavior/behaviorLists/org.easymock.internal.UnorderedBehavior/results/org.easymock.internal.ExpectedInvocationAndResults[4]/results/results/org.easymock.internal.Result/value/val_-value/java.util.Collections_-SynchronizedCollection/default/mutex ------------------------------- message : Could not call java.util.Collections$SynchronizedList.writeObject() cause-exception : com.thoughtworks.xstream.core.AbstractReferenceMarshaller$ReferencedImplicitElementException cause-message : Cannot reference implicit element ------------------------------- message : Could not call java.util.concurrent.ConcurrentHashMap.writeObject() cause-exception : com.thoughtworks.xstream.converters.ConversionException cause-message : Could not call java.util.Collections$SynchronizedList.writeObject() : Cannot reference implicit element ---- Debugging information ---- implicit-element : [EasyMock for class com.pyramid.qls.computeinvoker.Task] referencing-element : /batchProgressMetrics/batchProgressUpdater/context/servletContext/context/attributes/java.util.concurrent.ConcurrentHashMap/org.springframework.web.context.support.XmlWebApplicationContext/servletConfig/config/parent/lifecycle/listeners/org.apache.catalina.core.StandardHost_-MemoryLeakTrackingListener/outer-class/listeners/org.apache.catalina.connector.MapperListener/connector/service/connectors/org.apache.catalina.connector.Connector[2]/container/thread/group/threads/java.lang.Thread/threadLocals/table/java.lang.ThreadLocal_-ThreadLocalMap_-Entry[11]/value/org.easymock.classextension.internal.ClassProxyFactory_-1/val_-handler/delegate/control/state/behavior/behaviorLists/org.easymock.internal.UnorderedBehavior/results/org.easymock.internal.ExpectedInvocationAndResults[4]/results/results/org.easymock.internal.Result/value/val_-value/java.util.Collections_-SynchronizedCollection/default/mutex ------------------------------- org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:659) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552) javax.servlet.http.HttpServlet.service(HttpServlet.java:617) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) I am using latest spring 3.0.5.RELEASE jars on windows. In addition to it i am using xstream-1.3.1 and xpp4-1.1.4.

      Can you please help me. Also if this is the limitation of Spring then can you please guide me through some of the examples where i can find restful webservice in action. I have seen examples using jaxb but there the issue was it doesn't support interface. Following is exception from my servlet xml

      This is what i have in controller
      @RequestMapping(value = "/clientMetrics/

      {clientId}

      ", method = RequestMethod.GET)
      public ModelAndView getBatchProgressMetrics(@PathVariable String clientId)

      { List batchProgressMetricsList = null; batchProgressMetricsList = batchProgressReporter.getBatchProgressMetricsForClient(clientId); ModelAndView mav = new ModelAndView("QPRXmlView", BindingResult.MODEL_KEY_PREFIX + "batchProgressMetrics", batchProgressMetricsList.get(0)); return mav; }

      And on BatchProgressMetrics (is an interface) object i do have annotation: @XStreamAlias("batchProgressMetrics")
      public class BatchProgressMetricsImpl implements BatchProgressMetrics

        People

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

          Dates

          • Created:
            Updated:
            Resolved: