Upayavira, thank you very much! :-)

In Cocoon 2.1.1 there's org.apache.cocoon.ANT.CocoonTask, I have it running and it 
does NOT break if precompile-only is true. But 
still my pipeline is executed, so the flag seems to be completely ignored 
(if I understood its meaning correctly).

In Cocoon 2.1.3 there's org.apache.cocoon.CocoonTask, but it always fails for me, 
saying "Could not find a classpath that 
points to the Cocoon classes"
In Cocoon 2.1.3  there's also org.apache.cocoon.ANT.CocoonTask which does also fail 
for me, saying:

 org.apache.cocoon.ProcessingException: Lookup of serializer for role 
'xml' failed.: org.apache.avalon.framework.component.ComponentException: 
serializers: ComponentSelector could not access the Component for hint 
[xml] (key [xml])
     at 
org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setSerializer(AbstractProcessingPipeline.java:321)
    [.. ]
Caused by: org.apache.avalon.framework.context.ContextException: Unable to 
resolve context key: default-encoding
    at 
org.apache.avalon.framework.context.DefaultContext.get(DefaultContext.java:157)
    at 
org.apache.avalon.framework.context.DefaultContext.get(DefaultContext.java:160)
    at 
org.apache.avalon.framework.context.DefaultContext.get(DefaultContext.java:160)
    at 
org.apache.cocoon.components.ComponentContext.get(ComponentContext.java:135)
    at 
org.apache.cocoon.serialization.AbstractTextSerializer.contextualize(AbstractTextSerializer.java:203)
    at 
org.apache.avalon.framework.container.ContainerUtil.contextualize(ContainerUtil.java:154)
    at 
org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:278)
    at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.newPoolable(ResourceLimitingPool.java:672)
    at 
org.apache.avalon.excalibur.pool.ResourceLimitingPool.get(ResourceLimitingPool.java:402)
    at 
org.apache.avalon.excalibur.component.PoolableComponentHandler.doGet(PoolableComponentHandler.java:233)
    at 
org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:410)
    at 
org.apache.avalon.excalibur.component.ExcaliburComponentSelector.select(ExcaliburComponentSelector.java:246)

Besides of that, setting <cocoon logLevel="WARN".../> does not prevent him 
for doing DEBUG outputs, maybe I should hand over a logkit.xconf...

I could go with the 2.1.1 version, 

-> providing a temporary sitemap which lets direct calls to my XSPs pass 
through
    (not containing any actions etc. because of missing context problems)
-> having a simple matcher, containing only a serverpages generator (so 
that my XSP are actually compiled)
    and a XML-Serializer (because it's mandatory)
-> have <map:handle-errors> swallow my pipeline- / XSP- execution errors, 
so they don't show up at the console
-> ignore resp. delete the dest directory containing all the *.xsp.xml 
files with the errors in it

and on top
-> let CocoonTask compile the classes directly into tomcat's work 
directory
-> thus no more need to deploy XSP files
-> and thus no more ugly runtime spotting of XSP compilation errors
  (an enormous time saver if you consider the lack of tool support for XSP 
editing)

To do this for all my XSPs, I'd have to write (autogenerate) an URI-file 
based on my directory structure which is then processed by the 
Cocoon-Task.
Phew, seems like a long way to go and I wonder if I really have a faster 
development roundtrip afterwards...

It would be much greater, if CocoonTask would work without having a 
sitemap at all, just taking a bunch (ANT- fileset) of xsp files and 
compiling them... :-)

Any further ideas/comments? Jonas




Precompilation of XSPs was fixed by Carsten shortly before 2.1.3 was 
released. I'd therefore suggest you consider upgrading.

If you're running from an Ant build process, you'll find a new, as yet 
largely untested Ant task in 2.1.3 too at org.apache.cocoon.CocoonTask. 
It'll do everything the CLI can do, except that you can embed the 
configuration (cli.xconf) into your Ant script rather than having to 
refer to another file. If you want to try it, let me know and I'll send 
you a sample build file. I'd be very pleased if you tried it, as I'm 
curious to see if other people can get it to work.

With best wishes,

Upayavira


[EMAIL PROTECTED] wrote:

>Hi all,
>
>has anybody managed to precompile XSP-files during the ANT build-process?
>I'm able to execute a pipeline using cocoon 2.1.1 command line interface:
>If I set precompile-only="false" in my custom cli.xconf, cocoon then 
>generates *_xsp.java and *_xsp.class files into its work directory. Fine, 

>but my pipeline is also executed, which I DO NOT want!
>
>If I specify precompile-only="true", no xsp file gets precompiled, 
instead 
>cocoon produces the following error:
>
>java.lang.NullPointerException
>    at 
>org.apache.cocoon.environment.AbstractEnvironment.initComponents(AbstractEnvironment.java:532)
>    at 
>org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:511)
>    at 
>org.apache.cocoon.environment.AbstractEnvironment.resolveURI(AbstractEnvironment.java:500)
>    at org.apache.cocoon.Cocoon.precompile(Cocoon.java:735)
>    at org.apache.cocoon.bean.CocoonBean.processXSP(CocoonBean.java:930)
>    at org.apache.cocoon.bean.CocoonBean.process(CocoonBean.java:636)
>    at org.apache.cocoon.Main.main(Main.java:375)
>
>This happens, because no CocoonComponentManager is instantiated, the call
>
>this.manager = CocoonComponentManager.getSitemapComponentManager();
>
>in line 531 obviously returns null, which leads to the above NPE when 
>looking up the component org.apache.excalibur.source.SourceResolver.
>
>Seems like a bug to me, can anyone provide further details?
>
>Thanks a lot,
>Jonas
>
>
>----------------------------------------------------------------------------------------------------
>This electronic message contains information from the mmo2 plc Group 
which 
>may be
>privileged or confidential. The information is intended to be for the use 

>of the
>individual(s) or entity named above. If you are not the intended 
recipient 
>be aware
>that any disclosure, copying, distribution or use of the contents of this 

>information
>is prohibited. If you have received this electronic message in error, 
>please notify
>us by telephone or email (to the numbers or address above) immediately.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
> 
>



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




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

Reply via email to