I just found of that I casted the ServiceSelector wrong and that it resulted in a ClassCastException that is only logged in debug mode because it is wrapped into something else.

Geoff Howard wrote:

Ivo Limmen wrote:

I just saw that the constructor is called with each request I make, I don't think that is normal behaviour.

Ivo Limmen wrote:

I use Cocoon 2.1.2 on Tomcat 4.1.24. I had build an generator in Cocoon 2.0.3 and wanted to update the code to use the ServiceableGenerator class.
I added logging to each method of my generator but I see nothing. I added System.err outputs and only say that the constructor is called. So I at least know that the classes are found and that Cocoon instantiated my generator.
But setup() service() and dispose() are not called at all...


Is there no error in the error logs? Where do you have your System.err outputs within the methods? I'd guess that an exception is thrown in constructor or early in setup. Also the default log levels have changed in 2.1 - if you are logging at getLogger().debug() level you are probably not configured in logkit.xconf to output that level.

Geoff

Sitemap.log:

ERROR (2003-10-23) 08:44.02:601 [sitemap.handled-errors] (/cocoon/butterfly/dealDetail.xml) Thread-11/PipelineNode: Lookup of generator for role 'dealGen' failed.
org.apache.cocoon.ProcessingException: Lookup of generator for role 'dealGen' failed.: org.apache.avalon.framework.component.ComponentException: generators: ComponentSelector could not find the component for hint [dealGen] (key [dealGen])
at org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setGenerator(AbstractProcessingPipeline.java:254)


at org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setGenerator(AbstractCachingProcessingPipeline.java:158)

at org.apache.cocoon.components.treeprocessor.sitemap.GenerateNode.invoke(GenerateNode.java:92)


Sitemap.xmap:


<map:generators default="dealGen">

      <map:generator logger="sitemap.generator.dealGen"
        name="dealGen" src="nl.virgil.butterfly.DealDetailGenerator"/>

</map:generators>

...

    <map:pipeline>
      <!-- XML output of deal details -->
      <map:match pattern="*">
        <map:act type="request">
          <map:parameter name="parameters" value="true"/>
          <map:generate type="dealGen">
            <parameter name="id" value="{id}"/>
            <parameter name="product" value="{product}"/>
            <parameter name="language" value="{lang}"/>
          </map:generate>
        </map:act>
        <map:serialize type="xml"/>
      </map:match>
    </map:pipeline>


Thanks,






--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


-- Ivo Limmen


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to