You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by th...@apache.org on 2012/09/07 11:31:00 UTC

svn commit: r1381952 - in /cocoon/trunk/tools: ./ archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/ archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/ archetypes/cocoon-22-archetype-webapp/src/main/...

Author: thorsten
Date: Fri Sep  7 09:30:59 2012
New Revision: 1381952

URL: http://svn.apache.org/viewvc?rev=1381952&view=rev
Log:
COCOON-2233
Fixing and upgrading versions of artifact versions
BlockDeploymentServletContextListener to web.xml in the webapp archetype as required in trunk.
due to the fact the patch from Mark Lundquist is 4 years old in our issue tracker I did not apply it but rather re-did it.

Anyway thanks Mark Lundquist and sorry that we did not apply your patch earlier.

Modified:
    cocoon/trunk/tools/   (props changed)
    cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml
    cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/pom.xml
    cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml

Propchange: cocoon/trunk/tools/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Fri Sep  7 09:30:59 2012
@@ -1,4 +1,5 @@
-anttasks
-loader
-*.iml
+.classpath
+.project
+.settings
 target
+build

Modified: cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml?rev=1381952&r1=1381951&r2=1381952&view=diff
==============================================================================
--- cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml (original)
+++ cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml Fri Sep  7 09:30:59 2012
@@ -32,22 +32,22 @@
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-core</artifactId>
-      <version>2.2.0</version>
+      <version>2.2.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-servlet-service-components</artifactId>
-      <version>1.0.0</version>
+      <version>1.1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-template-impl</artifactId>
-      <version>1.1.0</version>
+      <version>1.2.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-flowscript-impl</artifactId>
-      <version>1.0.0</version>
+      <version>1.1.0-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>javax.servlet</groupId>
@@ -62,7 +62,7 @@
       <plugin>
         <groupId>org.apache.cocoon</groupId>
         <artifactId>cocoon-maven-plugin</artifactId>
-        <version>1.0.0-M2</version>
+        <version>1.0.2</version>
         <executions>
           <execution>
             <id>prepare</id>
@@ -76,7 +76,7 @@
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>maven-jetty-plugin</artifactId>
-        <version>6.1.7</version>
+        <version>6.1.25</version>
         <configuration>
           <connectors>
             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
@@ -96,7 +96,7 @@
       </plugin>
       <plugin>
         <artifactId>maven-jar-plugin</artifactId>
-        <version>2.1</version>
+        <version>2.4</version>
         <configuration>
           <archive>
             <manifestEntries>
@@ -107,7 +107,7 @@
       </plugin>
       <plugin>
         <artifactId>maven-eclipse-plugin</artifactId>
-        <version>2.5</version>
+        <version>2.9</version>
       </plugin>
     </plugins>
   </build>

Modified: cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/pom.xml?rev=1381952&r1=1381951&r2=1381952&view=diff
==============================================================================
--- cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/pom.xml (original)
+++ cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/pom.xml Fri Sep  7 09:30:59 2012
@@ -33,7 +33,7 @@
       <plugin>
         <groupId>org.mortbay.jetty</groupId>
         <artifactId>maven-jetty-plugin</artifactId>
-        <version>6.1.7</version>
+        <version>6.1.25</version>
         <configuration>
           <connectors>
             <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">

Modified: cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml?rev=1381952&r1=1381951&r2=1381952&view=diff
==============================================================================
--- cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml (original)
+++ cocoon/trunk/tools/archetypes/cocoon-22-archetype-webapp/src/main/resources/archetype-resources/src/main/webapp/WEB-INF/web.xml Fri Sep  7 09:30:59 2012
@@ -71,7 +71,12 @@
     -->
 
   <!-- Servlet Context Listener ======================================= -->
-
+  
+  <listener>
+    <description>Declare a context listener that installs all blocks.</description>
+    <listener-class>org.apache.cocoon.blockdeployment.BlockDeploymentServletContextListener</listener-class>
+  </listener>
+  
   <!--
     - Declare Spring context listener which sets up the Spring Application Context
     - containing all Cocoon components (and user defined beans as well).



