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

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
 
Everybody! Do the Funky Monkey! Like this tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic