• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ejb method only throw RemoteException??

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, guys... i need a help.....

I have a method in EJB like below:

public int method() throws MyException{

if(xxx)
throw new MyException("sss");
}

when I call this method, i cannot catch MyException...
should i catch RemoteException??
EJB doesn't throw user defiend Exception??
 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by julie sohn:
EJB doesn't throw user defiend Exception??



EJB does throw User Defined Exceptions. Remote Exceptions should be declared to be thrown in remote component interfaces and beans. These are thrown when there is any problem in trying to access remote objects for any reasons. You can also throw user defined exceptions together with remote exceptions.

You need to make sure that you have same method signatures in remote component interface and bean implementation class.

-Swapan
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hope this would be helpful -
http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic