title: weird java.io.NotSerializableException
body: <p>I have a abstract class <code>A</code> which implements <code>Serializable</code>.</p>
  
  <p>There is another concrete class <code>B</code> which extends the <code>A</code> class.</p>
  
  <p>In the constructor of the <code>B</code> class I create an instance of class <code>C</code> (<code>public final class C</code> ).</p>
  
  <p><code>C</code> is throwing wierd exception like this:</p>
  
  <pre>
  Caused by: java.io.NotSerializableException: C
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1164)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
      at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
      at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
      at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
      at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
      at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
      at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:1572)
  </pre>
  
  <p>What can be the problem?</p>