XStream
  1. XStream
  2. XSTR-447

reading constructor object back in class not found

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.2.2
    • Fix Version/s: 1.3
    • Component/s: Converters
    • Labels:
      None
    • JDK version and platform:
      1.6.0_03 Windows

      Description

      The following attached java class toXmls into the 2nd attachment. When you try to read it in again you get the exception shown below.
      This is similar to http://jira.codehaus.org/browse/XSTR-185

      It doesn't like the int array. However if i serialize an int array by itself it works fine.

      If you have any other questions let me know.
      Thanks.

      Exception in thread "AWT-EventQueue-0" com.thoughtworks.xstream.converters.ConversionException: [I
      ---- Debugging information ----
      message : [I
      cause-exception : java.lang.ClassNotFoundException
      cause-message : [I
      class : server.zone.loader.ZoneInfo
      required-type : java.lang.reflect.Constructor
      path : /server.zone.loader.ZoneInfo/rooms/server.zone.loader.RoomInfo/roomConstructor/parameter-types/class[3]
      line number : 19
      -------------------------------
      at com.thoughtworks.xstream.converters.extended.JavaMethodConverter.unmarshal(JavaMethodConverter.java:107)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      at com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.readItem(AbstractCollectionConverter.java:66)
      at com.thoughtworks.xstream.converters.collections.ArrayConverter.unmarshal(ArrayConverter.java:44)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      at com.thoughtworks.xstream.annotations.AnnotationReflectionConverter.unmarshallField(AnnotationReflectionConverter.java:66)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:188)
      at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:125)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:56)
      at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:45)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:46)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:117)
      at com.thoughtworks.xstream.core.ReferenceByXPathMarshallingStrategy.unmarshal(ReferenceByXPathMarshallingStrategy.java:29)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:846)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:833)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:789)
      at worldcreator.WorldCreator.doImport(WorldCreator.java:274)
      at worldcreator.WorldCreator.access$3(WorldCreator.java:255)
      at worldcreator.WorldCreator$5.actionPerformed(WorldCreator.java:161)
      at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
      at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
      at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
      at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
      at javax.swing.AbstractButton.doClick(AbstractButton.java:357)
      at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1216)
      at javax.swing.plaf.basic.BasicMenuItemUI$Handler.menuDragMouseReleased(BasicMenuItemUI.java:1320)
      at javax.swing.JMenuItem.fireMenuDragMouseReleased(JMenuItem.java:568)
      at javax.swing.JMenuItem.processMenuDragMouseEvent(JMenuItem.java:465)
      at javax.swing.JMenuItem.processMouseEvent(JMenuItem.java:411)
      at javax.swing.MenuSelectionManager.processMouseEvent(MenuSelectionManager.java:304)
      at javax.swing.plaf.basic.BasicPopupMenuUI$MouseGrabber.eventDispatched(BasicPopupMenuUI.java:807)
      at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2360)
      at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2252)
      at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2210)
      at java.awt.Component.dispatchEventImpl(Component.java:4308)
      at java.awt.Container.dispatchEventImpl(Container.java:2116)
      at java.awt.Component.dispatchEvent(Component.java:4240)
      at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
      at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
      at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
      at java.awt.Container.dispatchEventImpl(Container.java:2102)
      at java.awt.Window.dispatchEventImpl(Window.java:2429)
      at java.awt.Component.dispatchEvent(Component.java:4240)
      at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
      at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
      at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
      at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
      at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
      at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
      Caused by: java.lang.ClassNotFoundException: [I
      at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
      at com.thoughtworks.xstream.core.util.CompositeClassLoader.loadClass(CompositeClassLoader.java:68)
      at com.thoughtworks.xstream.core.util.ClassLoaderReference.loadClass(ClassLoaderReference.java:20)
      at com.thoughtworks.xstream.converters.extended.JavaMethodConverter.loadClass(JavaMethodConverter.java:118)
      at com.thoughtworks.xstream.converters.extended.JavaMethodConverter.unmarshal(JavaMethodConverter.java:95)
      ... 59 more

      1. export.xml
        0.9 kB
        Tom d
      2. RoomInfo.java
        0.8 kB
        Tom d

        People

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

          Dates

          • Created:
            Updated:
            Resolved: