File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes @PostConstruct exception handling Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "@PostConstruct exception handling" Watch "@PostConstruct exception handling" New topic
Author

@PostConstruct exception handling

Ganesh Podaralla
Greenhorn

Joined: Feb 22, 2010
Posts: 23
Hi,

I defined @PostConstruct method in my backing bean and I am using JBossInjectionProvider for handling PostConstruct. I defined a filter to catch all the errors/exceptions thrown by the application. In my PostConstruct method, I am trying to fetch the details from the database. If any error/runtime exception is thrown, I assumed that it will be catched by the filter but looks like JBossInjectionProvider is catching a Throwable instance. So, even if an error is thrown from the PostConstruct method, it is being catched by PostConstruct and it is trying to just ignore the error. Please let me know if you have any ideas for making filter to catch the Throwable instance instead of handling by PostConstruct.

Thanks,
Ganesh
shashank nagabhushan maddali
Greenhorn

Joined: Jun 23, 2008
Posts: 5
Hi,

Try giving a Sysout inside a catch block.
Catch the exception and use a <exceptiovariable>.getMessage function.

See if this will work.


- Regards
shashank nagabhushan maddali
Greenhorn

Joined: Jun 23, 2008
Posts: 5
Hi,

Try giving a Sysout inside a catch block.
Catch the exception and use a <exceptiovariable>.getMessage function.

This will just give you an idea on what the exception was.

Please let me know if you do discover the solution to problem mentioned below. I am interested.

- Regards
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: @PostConstruct exception handling
 
Similar Threads
AspectJ: catch and handle exception using aspectJ
Multiple life-cycle Callback methods per class
Exceptions
Exceptions - Handle or Declare requirement
Exceptions (Khalid & Rolf 's book)