cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Charles Yates <ceya...@stanford.edu>
Subject Re: SourceFactory instantiated twice
Date Wed, 19 Feb 2003 19:09:38 GMT
Vadim Gritsendo wrote:

>Charles Yates wrote:
>
>> Hello,
>>     I've been working on a custom SourceFactory and was getting some
>> odd behavior suggesting that it was not a singleton (SourceFactory 
>> extends
>> ThreadSafe) as expected.  I investigated a bit and discovered that 2 were
>> being instantiated.  You can see this behavior in the logs with the 
>> cocoon
>> 2.0.4 samples if you 'grep SourceHandlerImpl core.log'.  Both the file 
>> and
>> blob source factories get created twice.  I went as far as printing 
>> out a stack
>> trace when the instantiation happens to my factory.  My feeble 
>> understanding
>> was not able to make much sense of them.
>
>
>What was the stacktraces?
>
>Vadim

Here is catalina.out with stack traces generated in the
SourceFactory constructor.  FWIW I've noticed that this
does _not_ happen with cocoon 2.1-dev, but does with 2.0.4.
The first occurs with servlet initialization, the second
only after a request involving the factory.

Feb 19, 2003 9:47:16 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on port 8080
Starting service Tomcat-Standalone
Apache Tomcat/4.1.18-LE-jdk14
java.lang.Exception: This is CacheableSourceFactory number 0
	at edu.stanford.laneweb.CacheableSourceFactory.<init>(CacheableSourceFactory.java:50)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at java.lang.Class.newInstance0(Class.java:306)
	at java.lang.Class.newInstance(Class.java:259)
	at org.apache.cocoon.util.ClassUtils.newInstance(ClassUtils.java:75)
	at org.apache.cocoon.components.source.SourceHandlerImpl.configure(SourceHandlerImpl.java:118)
	at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:264)
	at org.apache.avalon.excalibur.component.DefaultComponentHandler.doGet(DefaultComponentHandler.java:126)
	at org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:234)
	at org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(ExcaliburComponentManager.java:262)
	at org.apache.cocoon.components.CocoonComponentManager.lookup(CocoonComponentManager.java:235)
	at org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.lookup(DefaultComponentFactory.java:393)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.initialize(TreeProcessor.java:280)
	at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:275)
	at org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:98)
	at org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(ExcaliburComponentManager.java:513)
	at org.apache.cocoon.Cocoon.initialize(Cocoon.java:270)
	at org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1276)
	at org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:485)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:934)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:821)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3420)
	at org.apache.catalina.core.StandardContext.start(StandardContext.java:3608)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
	at org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:257)
	at org.apache.catalina.core.StandardHost.install(StandardHost.java:772)
	at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:569)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:411)
	at org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
	at org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
	at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
	at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
	at org.apache.catalina.core.StandardService.start(StandardService.java:497)
	at org.apache.catalina.core.StandardServer.start(StandardServer.java:2189)
	at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
	at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
	at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
Feb 19, 2003 9:47:24 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on port 8080
java.lang.Exception: This is CacheableSourceFactory number 1
	at edu.stanford.laneweb.CacheableSourceFactory.<init>(CacheableSourceFactory.java:50)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
	at java.lang.Class.newInstance0(Class.java:306)
	at java.lang.Class.newInstance(Class.java:259)
	at org.apache.cocoon.util.ClassUtils.newInstance(ClassUtils.java:75)
	at org.apache.cocoon.components.source.SourceHandlerImpl.configure(SourceHandlerImpl.java:118)
	at org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:264)
	at org.apache.avalon.excalibur.component.DefaultComponentHandler.doGet(DefaultComponentHandler.java:126)
	at org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:234)
	at org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(ExcaliburComponentManager.java:262)
	at org.apache.cocoon.components.CocoonComponentManager.lookup(CocoonComponentManager.java:235)
	at org.apache.avalon.excalibur.component.DefaultComponentFactory$ComponentManagerProxy.lookup(DefaultComponentFactory.java:393)
	at org.apache.avalon.excalibur.component.ExcaliburComponentManager.lookup(ExcaliburComponentManager.java:185)
	at org.apache.cocoon.components.CocoonComponentManager.lookup(CocoonComponentManager.java:235)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.initialize(TreeProcessor.java:280)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.createChildProcessor(TreeProcessor.java:193)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.getProcessor(MountNode.java:150)
	at org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:109)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:166)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:151)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:145)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:332)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:311)
	at org.apache.cocoon.components.source.SitemapSource.refresh(SitemapSource.java:290)
	at org.apache.cocoon.components.source.SitemapSource.<init>(SitemapSource.java:206)
	at org.apache.cocoon.components.source.CocoonSourceFactory.getSource(CocoonSourceFactory.java:91)
	at org.apache.cocoon.components.source.SourceHandlerImpl.getSource(SourceHandlerImpl.java:176)
	at org.apache.cocoon.environment.AbstractEnvironment.resolve(AbstractEnvironment.java:368)
	at org.apache.cocoon.generation.FileGenerator.setup(FileGenerator.java:103)
	at org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
	at org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
	at org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
	at org.apache.cocoon.components.source.SitemapSource.refresh(SitemapSource.java:305)
	at org.apache.cocoon.components.source.SitemapSource.<init>(SitemapSource.java:206)
	at org.apache.cocoon.components.source.CocoonSourceFactory.getSource(CocoonSourceFactory.java:91)
	at org.apache.cocoon.components.source.SourceHandlerImpl.getSource(SourceHandlerImpl.java:176)
	at org.apache.cocoon.environment.AbstractEnvironment.resolve(AbstractEnvironment.java:368)
	at org.apache.cocoon.generation.FileGenerator.setup(FileGenerator.java:103)
	at org.apache.cocoon.components.pipeline.AbstractEventPipeline.setupPipeline(AbstractEventPipeline.java:202)
	at org.apache.cocoon.components.pipeline.CachingEventPipeline.setup(CachingEventPipeline.java:278)
	at org.apache.cocoon.components.pipeline.CachingEventPipeline.generateKey(CachingEventPipeline.java:141)
	at org.apache.cocoon.components.pipeline.CachingStreamPipeline.process(CachingStreamPipeline.java:313)
	at org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:154)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:85)
	at org.apache.cocoon.components.treeprocessor.sitemap.PreparableMatchNode.invoke(PreparableMatchNode.java:166)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:151)
	at org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:109)
	at org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:145)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:332)
	at org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:293)
	at org.apache.cocoon.Cocoon.process(Cocoon.java:579)
	at org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1043)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:260)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
	at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
	at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
	at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
	at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:432)
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:386)
	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:534)
	at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:530)
	at java.lang.Thread.run(Thread.java:536)
Stopping service Tomcat-Standalone






---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Mime
View raw message