Re: C2.2.1 block fails to start due to hidden dep to spring 3 (was Re: svn commit: r1381952)

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 11/09/2012 13:09, Thorsten Scherler wrote:
> [...]
>
>>
>> Moreover, consider that when issuing 'mvn clean deploy' instead of 
>> 'mvn clean install', you will also upload the SNAPSHOT artifacts to 
>> ASF maven repository (Nexus): since 2.2.X does not have a configured 
>> Jenkins instance for this (like as C3), you still need to do this 
>> manually when you want to publish updated SNAPSHOT artifacts.
>>
>
> Trying to fix that ATM but since I switch my box a while ago I never 
> came to setup the deploy to ASF preconditions. I am working on it now. 
> I get ATM for the "deploy"
>
> [ERROR] Failed to execute goal 
> org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy 
> (default-deploy) on project cocoon-22-archetype-block: Failed to 
> deploy artifacts: Could not transfer artifact 
> org.apache.cocoon:cocoon-22-archetype-block:jar:1.1.0-20120911.095051-2 from/to 
> apache.snapshots.https 
> (https://repository.apache.org/content/repositories/snapshots): Failed 
> to transfer file: 
> https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.095051-2.jar. 
> Return code is: 401 -> [Help 1]
>
> Must be something with the credential setup.

Definitely: I've just been able to deploy the updated archetype (see 
detailed logs below).

It's probably a missing <server> element in ~/.m2/settings.xml for 
'apache.snapshots.https' (see [1] for more details).

Cheers.

[1] http://incubator.apache.org/syncope/release-process.html#Apache_Maven


ilgrosso@mogano 
~/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block $ mvn 
clean deploy
[INFO] Scanning for projects...
[INFO]
[INFO] 
------------------------------------------------------------------------
[INFO] Building Cocoon 2.2 Archetype: Block 1.1.0-SNAPSHOT
[INFO] 
------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ 
cocoon-22-archetype-block ---
[INFO] Deleting 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/target
[INFO]
[INFO] --- maven-enforcer-plugin:1.0.1:enforce (enforce-maven) @ 
cocoon-22-archetype-block ---
[INFO]
[INFO] --- maven-remote-resources-plugin:1.3:process (default) @ 
cocoon-22-archetype-block ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ 
cocoon-22-archetype-block ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 16 resources
[INFO] Copying 2 resources to META-INF
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5:compile (default-compile) @ 
cocoon-22-archetype-block ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources 
(default-testResources) @ cocoon-22-archetype-block ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/test/resources
[INFO] Copying 3 resources
[INFO]
[INFO] --- maven-compiler-plugin:2.5:testCompile (default-testCompile) @ 
cocoon-22-archetype-block ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12:test (default-test) @ 
cocoon-22-archetype-block ---
[INFO] Surefire report directory: 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/target/surefire-reports

-------------------------------------------------------
  T E S T S
-------------------------------------------------------

Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ 
cocoon-22-archetype-block ---
[INFO] Building jar: 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/target/cocoon-22-archetype-block-1.1.0-SNAPSHOT.jar
[INFO]
[INFO] --- maven-site-plugin:3.0:attach-descriptor (attach-descriptor) @ 
cocoon-22-archetype-block ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ 
cocoon-22-archetype-block ---
[INFO] Installing 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/target/cocoon-22-archetype-block-1.1.0-SNAPSHOT.jar 
to 
/home/ilgrosso/.m2/repository/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-SNAPSHOT.jar
[INFO] Installing 
/home/ilgrosso/work/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/pom.xml 
to 
/home/ilgrosso/.m2/repository/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-SNAPSHOT.pom
[INFO]
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ 
cocoon-22-archetype-block ---
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/maven-metadata.xml
Downloaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/maven-metadata.xml 
(792 B at 0.3 KB/sec)
Uploading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.111302-2.jar
Uploaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.111302-2.jar 
(30 KB at 13.8 KB/sec)
Uploading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.111302-2.pom
Uploaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.111302-2.pom 
(2 KB at 0.7 KB/sec)
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/maven-metadata.xml
Downloaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/maven-metadata.xml 
(302 B at 0.2 KB/sec)
Uploading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/maven-metadata.xml
Uploaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/maven-metadata.xml 
(792 B at 0.4 KB/sec)
Uploading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/maven-metadata.xml
Uploaded: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/maven-metadata.xml 
(302 B at 0.1 KB/sec)
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 18.804s
[INFO] Finished at: Tue Sep 11 13:13:13 CEST 2012
[INFO] Final Memory: 15M/490M
[INFO] 
------------------------------------------------------------------------

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


Re: C2.2.1 block fails to start due to hidden dep to spring 3 (was Re: svn commit: r1381952)

Posted by Thorsten Scherler <sc...@gmail.com>.
On 09/11/2012 11:19 AM, Francesco Chicchiriccò wrote:
> On 10/09/2012 20:30, Thorsten Scherler wrote:
>> [...]
>> This breaks jetty:run and I am ATM not sure why. It fails like:
>> ...
>> Any ideas very welcome!
>
> Hi Thorsten,
> this is happening because the generated project is using the latest 
> version of the cocoon-maven-plugin (1.0.2) which in turn is enforcing 
> the latest versions of cocoon-rcl-webapp-wrapper (1.0.2) and 
> cocoon-rcl-spring-reloader (1.0.2); these are in turn dependent on 
> Spring 3.1.
>
> Following the procedure reported above, I've changed (in the generated 
> pom.xml):
>
> <plugin>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-maven-plugin</artifactId>
>         <version>1.0.2</version>
>         <executions>
>           <execution>
>             <id>prepare</id>
>             <phase>compile</phase>
>             <goals>
>               <goal>prepare</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>
> into
>
> <plugin>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-maven-plugin</artifactId>
>         <version>1.0.0</version>
> <dependencies>
>     <!-- RCL -->
>     <dependency>
>       <groupId>org.apache.cocoon</groupId>
> <artifactId>cocoon-rcl-spring-reloader</artifactId>
>       <version>1.0.0</version>
>     </dependency>
>     <dependency>
>       <groupId>org.apache.cocoon</groupId>
> <artifactId>cocoon-rcl-webapp-wrapper</artifactId>
>       <version>1.0.0</version>
>     </dependency>
> </dependencies>
>         <executions>
>           <execution>
>             <id>prepare</id>
>             <phase>compile</phase>
>             <goals>
>               <goal>prepare</goal>
>             </goals>
>           </execution>
>         </executions>
>       </plugin>
>
> and now it works.
>
> I'd suggest to make this changes to archetype resources's pom.xml.

Done and committed. Thanks for the finding.

>
> Moreover, consider that when issuing 'mvn clean deploy' instead of 
> 'mvn clean install', you will also upload the SNAPSHOT artifacts to 
> ASF maven repository (Nexus): since 2.2.X does not have a configured 
> Jenkins instance for this (like as C3), you still need to do this 
> manually when you want to publish updated SNAPSHOT artifacts.
>

Trying to fix that ATM but since I switch my box a while ago I never 
came to setup the deploy to ASF preconditions. I am working on it now. I 
get ATM for the "deploy"

[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy (default-deploy) 
on project cocoon-22-archetype-block: Failed to deploy artifacts: Could 
not transfer artifact 
org.apache.cocoon:cocoon-22-archetype-block:jar:1.1.0-20120911.095051-2 
from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): Failed 
to transfer file: 
https://repository.apache.org/content/repositories/snapshots/org/apache/cocoon/cocoon-22-archetype-block/1.1.0-SNAPSHOT/cocoon-22-archetype-block-1.1.0-20120911.095051-2.jar. 
Return code is: 401 -> [Help 1]

Must be something with the credential setup.

salu2

-- 
Thorsten Scherler <scherler.at.gmail.com>
codeBusters S.L. - web based systems
<consulting, training and solutions>

http://www.codebusters.es/


Re: C2.2.1 block fails to start due to hidden dep to spring 3 (was Re: svn commit: r1381952)

