java - pass EJB ApplicationException to web -


I have EJB classes, custom exceptions, and web back and bean classes, I want to capture custom exceptions in the Web if EJB Exception passes, but can hold runtime exposure exception ??

Exception class:

  @ Application exceptions expands public class CustomException exception {}   

EJB class:

  Employees of Public Sector Dao {Private User Transaction Transaction; @basana unit (unit name = "xxx") protected EntityManagerFactory entityManagerFactory; . . . . . Public Zero addNewEmployee (employee employee) throws CustomException {. . . . Throw New CustomException (...); }}   

Backend class:

  Public class employee backend {. . . . Public Zero doAddEmployee () {try {.... employeeDao.addNewEmployee (); } Grip (custom expression e) {System.err.println ("------------------------ Custom Expansion"); E.printStackTrace (); } Hold (runtime exception e) {System.err.println ("------------------------ runtime exception"); E.printStackTrace (); After covering the main exception with custom exception, this issue is an I / there system exception, so the custom exception is not passed, only the system exception is near :)   

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -