This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • 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: 8927
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: 8927
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