Posted by Francesco Chicchiriccò <il...@apache.org>.
On 10/09/2012 20:30, Thorsten Scherler wrote:
> [...]
> This breaks jetty:run and I am ATM not sure why. It fails like:
>
> 20:11:38.723 [main] ERROR o.s.web.context.ContextLoader - Context 
> initialization failed
> java.lang.NoClassDefFoundError: org/springframework/core/env/Environment
>     at java.lang.Class.getDeclaredConstructors0(Native Method) 
> ~[na:1.7.0_02-ea]
>     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) 
> ~[na:1.7.0_02-ea]
>     at java.lang.Class.getConstructor0(Class.java:2714) ~[na:1.7.0_02-ea]
>     at java.lang.Class.getDeclaredConstructor(Class.java:2002) 
> ~[na:1.7.0_02-ea]
>     at 
> org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:61) ~[spring-beans-2.5.1.jar:2.5.1] 
>
>     at 
> org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:249) 
> ~[spring-web-2.5.1.jar:2.5.1]
>     at 
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) 
> ~[spring-web-2.5.1.jar:2.5.1]
>     at 
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) 
> [spring-web-2.5.1.jar:2.5.1]
>     at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.invoke(ReloadingListener.java:265) 
> [cocoon-rcl-webapp-wrapper-1.0.2.jar:1.0.2]
>     at 
> org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.contextInitialized(ReloadingListener.java:150) 
> [cocoon-rcl-webapp-wrapper-1.0.2.jar:1.0.2]
>     at 
> org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) 
> [jetty-6.1.25.jar:6.1.25
>
> You can reproduce it as follows.
>
> cd src/apache/cocoon2.2/
> svn up
> mvn clean install
> mkdir tmp
> mvn archetype:generate -DarchetypeGroupId=org.apache.cocoon 
> -DarchetypeArtifactId=cocoon-22-archetype-block 
> -DarchetypeVersion=1.1.0-SNAPSHOT -DgroupId=my.groupid 
> -DartifactId=2233 -DarchetypeRepository=local
> cd 2233
> # make sure that the pom has
>  <dependency>
>       <groupId>org.apache.cocoon</groupId>
>        <artifactId>cocoon-core</artifactId>
>        <version>2.2.1-SNAPSHOT</version>
>     </dependency>
> mvn clean install jetty:run
>
> then you will get above error in the console. :(
>
> any idea why there is requested a class which is in spring 3.1 (which 
> is not declared as dep) but cannot be found in the 2.5.x what we are 
> using in 2.2.
>
> Further I tested before I committed and there it was working (at least 
> I think it did).
>
> Anyway I tested now on another box to make sure and it is failing as 
> described above.
>
> Any ideas very welcome!

Hi Thorsten,
this is happening because the generated project is using the latest 
version of the cocoon-maven-plugin (1.0.2) which in turn is enforcing 
the latest versions of cocoon-rcl-webapp-wrapper (1.0.2) and 
cocoon-rcl-spring-reloader (1.0.2); these are in turn dependent on 
Spring 3.1.

Following the procedure reported above, I've changed (in the generated 
pom.xml):

<plugin>
         <groupId>org.apache.cocoon</groupId>
         <artifactId>cocoon-maven-plugin</artifactId>
         <version>1.0.2</version>
         <executions>
           <execution>
             <id>prepare</id>
             <phase>compile</phase>
             <goals>
               <goal>prepare</goal>
             </goals>
           </execution>
         </executions>
       </plugin>

into

<plugin>
         <groupId>org.apache.cocoon</groupId>
         <artifactId>cocoon-maven-plugin</artifactId>
         <version>1.0.0</version>
<dependencies>
     <!-- RCL -->
     <dependency>
       <groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-rcl-spring-reloader</artifactId>
       <version>1.0.0</version>
     </dependency>
     <dependency>
       <groupId>org.apache.cocoon</groupId>
       <artifactId>cocoon-rcl-webapp-wrapper</artifactId>
       <version>1.0.0</version>
     </dependency>
</dependencies>
         <executions>
           <execution>
             <id>prepare</id>
             <phase>compile</phase>
             <goals>
               <goal>prepare</goal>
             </goals>
           </execution>
         </executions>
       </plugin>

and now it works.

I'd suggest to make this changes to archetype resources's pom.xml.

Moreover, consider that when issuing 'mvn clean deploy' instead of 'mvn 
clean install', you will also upload the SNAPSHOT artifacts to ASF maven 
repository (Nexus): since 2.2.X does not have a configured Jenkins 
instance for this (like as C3), you still need to do this manually when 
you want to publish updated SNAPSHOT artifacts.

Regards.

-- 
Francesco Chicchiriccò

ASF Member, Apache Cocoon PMC and Apache Syncope PPMC Member
http://people.apache.org/~ilgrosso/


C2.2.1 block fails to start due to hidden dep to spring 3 (was Re: svn commit: r1381952)

Posted by Thorsten Scherler <sc...@gmail.com>.
On 09/07/2012 11:31 AM, thorsten@apache.org wrote:
> Author: thorsten
> Date: Fri Sep  7 09:30:59 2012
> New Revision: 1381952
>
> URL: http://svn.apache.org/viewvc?rev=1381952&view=rev
> Log:
> COCOON-2233
> Fixing and upgrading versions of artifact versions
> BlockDeploymentServletContextListener to web.xml in the webapp archetype as required in trunk.
> due to the fact the patch from Mark Lundquist is 4 years old in our issue tracker I did not apply it but rather re-did it.
>
> Anyway thanks Mark Lundquist and sorry that we did not apply your patch earlier.
>
> Modified:
> ...
>      cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml
> ...
>
> Modified: cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml
> URL: http://svn.apache.org/viewvc/cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml?rev=1381952&r1=1381951&r2=1381952&view=diff
> ==============================================================================
> --- cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml (original)
> +++ cocoon/trunk/tools/archetypes/cocoon-22-archetype-block/src/main/resources/archetype-resources/pom.xml Fri Sep  7 09:30:59 2012
> @@ -32,22 +32,22 @@
>       <dependency>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-core</artifactId>
> -      <version>2.2.0</version>
> +      <version>2.2.1-SNAPSHOT</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-servlet-service-components</artifactId>
> -      <version>1.0.0</version>
> +      <version>1.1.0-SNAPSHOT</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-template-impl</artifactId>
> -      <version>1.1.0</version>
> +      <version>1.2.0-SNAPSHOT</version>
>       </dependency>
>       <dependency>
>         <groupId>org.apache.cocoon</groupId>
>         <artifactId>cocoon-flowscript-impl</artifactId>
> -      <version>1.0.0</version>
> +      <version>1.1.0-SNAPSHOT</version>
>       </dependency>
>       <dependency>
>         <groupId>javax.servlet</groupId>
> @@ -62,7 +62,7 @@
>         <plugin>
>           <groupId>org.apache.cocoon</groupId>
>           <artifactId>cocoon-maven-plugin</artifactId>
> -        <version>1.0.0-M2</version>
> +        <version>1.0.2</version>
>           <executions>
>             <execution>
>               <id>prepare</id>
> @@ -76,7 +76,7 @@
>         <plugin>
>           <groupId>org.mortbay.jetty</groupId>
>           <artifactId>maven-jetty-plugin</artifactId>
> -        <version>6.1.7</version>
> +        <version>6.1.25</version>
>           <configuration>
>             <connectors>
>               <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
> @@ -96,7 +96,7 @@
>         </plugin>
>         <plugin>
>           <artifactId>maven-jar-plugin</artifactId>
> -        <version>2.1</version>
> +        <version>2.4</version>
>           <configuration>
>             <archive>
>               <manifestEntries>
> @@ -107,7 +107,7 @@
>         </plugin>
>         <plugin>
>           <artifactId>maven-eclipse-plugin</artifactId>
> -        <version>2.5</version>
> +        <version>2.9</version>
>         </plugin>
>       </plugins>
>     </build>

This breaks jetty:run and I am ATM not sure why. It fails like:

20:11:38.723 [main] ERROR o.s.web.context.ContextLoader - Context 
initialization failed
java.lang.NoClassDefFoundError: org/springframework/core/env/Environment
     at java.lang.Class.getDeclaredConstructors0(Native Method) 
~[na:1.7.0_02-ea]
     at java.lang.Class.privateGetDeclaredConstructors(Class.java:2404) 
~[na:1.7.0_02-ea]
     at java.lang.Class.getConstructor0(Class.java:2714) ~[na:1.7.0_02-ea]
     at java.lang.Class.getDeclaredConstructor(Class.java:2002) 
~[na:1.7.0_02-ea]
     at 
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:61) 
~[spring-beans-2.5.1.jar:2.5.1]
     at 
