This content has been marked as final.
Show 2 replies
-
1. Re: Application Scope Bean constructing twice
swd847 Apr 22, 2010 12:28 AM (in response to choicegh)Are you sure it is the bean that is being constructed twice and not the bean and a proxy?
to check stick something like this in the constructor:
System.out.println("Constructing class: " + this.getClass().getName());
-
2. Re: Application Scope Bean constructing twice
choicegh Apr 23, 2010 4:05 AM (in response to choicegh)I added the name of the class to the logging statement I already had in the constructor. Indeed the first log was from a proxy. The second from the class itself.
In the constrictor I was reading a properties file in. When I took that out ,thus making the constructor empty, only one logging statement occurred.
I put the file load into an initial method annotated PostConstruct and I started getting the behavior I was expecting.