Return-Path: X-Original-To: apmail-cocoon-dev-archive@www.apache.org Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A02549168 for ; Tue, 6 Mar 2012 12:28:57 +0000 (UTC) Received: (qmail 81417 invoked by uid 500); 6 Mar 2012 12:28:57 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 81347 invoked by uid 500); 6 Mar 2012 12:28:57 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@cocoon.apache.org List-Id: Delivered-To: mailing list dev@cocoon.apache.org Delivered-To: moderator for dev@cocoon.apache.org Received: (qmail 51497 invoked by uid 99); 6 Mar 2012 11:50:56 -0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jpuerto@gmail.com designates 209.85.216.179 as permitted sender) Received-SPF: pass (google.com: domain of jpuerto@gmail.com designates 10.224.111.10 as permitted sender) client-ip=10.224.111.10; Authentication-Results: mr.google.com; spf=pass (google.com: domain of jpuerto@gmail.com designates 10.224.111.10 as permitted sender) smtp.mail=jpuerto@gmail.com; dkim=pass header.i=jpuerto@gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=vv1BtgdcM9ByO33Rzjf90QDg5G+HX1nOD61t0kCHxQg=; b=chiuSZ5faec11RGf5NNrngiUe4k8WWCEjsnizLAHhPoVAXRxo54FspHl6YiCePyC97 dG3ZYdm9qt+uXawQp92m9eGducxy861nAfU6/LKr/8t6opY0CJICJoah2HNEYVXuK1EM xR3hNy7yEQhgUY0YBDfc7x6Wj2elxEusHbiaSF882WwipP9t+7CF3A3ByK9mv2Khgupm PdtL5aseBSWcTkaPftAcF+W6P1bvHcf4IHlgRnGKn9VJeFsvACb2HLG1WSenjS8uuNDn QxgVJcGfNx6AIF5Cd/tO+fASM9vI75tAc1e3FsshdrnXDO2VMdUmaVJoY3lUgaSCg2uG N6VA== MIME-Version: 1.0 In-Reply-To: <4F55E148.8020209@apache.org> References: <4F55E148.8020209@apache.org> Date: Tue, 6 Mar 2012 12:50:27 +0100 Message-ID: Subject: Re: Starting cocoon application directly from eclipse From: Javier Puerto To: dev@cocoon.apache.org Content-Type: multipart/alternative; boundary=20cf3074b5e02d01ea04ba91a612 X-Virus-Checked: Checked by ClamAV on apache.org --20cf3074b5e02d01ea04ba91a612 Content-Type: text/plain; charset=ISO-8859-1 Hi Leszek 2012/3/6 Leszek Gawron > Hi, > > We have been developing and running cocoon applications using 'mvn > jetty:run'. We would like to stop that and run the project directly under > eclipse. > Did you tested to run the application directly with maven plugin and goal jetty:run? We are working with a similar case and we use this approach. > > In normal circumstances all you do is create a jetty-server dependency and > run a simple class: > > public class Loader { >> public static void main( String[] args ) throws Exception { >> ToStringBuilder.**setDefaultStyle( >> ToStringStyle.SHORT_PREFIX_**STYLE ); >> >> System.setProperty( "org.apache.cocoon.mode", >> "dev" ); >> >> Server server = new Server(); >> SocketConnector socketConnector = new SocketConnector(); >> socketConnector.setPort( 80 ); >> server.setConnectors( new Connector[]{ socketConnector } ); >> >> WebAppContext context = new WebAppContext( >> "src/main/webapp", "/" ); >> context.setClassLoader( Thread.currentThread().**getContextClassLoader() >> ); >> >> server.setHandler( context ); >> server.setStopAtShutdown( true ); >> server.start(); >> >> server.join(); >> } >> } >> > > This web application uses two blocks. It seems that application starts > correctly under eclipse under one very painful condition: the blocks have > to be jars that cocoon block deployer will unpack. > > The thing is: if you have: block1, block2, webapp as eclipse projects > (maven enabled of course) there are two scenarios that dependencies are > built: > > a) block1, block2: closed projects > > the projects need to be prebuilt and available in maven repository > webapp uses block1.jar and block2.jar dependency > cocoon application starts just fine. > > b) block1, block2: opened eclipse projects > > webapp uses block1, block2 exported classpaths directly. No > dependency on jar. Cocoon block deployer is unable to properly > initialize the application: > > > I assume the problem comes from the fact that cocoon block deployer > unpacks jar dependencies looking for COB-INF folders. > > Is there any way I can point cocoon block deployer to COB-INF folder > directly on filesystem and run eclipse with all project open all the time? > > > lg > --20cf3074b5e02d01ea04ba91a612 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi Leszek

2012/3/6 Leszek Gawron <lgawron@apache.org&= gt;
Hi,

We have been developing and running cocoon applications using 'mvn jett= y:run'. We would like to stop that and run the project directly under e= clipse.

Did you tested to run the application dire= ctly with maven plugin and goal jetty:run? We are working with a similar ca= se and we use this approach.
=A0

In normal circumstances all you do is create a jetty-server dependency and = run a simple class:

public class Loader {
=A0 =A0 =A0 =A0public static void main( String[] args ) throws Exception {=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0ToStringBuilder.setDefaultStyle( ToS= tringStyle.SHORT_PREFIX_STYLE );

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0System.setProperty( "org.apache.cocoon= .mode",
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"dev" );

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Server server =3D new Server();
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0SocketConnector socketConnector =3D new Soc= ketConnector();
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0socketConnector.setPort( 80 );
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0server.setConnectors( new Connector[]{ sock= etConnector } );

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0WebAppContext context =3D new WebAppContext= ( "src/main/webapp", "/" );
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0context.setClassLoader( Thread.currentThrea= d().getContextClassLoader() );

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0server.setHandler( context );
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0server.setStopAtShutdown( true );
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0server.start();

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0server.join();
=A0 =A0 =A0 =A0}
}

This web application uses two blocks. It seems that application starts corr= ectly under eclipse under one very painful condition: the blocks have to be= jars that cocoon block deployer will unpack.

The thing is: if you have: block1, block2, webapp as eclipse projects (mave= n enabled of course) there are two scenarios that dependencies are built:
=A0a) block1, block2: closed projects

=A0 =A0 the projects need to be prebuilt and available in maven repository=
=A0 =A0 webapp uses block1.jar and block2.jar dependency
=A0 =A0 cocoon application starts just fine.

=A0b) block1, block2: opened eclipse projects

=A0 =A0 webapp uses block1, block2 exported classpaths directly. No
=A0 =A0 dependency on jar. Cocoon block deployer is unable to properly
=A0 =A0 initialize the application:


I assume the problem comes from the fact that cocoon block deployer unpacks= jar dependencies looking for COB-INF folders.

Is there any way I can point cocoon block deployer to COB-INF folder direct= ly on filesystem and run eclipse with all project open all the time?


=A0lg

--20cf3074b5e02d01ea04ba91a612--