Announcement Announcement Module
Collapse
No announcement yet.
RmiServiceExporter: must set ClientSocketFactory if setting ServerSocketFactory? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RmiServiceExporter: must set ClientSocketFactory if setting ServerSocketFactory?

    Hi there,

    I was wondering if someone could help me understand why the prepare() method insists that either both the ServerSocketFactory and ClientSocketFactory are set or they are both null?

    The reason I am asking is this:

    I would like to control the behavior of the accept() call in the ServerSocket which gets returned to Sun's RMI implementation. I would do this by providing my own RMIServerSocketFactory which produces a type extending ServerSocket and overriding the accept() method.

    As things stand, I have to provide a client socket factory. This won't work: we have RMI classloading turned off and if we set a custom client socket factory, it tries to marshal this to the client; since wire-bound classloading is off, this causes the client to go pop.

    I have tried setting the clientsocketfactory to RMISocketFactory.getDefaultSocketFactory() and setting a custom server socket factory, but I get an exception thrown when a client connects coz this object is not serializable.

    Any thoughts?
Working...
X