|
From: Paulo S. <pau...@gm...> - 2008-08-22 20:56:37
|
Yep, that seemed to be the problem... We will test more but now it looks
like it won't cause more headaches...
But what does it mean? That there were some kind of race between RestEasy
and Spring to inject the resource?
Also, if the scan is false, how are the resources detected? Is everything
left to Spring to handle?
anyway, thank you very much for your help!
[]s,
On Fri, Aug 22, 2008 at 5:02 PM, Bill Burke <bb...@re...> wrote:
> I already asked this once, but I'll ask it again....
>
> Do you have Restasy scanning turned OFF in web.xml? If you don't turn it
> off. I think this is what your problem is.
>
> Paulo Siqueira wrote:
>
>> Ok, the result is bellow (I added blank lines to help find the second
>> part). If I understood, the first time, the injection is made by spring, and
>> the second time resteasy try to do something...
>>
>> Also, a bizzarre thing is that it worked once, and then the second time
>> didn't print any exception (which makes sense since there were no new
>> instances being created).
>>
>>
>> 16:16:16,053 INFO [STDOUT] Instantiating LocatingResource: 1219432576053
>> 16:16:16,053 ERROR [STDERR] java.lang.Exception
>> 16:16:16,054 ERROR [STDERR] at
>> padauan.LocatingResource.<init>(LocatingResource.java:30)
>> 16:16:16,054 ERROR [STDERR] at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> 16:16:16,054 ERROR [STDERR] at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>> 16:16:16,054 ERROR [STDERR] at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>> 16:16:16,054 ERROR [STDERR] at
>> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:96)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:875)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:837)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
>> 16:16:16,054 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
>> 16:16:16,054 ERROR [STDERR] at
>> java.security.AccessController.doPrivileged(Native Method)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:220)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:255)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199)
>> 16:16:16,055 ERROR [STDERR] at
>> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
>> 16:16:16,055 ERROR [STDERR] at
>> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3856)
>> 16:16:16,055 ERROR [STDERR] at
>> org.apache.catalina.core.StandardContext.start(StandardContext.java:4361)
>> 16:16:16,055 ERROR [STDERR] at
>> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:790)
>> 16:16:16,056 ERROR [STDERR] at
>> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:770)
>> 16:16:16,056 ERROR [STDERR] at
>> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:553)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,056 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,056 ERROR [STDERR] at
>> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
>> 16:16:16,056 ERROR [STDERR] at
>> org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
>> 16:16:16,056 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,056 ERROR [STDERR] at
>> org.apache.catalina.core.StandardContext.init(StandardContext.java:5312)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 16:16:16,056 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,056 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,056 ERROR [STDERR] at
>> org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:296)
>> 16:16:16,056 ERROR [STDERR] at
>> org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.web.tomcat.service.TomcatDeployer.performDeployInternal(TomcatDeployer.java:301)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.web.tomcat.service.TomcatDeployer.performDeploy(TomcatDeployer.java:104)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:375)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.web.WebModule.startModule(WebModule.java:83)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.web.WebModule.startService(WebModule.java:61)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
>> 16:16:16,057 ERROR [STDERR] at
>> sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
>> 16:16:16,057 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,057 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>> 16:16:16,057 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
>> 16:16:16,058 ERROR [STDERR] at $Proxy0.start(Unknown Source)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.system.ServiceController.start(ServiceController.java:417)
>> 16:16:16,058 ERROR [STDERR] at
>> sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
>> 16:16:16,058 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,058 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,058 ERROR [STDERR] at
>> org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>> 16:16:16,069 ERROR [STDERR] at $Proxy44.start(Unknown Source)
>> 16:16:16,069 ERROR [STDERR] at
>> org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
>> 16:16:16,069 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 16:16:16,070 ERROR [STDERR] at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 16:16:16,070 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,070 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
>> 16:16:16,070 ERROR [STDERR] at
>> org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:87)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>> 16:16:16,071 ERROR [STDERR] at $Proxy45.start(Unknown Source)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
>> 16:16:16,071 ERROR [STDERR] at
>> org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
>> 16:16:16,072 ERROR [STDERR] at
>> sun.reflect.GeneratedMethodAccessor21.invoke(Unknown Source)
>> 16:16:16,072 ERROR [STDERR] at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> 16:16:16,072 ERROR [STDERR] at
>> java.lang.reflect.Method.invoke(Method.java:597)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
>> 16:16:16,072 ERROR [STDERR] at
>> org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
>> 16:16:16,073 ERROR [STDERR] at $Proxy9.deploy(Unknown Source)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:610)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
>> 16:16:16,073 ERROR [STDERR] at
>> org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
>> 16:16:16,093 INFO [STDOUT] new Seci being injected at LocatingResource:
>> 1219432576053
>> 16:16:16,097 INFO [ContextLoader] Root WebApplicationContext:
>> initialization completed in 533 ms
>>
>>
>>
>> 16:16:21,089 INFO [STDOUT] Instantiating LocatingResource: 1219432581089
>> 16:16:21,098 ERROR [STDERR] java.lang.Exception
>> 16:16:21,098 ERROR [STDERR] at
>> padauan.LocatingResource.<init>(LocatingResource.java:30)
>> 16:16:21,098 ERROR [STDERR] at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>> 16:16:21,098 ERROR [STDERR] at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
>> 16:16:21,098 ERROR [STDERR] at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
>> 16:16:21,098 ERROR [STDERR] at
>> java.lang.reflect.Constructor.newInstance(Constructor.java:513)
>> 16:16:21,098 ERROR [STDERR] at
>> org.resteasy.ConstructorInjectorImpl.construct(ConstructorInjectorImpl.java:82)
>> 16:16:21,099 ERROR [STDERR] at
>> org.resteasy.plugins.server.resourcefactory.POJOResourceFactory.createResource(POJOResourceFactory.java:38)
>> 16:16:21,099 ERROR [STDERR] at
>> org.resteasy.ResourceMethod.invoke(ResourceMethod.java:133)
>> 16:16:21,099 ERROR [STDERR] at
>> org.resteasy.Dispatcher.invoke(Dispatcher.java:161)
>> 16:16:21,099 ERROR [STDERR] at
>> org.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:138)
>> 16:16:21,099 ERROR [STDERR] at
>> org.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:77)
>> 16:16:21,099 ERROR [STDERR] at
>> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>> 16:16:21,099 ERROR [STDERR] at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
>> 16:16:21,099 ERROR [STDERR] at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> 16:16:21,099 ERROR [STDERR] at
>> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
>> 16:16:21,100 ERROR [STDERR] at
>> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
>> 16:16:21,100 ERROR [STDERR] at
>> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
>> 16:16:21,100 ERROR [STDERR] at
>> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>> 16:16:21,100 ERROR [STDERR] at
>> org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
>> 16:16:21,101 ERROR [STDERR] at
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> 16:16:21,101 ERROR [STDERR] at
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
>> 16:16:21,101 ERROR [STDERR] at
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> 16:16:21,101 ERROR [STDERR] at
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>> 16:16:21,101 ERROR [STDERR] at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>> 16:16:21,101 ERROR [STDERR] at java.lang.Thread.run(Thread.java:619)
>> 16:16:21,101 INFO [STDOUT] 'fabiopqp' URL begin called at
>> LocatingResource: 1219432581089
>> 16:16:21,102 INFO [STDOUT] Injected Seci for this call: null
>>
>>
>> []s,
>>
>>
>> On Fri, Aug 22, 2008 at 4:05 PM, Bill Burke <bb...@re... <mailto:
>> bb...@re...>> wrote:
>>
>> Ok, that helps.
>>
>> Now, in the constructor add this:
>>
>> public MyResourceA()
>> {
>> new Exception.printStackTrace();
>> ...the id printing...
>> }
>>
>> This will tell us exactly who is instantiating the resource.
>>
>>
>>
>>
>> Paulo Siqueira wrote:
>>
>> 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
>>
>>
>> -- Bill Burke
>> JBoss, a division of Red Hat
>> http://bill.burkecentral.com
>>
>>
>>
>>
>> --
>> Paulo R C Siqueira
>> SCJP / SCWCD
>> http://www.ipti.org.br
>> Contato: (11) 8149-5046
>>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com
>
--
Paulo R C Siqueira
SCJP / SCWCD
http://www.ipti.org.br
Contato: (11) 8149-5046
|