• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

RemoteException vs EJBException

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
In EJB 2.0 specification, it is mentioned that the use of java.rmi.RemoteException was deprecated for container-invoked callbacks (like ejbCreate, ejbPassivate, ejbActivate) and must use javax.ejb.EJBException instead.
But when I create a new EJB 2.0 component with java.rmi.RemoteException, build and deployment was successful. Also with javax.ejb.EJBException, build and deployment was successful.
This means can we use either of these exceptions in EJB 2.0....?
Is it not necessary to replace java.rmi.RemoteException with javax.ejb.EJBException ....?
Thanks
Raghu
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In EJB 2.0 specification, it is mentioned that the use of java.rmi.RemoteException was deprecated for container-invoked callbacks (like ejbCreate, ejbPassivate, ejbActivate) and must use javax.ejb.EJBException instead.


The term that is important here is "deprecated". The term deprecated means that it is supported for now, but in future it may no longer be supported.
Thus you have written code that works for now. But in future your code may not work!!!
 
Raghothaman Nagarajachar
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your answer.
Will replace RemoteException with EJBException.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
You do not need to throw EJBException as it is a runtime exception.
 
Get out of my mind! Look! A tiny ad!
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic