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 Sun, 04 Dec 2005 19:38:12 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.amacont.systemadaptation.TestComponent" shorthand="test"
default-class="de.amacont.systemadaptation.impl.TestComponentImpl"/>

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

package de.amacont.systemadaptation;

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

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


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

package de.amacont.systemadaptation.impl;

import de.amacont.systemadaptation.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 this at the Cocoon startup: #######

2005-12-04 20:30:42,234 ERROR [core.manager]: Unexpected exception for hint:
de.amacont.systemadaptation.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