wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes ejb method only throw RemoteException?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ejb method only throw RemoteException??" Watch "ejb method only throw RemoteException??" New topic
Author

ejb method only throw RemoteException??

chris
Greenhorn

Joined: Mar 18, 2003
Posts: 14
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??
Swapan Mazumdar
Ranch Hand

Joined: Jul 23, 2003
Posts: 83
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
Maybach Smith
Greenhorn

Joined: Dec 22, 2004
Posts: 15
Hope this would be helpful -
http://www-106.ibm.com/developerworks/java/library/j-ejbexcept.html


Maybach
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ejb method only throw RemoteException??