|
From: Paulo S. <pau...@gm...> - 2008-08-22 18:45:31
|
> > MyResourceA should be a singleton right? Only instantiated once? Yes and yes. > I just can't see this as a Resteasy problem. Can you put in a default > constructor and see how many times an instance of MyResourceA is > instantiated? Another thing maybe could be to use setter injection and log > there to see how many times the setter is call. A final thing, create some > random ID per instance and print it out to see if you have different > instances. Following your suggestions, here is an output we got: 15:33:34,597 INFO [STDOUT] Instantiating LocatingResource: 1219430014597 15:33:34,616 INFO [STDOUT] new Seci being injected at LocatingResource: 1219430014597 15:33:34,619 INFO [ContextLoader] Root WebApplicationContext: initialization completed in 506 ms 15:34:12,010 INFO [STDOUT] Instantiating LocatingResource: 1219430052010 15:34:12,013 INFO [STDOUT] 'fabiopqp' URL begin called at LocatingResource: 1219430052010 15:34:12,013 INFO [STDOUT] Injected Seci for this call: null "LocatingResource" is the name of the Resteasy bean. Notice that it is instantiated twice: one in the startup (first three outputs), and another when a URL mapped to a method is called (last three outputs). Also, in the second time, the injector method is not called, and thus the correspondent field is null. []s, -- Paulo R C Siqueira SCJP / SCWCD http://www.ipti.org.br Contato: (11) 8149-5046 |