org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:249) 
~[spring-web-2.5.1.jar:2.5.1]
     at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:199) 
~[spring-web-2.5.1.jar:2.5.1]
     at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45) 
[spring-web-2.5.1.jar:2.5.1]
     at 
org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.invoke(ReloadingListener.java:265) 
[cocoon-rcl-webapp-wrapper-1.0.2.jar:1.0.2]
     at 
org.apache.cocoon.tools.rcl.wrapper.servlet.ReloadingListener.contextInitialized(ReloadingListener.java:150) 
[cocoon-rcl-webapp-wrapper-1.0.2.jar:1.0.2]
     at 
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:548) 
[jetty-6.1.25.jar:6.1.25

You can reproduce it as follows.

cd src/apache/cocoon2.2/
svn up
mvn clean install
mkdir tmp
mvn archetype:generate -DarchetypeGroupId=org.apache.cocoon 
-DarchetypeArtifactId=cocoon-22-archetype-block 
-DarchetypeVersion=1.1.0-SNAPSHOT -DgroupId=my.groupid -DartifactId=2233 
-DarchetypeRepository=local
cd 2233
# make sure that the pom has
  <dependency>
       <groupId>org.apache.cocoon</groupId>
        <artifactId>cocoon-core</artifactId>
        <version>2.2.1-SNAPSHOT</version>
     </dependency>
mvn clean install jetty:run

then you will get above error in the console. :(

any idea why there is requested a class which is in spring 3.1 (which is 
not declared as dep) but cannot be found in the 2.5.x what we are using 
in 2.2.

Further I tested before I committed and there it was working (at least I 
think it did).

Anyway I tested now on another box to make sure and it is failing as 
described above.

Any ideas very welcome!

salu2