cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Pietschmann" <dev.sen...@gmail.com>
Subject Very basic problem with custom Avalon component
Date Mon, 05 Dec 2005 07:53:54 GMT
Hi Cocooners,

something's going wrong with my first Avalon experiments.
I stripped it down to this simple case - i just don't seem to find out what
the problem with this is:

## cocoon.xconf ######################################

<component role="de.foo.bar.TestComponent" shorthand="test"
default-class="de.foo.bar.impl.TestComponentImpl"/>

## TestComponent.java ###########################

package de.foo.bar;

import org.apache.avalon.framework.component.Component;

public interface TestComponent extends Component {
   String ROLE = TestComponent.class.getName();
}


## TestComponentImpl #################################

package de.foo.bar.impl;

import de.foo.bar.TestComponent;

public class TestComponentImpl implements TestComponent {
    public TestComponentImpl() { }
}

## my custom pipeline ##################################

public class CustomNonCachingProcessingPipeline extends
NonCachingProcessingPipeline implements Disposable {

ComponentManager manager = null;

public void compose(ComponentManager manager) throws ComponentException {
        super.compose(manager);
        this.manager = manager;
}

protected void setupPipeline(Environment environment)
    throws ProcessingException {
         tc = (TestComponent)manager.lookup(TestComponent.ROLE);
         super.setupPipeline(environment);
}

### this leads to the following error at the Cocoon startup: #######

2005-12-04 20:30:42,234 ERROR [core.manager]: Unexpected exception for hint:
de.foo.bar.TestComponent
java.lang.NullPointerException
	at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1253)
	at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
a:1187)
	at
org.apache.avalon.excalibur.component.ExcaliburComponentManager.configure(Ex
caliburComponentManager.java:444)
	at
org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.
java:201)
	at org.apache.cocoon.Cocoon.configure(Cocoon.java:467)
	at org.apache.cocoon.Cocoon.initialize(Cocoon.java:327)

#######################################################

Why oh why?

Thanx,
Stefan


Mime
View raw message