This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB and other Java EE Technologies and the fly likes Unable to throw back Custom Exception from EJB (3.0 version) to Web layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Unable to throw back Custom Exception from EJB (3.0 version) to Web layer" Watch "Unable to throw back Custom Exception from EJB (3.0 version) to Web layer" New topic
Author

Unable to throw back Custom Exception from EJB (3.0 version) to Web layer

Noble Bhaskar Aswanapally
Greenhorn

Joined: Mar 05, 2007
Posts: 13

HI

I am throwing Custom Exceptions from EJB class as below

I am throwing


my class definitions for custom exceptions are as below.




in web layer I am getting it as an instance of javax.ejb.EJBException
I want to it as an instance of XmlParsingException

any suggestions please....
Meiyappan Kannappa
Greenhorn

Joined: Sep 15, 2008
Posts: 10
Hi,

You need to extend any checked exception from custom exception class. Only then the application exception will be propageted to web layer. Since you are extending Runtime exception, all runtime exception will be wrapped by EJBException and propagated.

Thank you


Warm Regards
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Unable to throw back Custom Exception from EJB (3.0 version) to Web layer