Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 31913 invoked from network); 18 Jul 2004 04:30:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 18 Jul 2004 04:30:47 -0000 Received: (qmail 22315 invoked by uid 500); 18 Jul 2004 04:30:42 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 22232 invoked by uid 500); 18 Jul 2004 04:30:42 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 22218 invoked by uid 99); 18 Jul 2004 04:30:42 -0000 X-ASF-Spam-Status: No, hits=0.7 required=10.0 tests=DNS_FROM_RFC_ABUSE,INFO_TLD,RCVD_BY_IP X-Spam-Check-By: apache.org Received: from [66.51.199.81] (HELO mail5.dslextreme.com) (66.51.199.81) by apache.org (qpsmtpd/0.27.1) with SMTP; Sat, 17 Jul 2004 21:30:40 -0700 Received: (qmail 31046 invoked from network); 18 Jul 2004 04:30:29 -0000 Received: from unknown (HELO rio.dslextreme.com) (66.51.196.164) by 192.168.8.93 with SMTP; Sun, 18 Jul 2004 04:30:29 +0000 Message-Id: <6.1.2.0.2.20040717212511.024c0b20@mail.dslextreme.com> X-Sender: Ralph.Goers@mail.dslextreme.com X-Mailer: QUALCOMM Windows Eudora Version 6.1.2.0 Date: Sat, 17 Jul 2004 21:30:24 -0700 To: dev@cocoon.apache.org From: Ralph Goers Subject: Re: Problems trying to implement a SourceFactory In-Reply-To: <6.1.2.0.2.20040717142846.024d5b90@mail.dslextreme.com> References: <6.1.2.0.2.20040717142846.024d5b90@mail.dslextreme.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-AntiVirus: scanned for viruses by AMaViS 0.2.1 (http://amavis.org/) X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N I did some searching. CloningInheritableThreadLocal does exist as a private class in CocoonComponentManager. What this has to do with what you are doing, I have no idea. Ralph At 7/17/2004 02:29 PM, you wrote: >Does it make a difference if you declare your SourceFactory as >implementing ThreadSafe? It should be since it is. > >Ralph > >At 7/17/2004 10:26 AM, you wrote: >> >>>>> "Colin" == Colin Paul Adams writes: >> >> Colin> I have written a Source and a SourceFactory for Berkeley DB >> Colin> XML. My source factory implements >> Colin> org.apache.excalibur.source.SourceFactory (just like >> Colin> PartSourceFactory does, so I assumed it would be OK). And >> Colin> I added the following line to cocoon.xconf: >> >> Colin> > Colin> class="org.apache.cocoon.source.impl.BerkeleyDBXMLSourceFactory" >> Colin> name="bdbxml"/> >> >> Colin> However, as soon as I try to access Cocoon, I get: >> >> Colin> Initialization Problem >> >> Colin> Message: Could not find component (key >> Colin> [org.apache.excalibur.source.SourceResolver]) >> >> Colin> Description: >> Colin> org.apache.avalon.framework.component.ComponentException: >> Colin> Could not find component (key >> Colin> [org.apache.excalibur.source.SourceResolver]) >> >> Colin> Sender: org.apache.cocoon.servlet.CocoonServlet >> >> Colin> Source: Cocoon Servlet >> >> Colin> cause >> >> Colin> java.lang.ClassNotFoundException: >> Colin> org.apache.cocoon.source.impl.BerkeleyDBXMLSourceFactory >> >>OK - I worked that one out - it was a typo on my part, in cocoon.xconf. >> >>But having corrected it, jetty now won't start. I get: >> >>Main Class: org.mortbay.jetty.Server >>18:17:20.168 EVENT Checking Resource aliases >>18:17:20.610 EVENT Starting Jetty/4.2.19 >>18:17:21.050 EVENT Started WebApplicationContext[/,./build/webapp] >>18:17:21.123 WARN!! Delete existing temp dir /tmp/Jetty__8888__ for >>WebApplicationContext[/,./build/webapp] >>trying to register database >>trying to register database >>Exception in thread "main" java.lang.reflect.InvocationTargetException >> 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 Loader.invokeMain(Unknown Source) >> at Loader.run(Unknown Source) >> at Loader.main(Unknown Source) >>Caused by: >>java.lang.NoClassDefFoundError:org/apache/cocoon/environment/internal/CloningInheritableThreadLocal >> >>Well, certainly such a class does not exist. >>But I have no idea why it should or shouldn't. Any pointers please: >> >>rest of stack trace: >> at >> org.apache.cocoon.components.source.CocoonSourceResolver.resolveURI(CocoonSourceResolver.java:53) >> at >> org.apache.cocoon.components.source.CocoonSourceResolver.resolveURI(CocoonSourceResolver.java:70) >> at >> org.apache.cocoon.components.treeprocessor.TreeProcessor.configure(TreeProcessor.java:229) >> at >> org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:240) >> at >> org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:269) >> at >> org.apache.avalon.excalibur.component.ThreadSafeComponentHandler.initialize(ThreadSafeComponentHandler.java:108) >> at >> org.apache.avalon.excalibur.component.ExcaliburComponentManager.initialize(ExcaliburComponentManager.java:522) >> at >> org.apache.cocoon.components.container.CocoonComponentManager.initialize(CocoonComponentManager.java:132) >> at >> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:283) >> at org.apache.cocoon.Cocoon.initialize(Cocoon.java:304) >> at >> org.apache.avalon.framework.container.ContainerUtil.initialize(ContainerUtil.java:283) >> at >> org.apache.cocoon.servlet.CocoonServlet.createCocoon(CocoonServlet.java:1385) >> at >> org.apache.cocoon.servlet.CocoonServlet.init(CocoonServlet.java:484) >> at >> org.mortbay.jetty.servlet.ServletHolder.start(ServletHolder.java:220) >> at >> org.mortbay.jetty.servlet.ServletHandler.initializeServlets(ServletHandler.java:445) >> at >> org.mortbay.jetty.servlet.WebApplicationHandler.initializeServlets(WebApplicationHandler.java:150) >> at >> org.mortbay.jetty.servlet.WebApplicationContext.start(WebApplicationContext.java:458) >> at org.mortbay.http.HttpServer.start(HttpServer.java:663) >> at org.mortbay.jetty.Server.main(Server.java:429) >> ... 7 more >> >>My source factory just looks like this: >> >>package org.apache.cocoon.components.source.impl; >> >>import java.util.Map; >>import java.net.MalformedURLException; >> >>import org.apache.avalon.framework.thread.ThreadSafe; >>import org.apache.excalibur.source.Source; >>import org.apache.excalibur.source.SourceFactory; >> >>/** >> * A factory for Berkeley DB XML sources (see {@link BerkeleyDBXMLSource}). >> * >> * @avalon.component >> * @avalon.service type=SourceFactory >> * @x-avalon.info name=berkeleyDBXML-source >> * @x-avalon.lifestyle type=singleton >> * >> * @author Colin Adams >> */ >>public class BerkeleyDBXMLSourceFactory >> implements SourceFactory { >> >> >> /** >> * @see >> org.apache.excalibur.source.SourceFactory#getSource(java.lang.String, >> java.util.Map) >> */ >> public Source getSource(String location, Map parameters) throws >> MalformedURLException >> { >> return new BerkeleyDBXMLSource(location); >> } >> >> /** >> * Does nothing, since {@link BerkeleyDBXMLSource}s don't need to be >> released (at present). >> * >> * @see >> org.apache.excalibur.source.SourceFactory#release(org.apache.excalibur.source.Source) >> */ >> public void release(Source source) >> { >> // Nothing to do here >> } >> >>} >> >>-- >>Colin Paul Adams >>Preston Lancashire >