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

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -