This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

RmiServiceExporter: must set ClientSocketFactory if setting ServerSocketFactory?Page Title Module

RmiServiceExporter: must set ClientSocketFactory if setting ServerSocketFactory?

Sep 17th, 2007, 12:13 PM

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.