Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 36267 invoked from network); 17 Nov 2009 16:39:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 17 Nov 2009 16:39:31 -0000 Received: (qmail 65491 invoked by uid 500); 17 Nov 2009 16:39:30 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 65427 invoked by uid 500); 17 Nov 2009 16:39:30 -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 65419 invoked by uid 99); 17 Nov 2009 16:39:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 16:39:30 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [194.116.174.135] (HELO pchl.co.uk) (194.116.174.135) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Nov 2009 16:39:26 +0000 Received: (qmail 11636 invoked from network); 17 Nov 2009 16:39:09 +0000 Received: from 89-168-118-233.dynamic.dsl.as9105.com (HELO Wittgenstein) (89.168.118.233) by pchl.co.uk with SMTP; 17 Nov 2009 16:39:09 +0000 From: "Robin Rigby" To: References: <1257664863.4079.6.camel@joske-laptop> <4AF96F37.9080503@apache.org> <1257862314.4144.17.camel@joske-laptop> <4AFA6BFD.6090302@apache.org> <1257927109.4350.3.camel@joske-laptop> <4AFA78E5.5090506@apache.org> <1257932409.2745.1.camel@joske-laptop> <4AFB31EE.9040201@apache.org> <1258465522.2617.7.camel@joske-laptop> <4B02B568.8040702@apache.org> Subject: Tutorial and Tomcat deployment Date: Tue, 17 Nov 2009 16:38:23 -0000 Message-ID: <7076AD018B6B4D17950D560116D00851@Wittgenstein> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: Acpnk76np7mwg0RpR5CSlq73BqFPZQADp++g In-Reply-To: <4B02B568.8040702@apache.org> Suffering great frustration deploying Cocoon 2.2 to Tomcat. Reverted to the tutorial to check the basics. Hope following notes will help someone else avoid pain. Robin - SUMMARY ------------------- A. Tutorial page 1. Welcome page has a link to spring bean which fails if called from http://localhost:8888/myBlock1 but succeeds when called from http://localhost:8888/myBlock1/ Link is not properly fixed up. See #2 below. B. Tutorial page 4. Parent POM fails to compile myCocoonWebapp. Cannot find correct version of maven-war-plugin. Solutions found on mailing list do not work. See #5 below. C. is not sufficient to mount the web app as ROOT in Tomcat. The war file must be ROOT.war (or the app must be deployed with a context fragment from elsewhere in the file system). See #7 below. D. ROOT is not sufficient to mount the web app as ROOT in Jetty. Change . See #9 below. E. Tomcat does not unpack ROOT.war if there is a context fragment ROOT.xml. Check and remove the conflicting file. See #10 below. F. ROOT is not sufficient to deploy the web app as ROOT in Tomcat with tomcat-maven-plugin. Add context path. See #12 below. - START ---------------------- 1. Create new tutorial blocks {...}/myBlock1 {...}/myBlock2 from http://cocoon.apache.org/2.2/1159_1_1.html http://cocoon.apache.org/2.2/1290_1_1.html http://cocoon.apache.org/2.2/1291_1_1.html 2. Run under Jetty + rcl cd {...}/myBlock1 mvn compile jetty:run browse to http://localhost:8888/myBlock1/ works fine <--- OK But note that http://localhost:8888/myBlock1 works OK (without trailing slash) but then the link to the Spring bean fails http://localhost:8888/spring-bean <--- FAIL instead of http://localhost:8888/myBlock1/spring-bean This is not good on page one of the tutorial. 3. Add webapp block and parent POM {...}/myCocoonWebApp {...}/pom.xml from http://cocoon.apache.org/2.2/1362_1_1.html 4. Run under Jetty + war file cd {...}/myBlock1 mvn install cd {...}/myBlock2 mvn install cd {...}/myCocoonWebApp mvn package jetty:run browse to http://localhost:8888/ works fine <--- OK 5. Reactor build from parent POM cd {...} mvn install Build fails with <-- FAIL Internal error in the plugin manager executing goal 'org.apache.maven.plugins:maven-war-plugin:2.0.2:war': Unable to find the mojo 'org.apache.maven.plugins:maven-war-plugin:2.0.2:war' in the plugin 'org.apache.maven.plugins:maven-war-plugin' Component descriptor cannot be found in the component repository: org.apache.maven.plugin.Mojoorg.apache.maven.plugins:maven-war-plugin:2.0.2: war. This has been an unsolved problem since I first tested Cocoon 2.2. There are two issues here: i. The tutorial fails [on my machine] despite the standardisation offered by Maven. ii. The requested plugin is not found in the (any?) repository. 6. There two solutions at http://issues.apache.org/jira/browse/COCOON-2240 Neither one works. The second solution changes the version number in the above message from 2.0.2 to 2.1-beta-1. 7. Work around. Go back to 4 above and copy myCocoonWebApp-1.0.0.war to {tomcat 5.5.20}/webapps. Browse to http://localhost:8080/ <-- FAIL Get error 404 from Tomcat. But browse to http://localhost:8080/myCocoonWebApp-1.0.0/ and it finds the page. Tomcat ignores the servlet:context/@mount-path="" attribute in block-servlet-service.xml 8. Rename the WAR file ROOT.xml by setting ROOT in the POM for myCocoonWebApp. See http://mojo.codehaus.org/tomcat-maven-plugin/usage.html 9. Test with cd {...}/myCocoonWebApp mvn clean install jetty:run This fails with <-- FAIL Webapp source directory {...}\myCocoonWebApp\target\myCocoonWebApp-1.0.0 does not exist Maven has built a ROOT directory and ROOT.war but installed myCocoonWebApp-1.0.0.war in the repository (which could be OK). Jetty has not recognized the . Fix this by changing maven-jetty-plugin in {...}/myCocoonWebApp/pom.xml under org.mortbay.jetty maven-jetty-plugin 6.1.7 change ${project.build.directory}/${pom.artifactId}-${pom.ve rsion} to ${project.build.directory}/ROOT Browse to http://localhost:8080/ <-- OK 10. Test by copying ROOT.war to {tomcat 5.5.20}/webapps. Browse to http://localhost:8080/ <-- FAIL and Tomcat has not unpacked ROOT.war, though it unpacked the other (see #7, above). Restart Tomcat. No mention of ROOT.war in {tomcat 5.5.20}/logs. Check {tomcat 5.5.20}/conf/{engineName}/{hostName} for ROOT.xml. Remove it. Tomcat unpacks ROOT.war. Browse to http://localhost:8080/ <-- SUCCESS 11. OK, now remove ROOT.war and ROOT subdirectory from {tomcat 5.5.20}/webapps. Log in to the Tomcat manager http://localhost:8080/manager/html Deploy {...}\myCocoonWebApp\target\ROOT.war Browse to http://localhost:8080/ <-- OK 12. Again, remove ROOT.war and ROOT subdirectory from {tomcat 5.5.20}/webapps. Add in {...}/myCocoonWebApp/pom.xml under a new plugin org.codehaus.mojo tomcat-maven-plugin 1.0-beta-1 http://localhost:8080/manager tomcat-local Set up the server tomcat-local in your Maven settings file {userHome}/.m2/settings.xml under a new server tomcat-local uname pwd All as given at http://mojo.codehaus.org/tomcat-maven-plugin/usage.html Deploy with cd {...}/myCocoonWebApp mvn tomcat:deploy Browse to http://localhost:8080/ <-- FAIL The plugin has ignored . Maven has again built a ROOT directory and ROOT.war but installed myCocoonWebApp.war which works fine but is not required. Browse to http://localhost:8080/myCocoonWebApp/ <-- OK but not useful Add the context path tomcat-local uname pwd /ROOT Redeploy with mvn tomcat:redeploy Browse to http://localhost:8080/ <-- QED - END ----------- --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org For additional commands, e-mail: users-help@cocoon.apache.org