How to ignore Exceptions during Spring context initialization?

The Idea of Exceptions is to fix the cause of them, not to ignore them.

The Idea of Exceptions is to fix the cause of them, not to ig I have never seen anything for that: you have to do it by our own. Put a try catch around the init method that consume the exception and log it. If you have real AspectJ, then you can use it for that task too.

But Spring-AOP will not work. (comment) I use side library where I should call init method, which establish connection with some server, where problem might appear.In this case. What about a factory that provides the bean which causes the trouble to the context.

The factory should check the connection first (or wait for the exception) (what exactly you do is an implementation detail) and return the bean if every thing is correct. If the connection is failing, then the factory return a Dummy implementation instead..

I don't agree with you. I use side library where I should call init method, which establish connection with some server, where problem might appear. The whole spring context won't start because of this.

I just want ignore such bean creation if possible. – Eduard Nov 30 at 13:23 @Eduard: This use case is not what you asked for: You asked for some way to ignore Exceptions of all beans, not of an specific one. In this case the specific exception needs a specific handling, that is normal programming.It is not related so Spring Context.

– Ralph Nov 30 at 13:39 @Eduard: due to the more precice use case, see my extended answer. – Ralph Nov 30 at 13:44 Thanks. I liked it =) – Eduard Nov 300 at 9:37.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions