Seam Framework - Why is the constructor invoked twice when a normal scoped bean is crea... - 0 views
-
Why is the constructor invoked twice when a normal scoped bean is created?
-
What you see is the instantiation of two objects: one is the actual bean instance, the other one is the proxy. Both likely invoke the default constructor.
-
That's why it's generally considered a bad idea to do initialization in class construction code. Instead, when using managed beans (objects managed by the EE container) to perform initialisation in a @PostConstruct or @Inject annotated method.