cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Fiol BonnĂ­n <antonio.f...@gmail.com>
Subject NullPointerException using cron block
Date Wed, 31 Aug 2005 06:34:39 GMT
Hello,

Using Cocoon 2.1.7

I defined a cron job in cocoon.xconf, created the pipeline, which calls a 
function. The function does a sendPage, and the called pipeline calls an 
action.

The result: the log is populated with an exception like the following on 
every execution of the cron job.
java.lang.NullPointerException
at org.apache.cocoon.environment.AbstractEnvironment.release(
AbstractEnvironment.java:553)
at org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.release(
MutableEnvironmentFacade.java:303)
at org.apache.cocoon.transformation.TraxTransformer.recycle(
TraxTransformer.java:525)
at org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(
ResourceLimitingPool.java:438)
at org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(
PoolableComponentHandler.java:212)
at org.apache.avalon.excalibur.component.ComponentHandler.put(
ComponentHandler.java:425)
at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(
ExcaliburComponentSelector.java:305)
at org.apache.cocoon.components.ExtendedComponentSelector.release(
ExtendedComponentSelector.java:286)
at org.apache.cocoon.components.ExtendedComponentSelector.release(
ExtendedComponentSelector.java:283)
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.recycle(
AbstractProcessingPipeline.java:736)
at 
org.apache.cocoon.components.pipeline.impl.BaseCachingProcessingPipeline.recycle
(BaseCachingProcessingPipeline.java:77)
at 
org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.recycle
(AbstractCachingProcessingPipeline.java:984)
at org.apache.avalon.excalibur.pool.ResourceLimitingPool.put(
ResourceLimitingPool.java:438)
at org.apache.avalon.excalibur.component.PoolableComponentHandler.doPut(
PoolableComponentHandler.java:212)
at org.apache.avalon.excalibur.component.ComponentHandler.put(
ComponentHandler.java:425)
at org.apache.avalon.excalibur.component.ExcaliburComponentSelector.release(
ExcaliburComponentSelector.java:305)
at org.apache.cocoon.components.ExtendedComponentSelector.release(
ExtendedComponentSelector.java:286)
at org.apache.cocoon.components.ExtendedComponentSelector.release(
ExtendedComponentSelector.java:283)
at org.apache.cocoon.components.EnvironmentDescription.release(
CocoonComponentManager.java:633)
at org.apache.cocoon.components.CocoonComponentManager.endProcessing(
CocoonComponentManager.java:238)
at org.apache.cocoon.components.cron.CocoonQuartzJobExecutor.release(
CocoonQuartzJobExecutor.java:74)
at org.apache.cocoon.components.cron.QuartzJobExecutor.execute(
QuartzJobExecutor.java:116)
at org.quartz.core.JobRunShell.run(JobRunShell.java:191)
at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(Unknown 
Source)
at java.lang.Thread.run(Thread.java:534)


The relevant parts of code:

function regeneraListaPersonas() {
var uri=cocoon.parameters.uri
print("regeneraListaPersonas: "+uri)
elimina(uri);
print("eliminado");
cocoon.sendPage("/interno/datos/directorio/lista-personas");
}

function elimina(uri) {
var source = null;
var resolver = null;
try {
resolver = cocoon.getComponent(
Packages.org.apache.cocoon.environment.SourceResolver.ROLE);
source = resolver.resolveURI(uri);
if (source instanceof Packages.org.apache.excalibur.source.ModifiableSource) 
{
source.getClass().getMethod("delete",null).invoke(source,null);
// delete is a javascript reserved word. Thus I cannot do source.delete()
} else {
throw new Packages.org.apache.cocoon.ProcessingException("Cannot delete 
source " + uri );
}
} finally {
if (source != null)
resolver.release(source);
cocoon.releaseComponent(resolver);
}
}


<map:pipeline type="caching">
<map:match pattern="datos/directorio/lista-personas">
<map:select type="resource-exists">
<map:when test="context://WEB-INF/cache/lista-personas.xml">
<map:generate src="context://WEB-INF/cache/lista-personas.xml" />
<map:serialize />
</map:when>
<map:otherwise>
<map:act type="copy-source" 
src="cocoon:/datos/directorio/consulta-lista-personas">
<map:parameter name="dest" value="
context://WEB-INF/cache/lista-personas.xml"/>
<map:generate src="context://WEB-INF/cache/lista-personas.xml" />
<map:serialize />
</map:act>
</map:otherwise>
</map:select>
</map:match>
</map:pipeline>
<map:pipeline type="noncaching">
<map:match pattern="datos/directorio/consulta-lista-personas">
<map:aggregate element="listas">
<map:part src="cocoon:/datos/directorio/lista-personas-red" />
<map:part src="cocoon:/datos/directorio/lista-personas-rediris" />
</map:aggregate>
<map:serialize />
</map:match>

<!-- This pipeline is called from the cron job -->
<map:match pattern="datos/directorio/regenera-consulta-lista-personas">
<map:call function="regeneraListaPersonas">
<map:parameter name="uri" value="context://WEB-INF/cache/lista-personas.xml" 
/>
</map:call>
</map:match>
</map:pipeline>


Can anyone help me find what is happening?

Thank you very much.

-- 
Antonio

Mime
View raw message