>     As I was going through the problem, I found out that this happens only
> with the innerclasses. When the innerclass is serialized
> java.io.NotSerializableException: is thrown. It should be noted that only
> the innerclass is implementing the Serializable interface. And I serialize
> only the innerclass. Does that make any difference for Ant.
> 
> For the normal classes there is no problem with the serialization.

By default, normal inner classes have a hidden reference to their enclosing class.  
When you attempt to serialize the inner class, RMI will try to pull the enclosing 
class along with it.  A simple answer is to declare the inner class "static" - making 
it effectively a top-level class, with no reference to the enclosing class.

There might be a way to use Externalizable to avoid streaming the enclosing class (or 
perhaps serialPersistentFields might help) - but I believe that's your basic problem: 
understanding inner classes.

This is not Ant related at all.  Not sure why it works under JBuilder - it should 
still fail.

Continue off list...

-- 
Dardo D. Kleiner
Connection Machine Facility, Center for Computational Sciences
Naval Research Laboratory (Washington, DC)
[EMAIL PROTECTED] -- 202.404.7019 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to