Return-Path:
This tutorial describes how you can run Cocoon in debug mode in Ecli=
pse. Make
--- sure that you have a working Cocoon web application. This tutorial assu=
mes that
--- you have the=C2=A0 Your first Cocoon application=
using Maven
--- 2 and the Reloading classloader tutorial=
s
--- completed.
First, download Jett= y 6 and --- extract it into a directory of choice. You only have to make sure that = it is not --- a subdirectory of an Eclipse project that is added to your Eclispe work= space. ---
+++help you to get one.
=20 ---The instructions of this tutorial were tested with Je= tty 6.0.2. ---
+++This tutorial describes how the Jetty Launcher can be= used to +++ run Cocoon. At the time of writing this, the Jetty Launcher doesn't sup= port +++ Jetty 6. If you insist on using it, find some instructions in the "Usin= g Jetty +++ 6" section.
=20 ---Copy ./etc/jetty.xml to ./etc/cocoon-debug.xml and= make --- following changes:
+++...+++ =20 ---
If you want to be able to debug code that is in one of your librarie= s,=C2=A0 you +++ either have to add the source code to the dependency (if you use Maven = 2 try +++ mvn eclipse:eclipse -DdownloadSources) or if it is available a= s Eclipse +++ project, add it as Project Reference / Java Build Path - +++ Project reference. The second option together with the +++ Reloading Classloader plugin, makes it possi= ble to work +++ in several projects while all changes take effect immediatly.
=20 ---[screenshot: new project]
+++Using the Jetty launcher is much simpler=C2=A0 and yo= u don't have to +++ create a Java project for each Cocoon application that you want to debu= g.
=20 ---[screenshot: set project dependencies]
+++If you insist on using Jetty 6, you can start Jetty as Java applicat= ion from +++ within Eclipse. For this purpose
=20 ---If available, the Maven Eclipse plugin can download t= he sources --- of the libraries your project depends on. For this purpose use the --- -DdownloadSources=3Dtrue property: mvn eclipse:eclipse --- -DdownloadSources=3Dtrue
+++<?xml version=3D"1.0"?> +++ <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//E= N" "http://jetty.mortbay.org/configure.dtd"> +++ <Configure id=3D"Server" class=3D"org.mortbay.jetty.Server"> +++ =C2=A0=C2=A0=C2=A0 <Set name=3D"ThreadPool"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <New class=3D"org.mortbay.thread.Boun= dedThreadPool"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Set name=3D"minThreads"&= gt;2</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Set name=3D"lowThreads"&= gt;2</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Set name=3D"maxThreads"&= gt;10</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </New> +++ =C2=A0=C2=A0=C2=A0 </Set> +++ =C2=A0=C2=A0=C2=A0 <Call name=3D"addConnector"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Arg> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <New class=3D= "org.mortbay.jetty.nio.SelectChannelConnector"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <= Set name=3D"port"><SystemProperty name=3D"jetty.port" default=3D"8080= "/></Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <= Set name=3D"maxIdleTime">30000</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <= Set name=3D"Acceptors">2</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <= Set name=3D"confidentialPort">8443</Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </New> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Arg> +++ =C2=A0=C2=A0=C2=A0 </Call> +++ =C2=A0=C2=A0=C2=A0 <Set name=3D"handler"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <New id=3D"handlers" class=3D"org.mor= tbay.jetty.handler.HandlerCollection"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Set name=3D"handlers">= ; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Array type=3D"org.= mortbay.jetty.Handler"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Item&g= t; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 <New id=3D"contexts" class=3D"org.mortbay.jetty.handler.ContextHandl= erCollection"/> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Item&= gt; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Item&g= t; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 <New id=3D"defaultHandler" class=3D"org.mortbay.jetty.handler.Defaul= tHandler"/> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Item&= gt; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Item&g= t; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0 <New id=3D"requestLog" class=3D"org.mortbay.jetty.handler.RequestLog= Handler"/> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Item&= gt; +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Array> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </Set> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 </New> +++ =C2=A0=C2=A0=C2=A0 </Set>=20 +++ =C2=A0=C2=A0=C2=A0 <New id=3D"cocoon" class=3D"org.mortbay.jetty.web= app.WebAppContext"> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Arg><Ref id=3D"contexts"/>&= lt;/Arg> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Arg>[path to the webapp r= oot directory]</Arg> +++ =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Arg>/</Arg> +++ =C2=A0=C2=A0=C2=A0 </New> =20 ---+++=20 +++Step 6: Start debugging
+++ =C2=A0=C2=A0=C2=A0 <!-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --> +++ =C2=A0=C2=A0=C2=A0 <!-- extra options=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0 --> +++ =C2=A0=C2=A0=C2=A0 <!-- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --> +++ =C2=A0=C2=A0=C2=A0 <Set name=3D"stopAtShutdown">true</Set> +++ =C2=A0=C2=A0=C2=A0 <!-- ensure/prevent Server: header being sent to = browsers=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 --> +++ =C2=A0=C2=A0=C2=A0 <Set name=3D"sendServerVersion">true</Set&g= t; =20 +++ </Configure>