users@glassfish.java.net

Re: Curious about this -- any explanation?

From: Dominik Dorn <dominik.dorn_at_gmail.com>
Date: Tue, 5 Oct 2010 18:03:17 +0200

> It looks like the constructor is being executed twice on the same object -- is this possibly true as some side-effect of CDI?
Yes. You should create constructors that don't do anything and put
every initialization logic into a method annotated with
@PostConstruct

Also you should switch from System.out.println to a logger (e.g. Log4J)
as System.out.println will slow down your system in production.

kind regards,
dominik
-- 
Dominik Dorn
http://dominikdorn.com
http://twitter.com/domdorn
Tausche Deine Lernunterlagen auf http://www.studyguru.eu/at/wu/ !