• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using EJB via RMI

 
Xavier Fabreguettes
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was wondering about what happens when you have a client application (plain java class) invoking a method against an EJB via RMI.

Say that the Remote interface is something like



where MyException is an application exception written by the bean provider (hence packaged up in the same jar as the bean itself).

For this invocation to work successfully, do specific constraints apply to MyException? (i.e. implementing Remote or Serializable)?

Thanks for your help.
 
somkiat puisungnoen
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think, you may not throws MyException in this method.

Because you can wrapped MyException into RemoteException.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Application exception propagates to the Client as it is. No worries.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For this invocation to work successfully, do specific constraints apply to MyException? (i.e. implementing Remote or Serializable


Exception class extends java.io.Serializable. There is no need to implement Remote interface.
 
Xavier Fabreguettes
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception class extends java.io.Serializable. There is no need to implement Remote interface.


Makes sense. Forgot to check, it should have put me on the right track! Thanks for your help.

Xavier
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic