You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Pier Fumagalli <pi...@betaversion.org> on 2003/01/20 02:14:54 UTC

[Proposal] Complete Cocoon 2.1 distribution...

Folks,
    I've been playing around lately with Jetty and Cocoon, and came out with
the idea of possibly distributing the two together...

Basically what I did is a some sort of "minimal" server distribution
including Jetty as a container, and Cocoon as the only configured servlet.

The "cute" thing about this is that I was able to completely remove the
"web-inf" directory, and the "web.xml" file, having basically Cocoon
"hardwired" straight into the HTTP stack.

I believe that in some cases (where the Cocoon WAR is the only
web-application on a server) this might be somehow advantageous, and Jetty
is somehow faster than Tomcat...

There is only a very minimal patch that need to be applied to the
CocoonServlet to make it work, the ability to find logkit.xconf and
cocoon.xconf straight from a file in addition to the use of the servlet
context "getResource()" method...

All the rest works pretty much as is...

Is anyone else interested in this???

    Pier


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 20/1/03 2:33 am, "Carlos Araya" <ca...@cvc.edu> wrote:

> If it means that i can run Cocoon right out of the box without Tomcat, count
> me in

Err... All you gotta do is:

# tar -zvf cocoon-server-2.1-alpha1.tar.gz
# cd ./cocoon
# ./bin/server

And hit your server on port 8080...

The only thing I haven't quite figured out is how to make it do a "clean"
shutdown (as on most platform killing the JVM process will result in the
bailout of the entire JVM without any shutdown handler called), but...

    Pier


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Carlos Araya <ca...@cvc.edu>.
If it means that i can run Cocoon right out of the box without Tomcat, count
me in

Carlos

----- Original Message -----
From: "Pier Fumagalli" <pi...@betaversion.org>
To: <co...@xml.apache.org>
Sent: Sunday, January 19, 2003 17:14
Subject: [Proposal] Complete Cocoon 2.1 distribution...


> Folks,
>     I've been playing around lately with Jetty and Cocoon, and came out
with
> the idea of possibly distributing the two together...
>
> Basically what I did is a some sort of "minimal" server distribution
> including Jetty as a container, and Cocoon as the only configured servlet.
>
> The "cute" thing about this is that I was able to completely remove the
> "web-inf" directory, and the "web.xml" file, having basically Cocoon
> "hardwired" straight into the HTTP stack.
>
> I believe that in some cases (where the Cocoon WAR is the only
> web-application on a server) this might be somehow advantageous, and Jetty
> is somehow faster than Tomcat...
>
> There is only a very minimal patch that need to be applied to the
> CocoonServlet to make it work, the ability to find logkit.xconf and
> cocoon.xconf straight from a file in addition to the use of the servlet
> context "getResource()" method...
>
> All the rest works pretty much as is...
>
> Is anyone else interested in this???
>
>     Pier
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
>
>


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Wow!

Antonio Gallardo

Sylvain Wallez dijo:
> Niclas Hedhman wrote:
>
>>On Monday 20 January 2003 15:22, Jeff Turner wrote:
>>
>>
>>>On Mon, Jan 20, 2003 at 02:48:28PM +0800, Niclas Hedhman wrote:
>>>
>>>
>>>>Definately a "plus" from me. Tomcat is nice, but often a bit "heavy"
>>>> on resources (and last time I checked Jetty was much less so).
>>>>
>>>>
>>>Tomcat attained perfection at version 3.3.1 :)  The more I use it for
>>> Cocoon development, the more I like it.  Fast startup and shutdown,
>>> faultless context reloading..
>>>
>>>
>>
>>I agree on general terms, but feel free to squeeze Tomcat into less
>> memory  fortunate systems. How does 32MB sounds like? Shared with OS
>> and other Java  apps? ;o)
>>
>>
>
> Look at
> http://outerthought.net/gettogether/06%20-%20presentation%20-%20sylvain.pdf
>
> Cocoon + servlet engine + Saxon = around 1 Mbytes, running on
> PersonalJava / 32Mb / 50MHz PowerPC !
>
> Sylvain
>
> --
> Sylvain Wallez                                  Anyware Technologies
> http://www.apache.org/~sylvain           http://www.anyware-tech.com {
> XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }
>
>
>
> --------------------------------------------------------------------- To
> unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org




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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Sylvain Wallez <sy...@anyware-tech.com>.
Niclas Hedhman wrote:

>On Monday 20 January 2003 15:22, Jeff Turner wrote:
>  
>
>>On Mon, Jan 20, 2003 at 02:48:28PM +0800, Niclas Hedhman wrote:
>>    
>>
>>>Definately a "plus" from me. Tomcat is nice, but often a bit "heavy" on
>>>resources (and last time I checked Jetty was much less so).
>>>      
>>>
>>Tomcat attained perfection at version 3.3.1 :)  The more I use it for
>>Cocoon development, the more I like it.  Fast startup and shutdown,
>>faultless context reloading..
>>    
>>
>
>I agree on general terms, but feel free to squeeze Tomcat into less memory 
>fortunate systems. How does 32MB sounds like? Shared with OS and other Java 
>apps? ;o)
>  
>

Look at 
http://outerthought.net/gettogether/06%20-%20presentation%20-%20sylvain.pdf

Cocoon + servlet engine + Saxon = around 1 Mbytes, running on 
PersonalJava / 32Mb / 50MHz PowerPC !

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Monday 20 January 2003 15:22, Jeff Turner wrote:
> On Mon, Jan 20, 2003 at 02:48:28PM +0800, Niclas Hedhman wrote:
> > Definately a "plus" from me. Tomcat is nice, but often a bit "heavy" on
> > resources (and last time I checked Jetty was much less so).
>
> Tomcat attained perfection at version 3.3.1 :)  The more I use it for
> Cocoon development, the more I like it.  Fast startup and shutdown,
> faultless context reloading..

I agree on general terms, but feel free to squeeze Tomcat into less memory 
fortunate systems. How does 32MB sounds like? Shared with OS and other Java 
apps? ;o)

Niclas


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Jeff Turner <je...@apache.org>.
On Mon, Jan 20, 2003 at 02:48:28PM +0800, Niclas Hedhman wrote:
> 
> Definately a "plus" from me. Tomcat is nice, but often a bit "heavy" on 
> resources (and last time I checked Jetty was much less so).

Tomcat attained perfection at version 3.3.1 :)  The more I use it for
Cocoon development, the more I like it.  Fast startup and shutdown,
faultless context reloading..

--Jeff

...
> 
> Niclas

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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Niclas Hedhman <ni...@hedhman.org>.
Definately a "plus" from me. Tomcat is nice, but often a bit "heavy" on 
resources (and last time I checked Jetty was much less so).

Did you manage to hardwire Cocoon to the "root" level in Jetty? That would 
also be a nice "extra".

Niclas

On Monday 20 January 2003 09:14, Pier Fumagalli wrote:
> Folks,
>     I've been playing around lately with Jetty and Cocoon, and came out
> with the idea of possibly distributing the two together...
>
> Basically what I did is a some sort of "minimal" server distribution
> including Jetty as a container, and Cocoon as the only configured servlet.
>
> The "cute" thing about this is that I was able to completely remove the
> "web-inf" directory, and the "web.xml" file, having basically Cocoon
> "hardwired" straight into the HTTP stack.
>
> I believe that in some cases (where the Cocoon WAR is the only
> web-application on a server) this might be somehow advantageous, and Jetty
> is somehow faster than Tomcat...
>
> There is only a very minimal patch that need to be applied to the
> CocoonServlet to make it work, the ability to find logkit.xconf and
> cocoon.xconf straight from a file in addition to the use of the servlet
> context "getResource()" method...
>
> All the rest works pretty much as is...
>
> Is anyone else interested in this???
>
>     Pier
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 20/1/03 1:21 am, "Andrew Savory" <an...@luminas.co.uk> wrote:

> On Mon, 20 Jan 2003, Pier Fumagalli wrote:
> 
>> I believe that in some cases (where the Cocoon WAR is the only
>> web-application on a server) this might be somehow advantageous, and Jetty
>> is somehow faster than Tomcat...
> 
> And more stable, AIUI.

What I really like about Jetty is this:

$ ls -l server/jetty.jar
-rw-r--r--  1 pier  admin  530692 Jan 16 02:25 server/jetty.jar
$

You got _everything_ you need in 530 kb...

>> Is anyone else interested in this???
> 
> Yes, definitely. I'd also be interested in any config modifications you
> made to Jetty in order to get Cocoon to run happily within it (eg for
> getting headless X running to make Batik happy)...

