cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Scherler <>
Subject Re: Transformer that are not based on avalon
Date Tue, 30 Oct 2007 16:24:30 GMT
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

So I defined my transformer in the spring context.
<bean id="dispatcher"

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("<?xml version='1.0' encoding='UTF-8'?>\r\n");
	public void endDocument() throws SAXException{
		super.contentHandler.characters(xmlBuffer.toString().toCharArray(), 0,


After "mvn install" I run "mvn jetty:run" and receive an exception in
the AbstractSAXTransformer:
Caused by: java.lang.NullPointerException

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

Any idea what I am doing wrong?


> salu2
Thorsten Scherler                       
Open Source Java                      consulting, training and solutions

View raw message