Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 85334 invoked from network); 23 Sep 2009 07:23:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Sep 2009 07:23:23 -0000 Received: (qmail 52122 invoked by uid 500); 23 Sep 2009 07:23:22 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 52051 invoked by uid 500); 23 Sep 2009 07:23:22 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 52043 invoked by uid 99); 23 Sep 2009 07:23:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 07:23:22 +0000 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.221.202] (HELO mail-qy0-f202.google.com) (209.85.221.202) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 23 Sep 2009 07:23:10 +0000 Received: by qyk40 with SMTP id 40so210530qyk.22 for ; Wed, 23 Sep 2009 00:22:48 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.123.231 with SMTP id q39mr1597505qar.80.1253690568689; Wed, 23 Sep 2009 00:22:48 -0700 (PDT) X-Originating-IP: [87.194.129.225] In-Reply-To: References: <4AAE212C020000D400015961@pta-emo.csir.co.za> <4AAE1F94.4010401@publishingtechnology.com> Date: Wed, 23 Sep 2009 08:22:48 +0100 Message-ID: <45c308810909230022l1b4cb714na4471afc200883f4@mail.gmail.com> Subject: Re: problems with "Getting Started" 2.2 [was: Starting out with Cocoon 2.2] From: Dominic Mitchell To: users@cocoon.apache.org Content-Type: multipart/alternative; boundary=00c09f92312a014b060474399539 X-Virus-Checked: Checked by ClamAV on apache.org --00c09f92312a014b060474399539 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Sep 22, 2009 at 9:58 PM, Steven D. Majewski wro= te: > We've been using Cocoon 2.1.* for some time now, but we haven't really be= en > doing a proper build. > We've been building the sample app, and using that as a development base, > adding new pipelines > and sitemaps, and eventually, removing the samples directory before > deploying. > > I've started to look at 2.2, thinking it made more sense to learn the 2.2 > build process > with Maven that to continue on 2.1, but I'm having so many problems just > getting the > "getting started" to work, that I'm having second thoughts. > Getting a good handle on maven is very useful, and will pay off not just fo= r Cocoon apps, but also for any other Java projects where you need a good build system. I recommend checking out Sonatype's =E2=80=9Cdefinitive guide to maven=E2= =80=9D: http://www.sonatype.com/books/maven-book/reference/ I've gotten as far as "Deploying a Cocoon application" : > > But I had to add a few extra maven steps to get that far. > > > I had to do a 'mvn package' on myBlock1 & myBlock2 to get the jars built= , > so that later do 'mvn install:install-file ... -Dfile=3D... ' to manage > to get 'mvn jetty:run' to work without error. > Perhaps these differences from the documented steps are due to Mac OS 10= .5 > having a newer version of Maven installed: > Instead of "mvn package" you need to do "mvn install". That will tale care of installing everything to your local repository automatically. install:install-file is only needed for 3rd party things that aren't in a repository. In fact, I've just realised that using install:install-file is the root cause of your problems below. I'm guessing that you only installed the jar files, not the pom files. Because of that, maven doesn't know about the dependencies of the block when you try to pull them together in the webapp. Which is why you get the ClassNotFoundException below. > mvn --version > > > Apache Maven 2.2.0 (r788681; 2009-06-26 09:04:01-0400) > Java version: 1.5.0_20 > Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Hom= e > Default locale: en_US, platform encoding: MacRoman > OS name: "mac os x" version: "10.5.8" arch: "i386" Family: "unix" > > > Now, I'm up to trying to join the 2 blocks in a webapp. > After adding the block dependencies to my pom.xml, 'mvn jetty:run' gives > this warning: > > Could not instantiate listener > org.springframework.web.context.ContextLoaderListener > java.lang.ClassNotFoundException: > org.springframework.web.context.ContextLoaderListener > [ ... stack trace ... ] > > > Searching the mailing list archives, I see this error mentioned as a resu= lt > if you > DON'T add block dependencies to an empty webapp, but I have added these > dependencies > to pom.xml ( and I've 'mvn install' -ed myBlock1 & myBlock2 ) > > > > > > edu.virginia.lib > myBlock1 > 1.0-SNAPSHOT > > > edu.virginia.lib > myBlock2 > 1.0-SNAPSHOT > > > > > > > Any idea about what else I'm missing ? > My first question would have been: are the dependencies correct? What happens if you run mvn dependency:tree in the webapp? It should include spring dependencies. If it helps, I completed the tutorials and put them in github. So you can take a look and see what worked for me. http://github.com/happygiraffe/cocoon-sample > Is the cocoon 2.2 documentation all wrong ? > Or are these differences due to changes in maven and it's defaults ? > -Dom --00c09f92312a014b060474399539 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On Tue, Sep 22, 2009 at 9:58 PM, Steven D. Majew= ski <sdm7g@virgi= nia.edu> wrote:
We've been using Cocoon 2.1.* for some time now, but we haven't rea= lly been doing a proper build.
We've been building the sample app, and using that as a development bas= e, adding new pipelines
and sitemaps, and eventually, removing the samples directory before deployi= ng.

I've started to look at 2.2, thinking it made more sense to learn the 2= .2 build process
with Maven that to continue on 2.1, but I'm having so many problems jus= t getting the
"getting started" to work, that I'm having second thoughts.

Getting a good handle on maven is very u= seful, and will pay off not just for Cocoon apps, but also for any other Ja= va projects where you need a good build system.

I recommend checking out Sonatype's =E2=80=9Cdefini= tive guide to maven=E2=80=9D:=C2=A0http://www.sonatype.com/books/maven-book/reference/=

I've gotten as far as "Deplo= ying a Cocoon application" :
=C2=A0 =C2=A0 =C2=A0 =C2=A0<http://cocoon.apache.org/2.2/1362_1_1.html

But I had to add a few extra maven steps to get that far.


=C2=A0I had to do a 'mvn package' on myBlock1 & myBlock2 to ge= t the jars built,
=C2=A0so that later do 'mvn install:install-file ... -Dfile=3D... '= ; =C2=A0to manage
=C2=A0to get 'mvn jetty:run' to work without error.
=C2=A0Perhaps these differences from the documented steps are due to Mac O= S 10.5
=C2=A0having a newer version of Maven installed:
=C2=A0
In fact, I've just realised that using insta= ll:install-file is the root cause of your problems below. =C2=A0I'm gue= ssing that you only installed the jar files, not the pom files. =C2=A0Becau= se of that, maven doesn't know about the dependencies of the block when= you try to pull them together in the webapp. =C2=A0Which is why you get th= e ClassNotFoundException below.
=C2=A0
mvn --version


Apache Maven 2.2.0 (r788681; 2009-06-26 09:04:01-0400)
Java version: 1.5.0_20
Java home: /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home<= br> Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.5.8" arch: "i386&= quot; Family: "unix"


Now, I'm up to trying to join the 2 blocks in a webapp.
After adding the block dependencies to my pom.xml, 'mvn jetty:run' = gives this warning:

Could not instantiate listener org.springframework.web.context.ContextLoade= rListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLo= aderListener
[ ... stack trace ... ]


Searching the mailing list archives, I see this error mentioned as a result= if you
DON'T add block dependencies to an empty webapp, but I have added these= dependencies
to pom.xml ( and I've 'mvn install' -ed =C2=A0myBlock1 & my= Block2 )


=C2=A0<dependencies>

=C2=A0 =C2=A0 =C2=A0 =C2=A0<dependency>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<groupId>edu.= virginia.lib</groupId>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<artifactId>m= yBlock1</artifactId>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<version>1.0-= SNAPSHOT</version>
=C2=A0 =C2=A0 =C2=A0 =C2=A0</dependency>
=C2=A0 =C2=A0 =C2=A0 =C2=A0<dependency>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<groupId>edu.= virginia.lib</groupId>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<artifactId>m= yBlock2</artifactId>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0<version>1.0-= SNAPSHOT</version>
=C2=A0 =C2=A0 =C2=A0 =C2=A0</dependency>

=C2=A0</dependencies>



Any idea about what else I'm missing ?

<= div>My first question would have been: are the dependencies correct? =C2=A0= What happens if you run mvn dependency:tree in the webapp? =C2=A0It should = include spring dependencies.

If it helps, I completed the tutorials and put them in = github. =C2=A0So you can take a look and see what worked for me.
=
=C2=A0
Is the cocoon 2.2 documentation all wrong ?
Or are these differences due to changes in maven and it's defaults ?

-Dom=C2=A0
--00c09f92312a014b060474399539--