Sorry, mate... Still haven't got _that_ far... I've been doing it all on
MacOS/X (so I don't have problems with headless machines), but the next step
will have to be on Solaris/8...

    Pier


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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Andrew Savory <an...@luminas.co.uk>.
On Mon, 20 Jan 2003, Pier Fumagalli wrote:

> I believe that in some cases (where the Cocoon WAR is the only
> web-application on a server) this might be somehow advantageous, and Jetty
> is somehow faster than Tomcat...

And more stable, AIUI.

> Is anyone else interested in this???

Yes, definitely. I'd also be interested in any config modifications you
made to Jetty in order to get Cocoon to run happily within it (eg for
getting headless X running to make Batik happy)...


Andrew.

-- 
Andrew Savory                                Email: andrew@luminas.co.uk
Managing Director                              Tel:  +44 (0)870 741 6658
Luminas Internet Applications                  Fax:  +44 (0)700 598 1135
This is not an official statement or order.    Web:    www.luminas.co.uk

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


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Pier Fumagalli <pi...@betaversion.org>.
On 20/1/03 6:47 am, "Nicola Ken Barozzi" <ni...@apache.org> wrote:
> Pier Fumagalli wrote:
>> Folks,
>>     I've been playing around lately with Jetty and Cocoon, and came out with
>> the idea of possibly distributing the two together...
> 
> Jetty is already in Cocoon CVS for some time now.
> Do "build run" to have jetty start up and serve on port 8888.

Beautiful. I'll dig out what version and stuff are there. I tested my stuff
against the latest "stable" (4.2.5???) and actually Greg had to patch a
little thing to make it work (so, right now it only works with Jetty "HEAD"
plus a small patch (attached)...

> Anyway, send in the patch, I'm interested to see it.

To Cocoon there is only one patch (to allow the CocoonServlet to load
configuration files outside of its servlet context) and that is attached.

There is also a different "jetty.xml" configuration file, which basically
encapsulates both the "server.xml" and "web.xml" for Tomcat. It would be
great if the CocoonServlet init parameters were moved off into the
"cocoon.xconf" file (leaving only the locations of cocoon.xconf and
logkit.xconf in there), but that means being _very_ picky on my side! :-)

I attached my "jetty.xml" file, check it out, I can't guarantee it works as
I've tested it only on my laptop and it might just depend on something I've
installed here (as well as the "server" shell script to make it start up).

> Just one question: what makes it better not to use web.xml with Jetty?
> Cocoon unfortunatley uses some config data from there still, and some
> features if that is not used are not available ATM.

Well, what I like are "clean and minimal" distributions. If you use the "web
inf" approach, some of your config files will end up in two different
directories: the "server" configuration files (server.xml, jetty.xml...) are
in a directory only used by the servlet container. While cocoon.xconf and
logkit.xconf are in "webapps/cocoon/WEB-INF"...

Why? Isn't it just easier to put everything in one place and tell users, "go
there, and edit the default values" ???

This is the "layout" I was able to get it to:

./bin
    this contains the "server" shell script to launch the whole thing

./classes
    exactly the same as "WEB-INF/classes", if you need one...

./etc
    ALL configuration files: jetty.xml, cocoon.xconf and logkit.xconf

./lib
    exactly the same as "WEB-INF/lib", and yes, you need it! :-)
    (note as Jetty relies on an XML parser to read its configuration
    files, the xml-*.jar are not here

./logs
    all log files, used both by Jetty and by Cocoon

./root
    all that stuff that usually ends up in your "webapps/cocoon" directory
    on Tomcat but without a "WEB-INF" subdirectory...
    
./server
    the Jetty jars and XML jars (basically this is what goes into the system
    class loader).

./work
./work/cocoon
./work/cache-dir
./work/upload-dir
./work/jetty
    the different "work" directories used (both) by jetty and cocoon

IMVHO such a layout is much more "clean" and "simple" than finding different
stuff into different places.

It also helps from a security point of view: if someone wants to be "tight"
the only places where the user owning the JVM process needs to write to are
./logs and ./work, nothing else, while with the "web-inf" approach, you have
to grant permissions to write in the "work" directory and in some of the
"WEB-INF" subdirectories.

There are just few dirs that I still wasn't able to move away from WEB-INF
(the db, deli and entities directories), but it's just a matter of time to
move them under ./work and ./etc respectively.

    Pier


Re: [Proposal] Complete Cocoon 2.1 distribution...

Posted by Nicola Ken Barozzi <ni...@apache.org>.

Pier Fumagalli wrote:
> Folks,
>     I've been playing around lately with Jetty and Cocoon, and came out with
> the idea of possibly distributing the two together...

Jetty is already in Cocoon CVS for some time now.
Do "build run" to have jetty start up and serve on port 8888.

Anyway, send in the patch, I'm interested to see it.
Just one question: what makes it better not to use web.xml with Jetty? 
Cocoon unfortunatley uses some config data from there still, and some 
features if that is not used are not available ATM.

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


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