Q:

RMI server startup binding problem

I have a problem when I try to bind my interface implementation.
java.rmi.MarshalException: error marshalling arguments; nested exception is: 
    java.io.NotSerializableException: java.util.concurrent.ThreadPoolExecutor

Has anyone an idea why this happens?
Why should ThreadPoolExecutor be serializable anyway? It is neither included in my jar file that is my code base, nor is it in the file that is specified by the policy file.
Both parameters only include two class file. These in turn import more complex classes. Is this a possible reason for my problems?

A:

You haven't exported your remote object. It doesn't extend UnicastRemoteObject, and you haven't called UnicastRemoteObject.exportObject(). Either of those would do it (not both), and you haven't done either of them. So your actual remote object was serialized to the Registry in the bind() method, and this failed because your remote object has a non-transient instance member of type ThreadPoolExecutor, which isn't serializable. But the problem is the exporting, not the instance member. If the object was exported, its stub would be serialized to the Registry and the issue wouldn't arise.

