Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 37031 invoked from network); 30 Oct 2007 16:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2007 16:39:27 -0000 Received: (qmail 7616 invoked by uid 500); 30 Oct 2007 16:32:14 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 7548 invoked by uid 500); 30 Oct 2007 16:32:14 -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 List-Id: Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 7531 invoked by uid 99); 30 Oct 2007 16:32:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 09:32:14 -0700 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=FH_HELO_ALMOST_IP,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of thorsten.scherler.ext@juntadeandalucia.es designates 217.12.18.114 as permitted sender) Received: from [217.12.18.114] (HELO 114.zone-217.12.18.juntadeandalucia.es) (217.12.18.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Oct 2007 16:32:27 +0000 Received: from [10.240.225.254] (helo=mail.juntadeandalucia.es) by guadix1.juntadeandalucia.es with esmtps (TLSv1:AES256-SHA:256) (Exim 4.60) (envelope-from ) id 1Imu0Q-0004iC-IP for dev@cocoon.apache.org; Tue, 30 Oct 2007 17:31:54 +0100 Received: from [10.240.192.30] by mail.juntadeandalucia.es with esmtpa (Exim 4.60) (envelope-from ) id 1Imu0R-0006bt-5K for dev@cocoon.apache.org; Tue, 30 Oct 2007 17:31:55 +0100 Subject: Re: Transformer that are not based on avalon From: Thorsten Scherler To: dev@cocoon.apache.org In-Reply-To: <1193744600.6865.34.camel@localhost> References: <1193744600.6865.34.camel@localhost> Content-Type: text/plain Date: Tue, 30 Oct 2007 17:24:30 +0100 Message-Id: <1193761470.6865.70.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Spam-Score: 0.1 (/) X-Virus-Checked: Checked by ClamAV on apache.org On Tue, 2007-10-30 at 12:43 +0100, Thorsten Scherler wrote: > Hi all, > > I am trying to get started with cocoon 2.2 development and need to write > my own custom transformer. > > Since I will start from scratch I directly want to start using Spring > instead of Avalon. > > Is there a documentation and/or an example for components that are based > directly on spring instead of avalon that I can use to get familiar? > I found http://www.mail-archive.com/users@cocoon.apache.org/msg39766.html So I defined my transformer in the spring context. which is a simple test transformer: package org.apache.forrest.dispatcher.transformation; import org.apache.cocoon.transformation.AbstractSAXTransformer; import org.xml.sax.SAXException; public class DispatcherTransformer extends AbstractSAXTransformer { private StringBuffer xmlBuffer; /** * Receive notification of the beginning of a document. */ public void startDocument() throws SAXException { xmlBuffer = new StringBuffer(); xmlBuffer.append("\r\n"); xmlBuffer.append(""); } public void endDocument() throws SAXException{ super.contentHandler.characters(xmlBuffer.toString().toCharArray(), 0, xmlBuffer.length()); } } After "mvn install" I run "mvn jetty:run" and receive an exception in the AbstractSAXTransformer: Caused by: java.lang.NullPointerException at org.apache.cocoon.transformation.AbstractSAXTransformer.setup(AbstractSAXTransformer.java:274) at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:354) When I debug in Eclipse I can see the following cause: LINE:274 = if (getLogger().isDebugEnabled()) { where getLogger() returns when inspecting: "Method "getLogger" with signature "()Lorg/apache/commons/logging/Log;" is not applicable on this object" I reckon I need to configure the logging differently but sadly there seems to very little documentation yet (or at least I could not find it yet). Any idea what I am doing wrong? salu2 > TIA > > salu2 -- Thorsten Scherler thorsten.at.apache.org Open Source Java consulting, training and solutions