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.

If the bean you are exporting is no valid remote bean (i.e. implementing Remote, all methods declare throwing RemoteException), it can still be exported by Spring. However, in that case you can only retrieve it via Spring on the client side.

Regards,
Andreas

Comment

I see.
So my Pojo is 'surrounded' by an object which enables my to expose it as an RMI-service.
I am wondering wether there might be a way to get my Pojo out of the wrapper_stub on the client side.
Other solution would be using Spring. But this is the last option.

Comment

I wonder why you refrain from using Spring on the client side?
If you use dependency injection, your code would not even realize, that remoting takes place.

If you do not want to use Spring, I think you have to either make your bean rmi-capable or have a look at how spring handles the wrapping behind the scenes and reimplement it yourself.

Regards,
Andreas

I don't refrain from using Spring. But I am the one who has to convince his colleague to use it and as long as he is not willing to use Springs dependency injection but wants to use my RMI-Service we have a problem. He is complaining that using Spring makes him dependent on Spring.
I will keep on trying to convince him.

Comment

Well, that is not completely wrong. There has to be a compromise. Either to rely on Spring's services and have clean service interfaces or to not use Spring but bind yourself on RMI remote interfaces.
Some dependencies are just necessary. The point is to make a good choice.

Comment

Well, if the target object in your case is exposed via Spring I would indeed use a plain normal Remote object. This could be accessed in normal ways without using Spring classes.
(Though I never did RMI in Java Stored Procedures, so I do not know if this works at all)

Regards,
Andreas

Comment

Hi, I'm a little late in this thread, but I'd like to say that this case is clearly explained in the remote section of the spring reference (coupling with spring in the client, etc.).
As Andreas says, it might be better to unwrap the service exposing it through plain RMI to allow non spring clients to connect normally.