cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Larsen" <gary.lar...@envisn.com>
Subject RE: Enviroment missing in cron class?
Date Thu, 15 Sep 2011 00:06:34 GMT
Hi Alfred,

You were correct that I was not catching that exception. The generator works
ok when run from a browser request but not from the cron job.  I'm wonder if
I need to implement an additional Cocoon interface. Right now it's this:

public class MLDocGenerator extends ServiceableGenerator implements
Configurable, Parameterizable

Thanks for your help,
gary

-----Original Message-----
From: Nathaniel, Alfred [mailto:Alfred.Nathaniel@six-group.com] 
Sent: Wednesday, September 14, 2011 5:50 PM
To: users@cocoon.apache.org
Subject: RE: Enviroment missing in cron class?

Hi Gary,

There are a number of missing links in your mail but I would guess that the
NPE is caused because in MLDocGenerator you have something like

  try {
    ...
    source = resolver.resolveURI(src);
  }
  catch(Exception ex) {
     // ignore
  }
}

public void recycle() {
   resolver.release(source); // source == null here when exception
}

You have to propagate exception out of setup / generate.
Otherwise the container try to recycle and returns it to the component pool.

HTH, Alfred.

From: Gary Larsen [mailto:gary.larsen@envisn.com] 
Sent: Mittwoch, 14. September 2011 21:23
To: users@cocoon.apache.org
Subject: Enviroment missing in cron class?

I'm attempting something new for me in Cocoon 2.1.9 and would appreciate
some advice.  Basically it's a cron class  which not seem to have complete
access to the Cocoon environment.

The class extends ServiceableCronJob and runs this code to execute the
pipeline request:

            resolver = (SourceResolver)
this.manager.lookup(SourceResolver.ROLE);
            resolver.resolveURI(sb.toString());

This returns a result but does not include parts of the aggregation, it just
returns the result of the XSL transformation without data.

              <map:part src="cocoon:/doc/db/{1}/params/{2}"/>
              <map:part src="context:/appdata/data-query/{1}/{2}"/>

When I run the request with a browser the pipeline works ok.  Another
symptom is a couple of exceptions:

org.apache.cocoon.ProcessingException: Unable to remove component from
automatic release: no environment available.
                at
org.apache.cocoon.components.CocoonComponentManager.removeFromAutomaticRelea
se(CocoonComponentManager.java:489)
.

java.lang.NullPointerException
        at
org.apache.cocoon.environment.AbstractEnvironment.release(AbstractEnv
ironment.java:560)
        at
org.apache.cocoon.environment.wrapper.MutableEnvironmentFacade.releas
e(MutableEnvironmentFacade.java:313)
        at
com.envisn.nv.serialize.MLDocGenerator.recycle(MLDocGenerator.java:10
9)

Thanks for any suggestions,

gary

The content of this e-mail is intended only for the confidential use of the
person addressed. 
If you are not the intended recipient, please notify the sender and delete
this e-mail immediately.
Thank you.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message