title: How to retrieve object state from serialized Java objects without class file(s)
body: <p>I have a binary file that contains Java Serialized objects (which are value objects), but I do not have access to the Class that was serialized to create those objects. Without the class file, JVM does not allow me to read the objects with objectInputStreamInstance.readObject() and rightfully throws the java.lang.ClassNotFoundException. </p>
  
  <p>Is there a library that can help be extract the data in XML or other standarized format? For example, if the Person class below is serialized and stored in a file, I would like to extract data from it: </p>
  
  <p><strong>Class Definition</strong> </p>
  
  <pre><code>class Person implements Serializable {
    int age;
    String name;
    public Person(int age, int name) {
      this.age = age;
      this.name = name;
    }
  }
  </code></pre>
  
  <p><strong>Required Extraction Format (without access to the class file)</strong></p>
  
  <pre><code>&lt;Person&gt;
    &lt;age&gt;10&lt;/age&gt;
    &lt;name&gt;Name&lt;/name&gt;
  &lt;/Person&gt;
  </code></pre>
  
  <p>I have also checked the following but did not get what I was looking for:</p>
  
  <ol>
  <li>Xstream (<a href="http://x-stream.github.io/" rel="nofollow">http://x-stream.github.io/</a>) needs access to the a Java object in order to create XML from that object. However, I am unable create objects for want of class file.</li>
  <li>Serialysis appears to be very old <a href="https://weblogs.java.net/blog/emcmanus/archive/2007/06/disassembling_s.html" rel="nofollow">https://weblogs.java.net/blog/emcmanus/archive/2007/06/disassembling_s.html</a></li>
  </ol>
  
  <p>Thank you for your help.</p>
  
  <p>Regards,
  Gursev</p>