Dominique Devienne wrote:

-----Original Message-----
From: Upayavira [mailto:[EMAIL PROTECTED]

Dominique Devienne wrote:


Here's something that might work. The code you sketched below, which only
depends on Cocoon classes, could be make part of Cocoon itself in an
existing or new JAR from Cocoon/WEB-INF/lib, as a new main() entry point.

This way, you could then just use the Java task within your own task (do
this all the time in my own custom task), calling that entry point, and
setting the classpath explicitly. Play as well with the attributes to
include or not the system and Ant runtime.




The only problem I can forsee with this is that I'll already have the
configuration of the task read into a DOM object, which I'll want to
pass to the main() method. But I suspect the Java task will only pass
Strings. Am I correct here?



Well, yes. But you can always serialize your DOM tree to disk, and pass the
name of the temp file to the main as an arg. If Java cannot sort the
classloader stuff in non-forking mode, then you can still fork it, and this
time it should work. --DD


Dominique et al,

I think I now have something working. What I did was to get a <java> snippet from Forrest, get that working using the normal <java> task, then to copy Java.java and ExecuteJava.java into my own project and gradually amend them until I had successfully merged them with my existing Task code.

I would like to thank you so much for your help with this project. Your two pointers (DynamicConfigurator and using the Java task as a base) have been what have got me to completion on this.

It is just a matter of tidying up and simplifying the code before I can commit it to the Cocoon codebase.

[I just hope I haven't overlooked something again. Two or three times I thought I'd got classloading working, only to find that the class was already in my path :-( ]

With best wishes,

Upayavira


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



Reply via email to