Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions from Container to Bean?

 
yamini nadella
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exceptions thrown from container to bean or bean to container.

Exceptions thrown from container to bean are all system exceptions only?
Can a container throughs any checked exceptions other than remote exception?

Yamini
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by yamini nadella:
Exceptions thrown from container to bean or bean to container.

Exceptions thrown from container to bean are all system exceptions only?
Can a container throughs any checked exceptions other than remote exception?

Yamini


The whole purpose of an exception is for bean clients. Those could be a client or the container. The bean wouldn't make any use of exceptions throws by the container and it would be hard for the container to contact the bean if the container throws an exception. So the bean can throw exceptions, and the container can throw exceptions. In both cases, is the client who needs to know what went wrong on the server side.

Exceptions can be application (the client expected it) or system (the client didn't expect it).

System exceptions are generally wrapped around EJB exceptions: javax.ejb.EJBException if the client is local, java.rmi.RemoteException is the client is remote.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic