cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Francesco Chicchiriccò <ilgro...@apache.org>
Subject Re: Cocoon 2.2 with Java 8 and Spring Framework 4.2?
Date Tue, 27 Oct 2015 16:41:42 GMT
On 27/10/2015 16:30, Gabriel Gruber wrote:
> Hi Folks,
>
> I was able to compile cocoon 2.2 with spring framework 4.2 and fix all 
> the obvious problems like
> - Using RootBeanDefinition.setScope() instead of 
> RootBeanDefinition.setSingleton()
> - finding the correct method calls after deprecated methods or 
> constants have been removed.
> - forking the commons-collections MultiMap and MultiValueMap classes 
> into a util package of cooon-expression-language-api in order to make 
> the interface compatible with Java 8 maps (conflict in remove() method!)
> - implement missing methods in PipelineComponentScope, 
> PipelineComponentInfoInitializerDecorator, CallScope, ServletScope, 
>  MockRequestAttributes due to changes of Spring Superclasses
> - implement missing method SourceResource.contentLength() due to 
> change of Spring Superclass

Cool.
Which commandline are you using for building Cocoon 2.2? Bare "mvn clean 
install"?

> However still a number of tests are failing like:
> org.apache.cocoon.transformation.CIncludeTransformerTestCase.testCInclude1() 
>
> org.apache.cocoon.transformation.CIncludeTransformerTestCase.testCInclude2() 
>
> org.apache.cocoon.transformation.I18NTransformerTestCase.testI18n1()
> org.apache.cocoon.transformation.I18NTransformerTestCase.testI18n2()
> org.apache.cocoon.servletservice.AbsoluteServletConnectionTestCase.testURI() 
>
> org.apache.cocoon.template.jxtg.JXTemplateGeneratorTestCase.testFormatDate() 
>
> org.apache.cocoon.template.jxtg.JXTemplateGeneratorTestCase.testAttribute() 
>
> org.apache.cocoon.template.jxtg.JXTemplateGeneratorTestCase.testElementSuccess() 
>

Ok, these needs of course to be reviewed and possibly adjusted.

> Now I am able to start jetty with cocoon.

Even cooler.

> When starting with Java 8 I get this error while accessing the start 
> page (while the page is rendered correctly)
>
> _org.apache.cocoon.ProcessingException_: Reader already set. Cannot 
> set reader 'resource'|?at <map:read> - 
> file:///C:/j2ee/open-sources/cocoon/cocoon-2.2-trunk-2015/blocks/cocoon-samples-style/cocoon-samples-style-default/target/classes/COB-INF/sitemap.xmap:63:44|?at

> <file:///C:/j2ee/open-sources/cocoon/cocoon-2.2-trunk-2015/blocks/cocoon-samples-style/cocoon-samples-style-default/target/classes/COB-INF/sitemap.xmap:63:44:?at><map:match>

> - 
> file:///C:/j2ee/open-sources/cocoon/cocoon-2.2-trunk-2015/blocks/cocoon-samples-style/cocoon-samples-style-default/target/classes/COB-INF/sitemap.xmap:62:35

>
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setReader(_AbstractProcessingPipeline.java:298_)

>
> at 
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setReader(_AbstractCachingProcessingPipeline.java:180_)

>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
> at 
> sun.reflect.NativeMethodAccessorImpl.invoke(_NativeMethodAccessorImpl.java:62_) 
>
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(_DelegatingMethodAccessorImpl.java:43_)

>
> at java.lang.reflect.Method.invoke(_Method.java:497_)
> at 
> org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(_PoolableProxyHandler.java:79_)

>
>
> The above exception only appears, if starting jetty with Java 8. When 
> using a JRE7 it will not appear.

Ok, I would say to separate problems here, e.g. first let's make 
everything working with latest Spring + Java 7 and afterwards let's see 
how it works with Java 8. Agree?

> After a bit more playing around with the (empty) samples page I get 
> this error:
>
> java.util.ConcurrentModificationException
> at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:901)
> at java.util.ArrayList$Itr.next(ArrayList.java:851)
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setupPipeline(AbstractProcessingPipeline.java:360)
> at 
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setupPipeline(AbstractCachingProcessingPipeline.java:734)
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.preparePipeline(AbstractProcessingPipeline.java:471)
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(AbstractProcessingPipeline.java:416)
> at sun.reflect.GeneratedMethodAccessor58.invoke(Unknown Source)
> at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
> at java.lang.reflect.Method.invoke(Method.java:497)
> at 
> org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(PoolableProxyHandler.java:79)
> at com.sun.proxy.$Proxy17.process(Unknown Source)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:147)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.SwitchSelectNode.invoke(SwitchSelectNode.java:88)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.HandleErrorsNode.invoke(HandleErrorsNode.java:78)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.prepareErrorHandler(ErrorHandlerHelper.java:157)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.prepareErrorHandler(ErrorHandlerHelper.java:124)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.invokeErrorHandler(ErrorHandlerHelper.java:94)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:158)
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:78)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:81)
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:241)
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:173)
> at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:247)
> at 
> org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java:347)
> at 
> org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java:169)
> at 
> org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:82)
>
>
> Then I also get this exception:
>
> 2015-10-27 16:14:36.268:WARN:oejs.ServletHandler:/
> _java.lang.NullPointerException_
> at 
> org.apache.cocoon.transformation.TraxTransformer.setConsumer(_TraxTransformer.java:396_)

>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(_PoolableProxyHandler.java:79_)

>
> at com.sun.proxy.$Proxy17.setConsumer(Unknown Source)
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.connect(_AbstractProcessingPipeline.java:389_)

>
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.connectPipeline(_AbstractProcessingPipeline.java:407_)

>
> at 
> org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.connectPipeline(_AbstractCachingProcessingPipeline.java:752_)

>
> at 
> org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.process(_AbstractProcessingPipeline.java:443_)

>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.apache.cocoon.core.container.spring.avalon.PoolableProxyHandler.invoke(_PoolableProxyHandler.java:79_)

>
> at com.sun.proxy.$Proxy16.process(Unknown Source)
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(_SerializeNode.java:147_)

>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(_AbstractParentProcessingNode.java:78_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.SwitchSelectNode.invoke(_SwitchSelectNode.java:88_)

>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(_AbstractParentProcessingNode.java:78_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.HandleErrorsNode.invoke(_HandleErrorsNode.java:78_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.prepareErrorHandler(_ErrorHandlerHelper.java:157_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.prepareErrorHandler(_ErrorHandlerHelper.java:124_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.ErrorHandlerHelper.invokeErrorHandler(_ErrorHandlerHelper.java:94_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(_PipelineNode.java:158_)

>
> at 
> org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(_AbstractParentProcessingNode.java:78_)

>
> at 
> org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(_PipelinesNode.java:81_)

>
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(_ConcreteTreeProcessor.java:241_)

>
> at 
> org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(_ConcreteTreeProcessor.java:173_)

>
> at 
> org.apache.cocoon.components.treeprocessor.TreeProcessor.process(_TreeProcessor.java:247_)

>
> at 
> org.apache.cocoon.servlet.RequestProcessor.process(_RequestProcessor.java:347_) 
>
> at 
> org.apache.cocoon.servlet.RequestProcessor.service(_RequestProcessor.java:169_) 
>
> at 
> org.apache.cocoon.sitemap.SitemapServlet.service(_SitemapServlet.java:82_) 
>
> at javax.servlet.http.HttpServlet.service(_HttpServlet.java:848_)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(_AopUtils.java:302_)

>
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(_ReflectiveMethodInvocation.java:190_)

>
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(_ReflectiveMethodInvocation.java:157_)

>
> at 
> org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(_MethodInvocationProceedingJoinPoint.java:85_)

>
> at 
> org.apache.cocoon.jnet.URLHandlerFactoryCollector.installURLHandlers(_URLHandlerFactoryCollector.java:37_)

>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(_Native Method_)
> at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> at java.lang.reflect.Method.invoke(Unknown Source)
> at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(_AbstractAspectJAdvice.java:621_)

>
> at 
> org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(_AbstractAspectJAdvice.java:610_)

>
> at 
> org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(_AspectJAroundAdvice.java:68_)

>
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(_ReflectiveMethodInvocation.java:179_)

>
> at 
> org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(_ExposeInvocationInterceptor.java:92_)

>
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(_ReflectiveMethodInvocation.java:179_)

>
> at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(_JdkDynamicAopProxy.java:207_)

>
> at com.sun.proxy.$Proxy8.service(Unknown Source)
> at 
> org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(_ServletServiceContext.java:485_)

>
> at 
> org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.forward(_ServletServiceContext.java:459_)

>
> at 
> org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterceptor.invoke(_ServletFactoryBean.java:245_)

>
> at 
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(_ReflectiveMethodInvocation.java:179_)

>
> at 
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(_JdkDynamicAopProxy.java:207_)

>
> at com.sun.proxy.$Proxy11.service(Unknown Source)
> at 
> org.apache.cocoon.servletservice.DispatcherServlet.service(_DispatcherServlet.java:106_)

>
> at javax.servlet.http.HttpServlet.service(_HttpServlet.java:848_)
> at 
> org.eclipse.jetty.servlet.ServletHolder.handle(_ServletHolder.java:684_)
> at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(_ServletHandler.java:1496_)

>
> at 
> org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(_MultipartFilter.java:131_)

>
> at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(_ServletHandler.java:1476_)

>
> at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(_ServletHandler.java:499_) 
>
> at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(_ScopedHandler.java:137_) 
>
> at 
> org.eclipse.jetty.security.SecurityHandler.handle(_SecurityHandler.java:557_) 
>
> at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(_SessionHandler.java:231_) 
>
> at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(_ContextHandler.java:1086_)

>
> at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(_ServletHandler.java:428_) 
>
> at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(_SessionHandler.java:193_) 
>
> at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(_ContextHandler.java:1020_) 
>
> at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(_ScopedHandler.java:135_) 
>
> at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(_HandlerWrapper.java:116_) 
>
> at org.eclipse.jetty.server.Server.handle(_Server.java:370_)
> at 
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(_AbstractHttpConnection.java:494_)

>
> at 
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(_AbstractHttpConnection.java:971_)

>
> at 
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(_AbstractHttpConnection.java:1033_)

>
> at org.eclipse.jetty.http.HttpParser.parseNext(_HttpParser.java:644_)
> at 
> org.eclipse.jetty.http.HttpParser.parseAvailable(_HttpParser.java:235_)
> at 
> org.eclipse.jetty.server.AsyncHttpConnection.handle(_AsyncHttpConnection.java:82_) 
>
> at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(_SelectChannelEndPoint.java:667_)

>
> at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(_SelectChannelEndPoint.java:52_)

>
> at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(_QueuedThreadPool.java:608_) 
>
> at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(_QueuedThreadPool.java:543_) 
>
> at java.lang.Thread.run(Unknown Source)
>
>
> Where to go from here now?
>
> Should I commit to some branch? Or should I comment every needed patch 
> for every class in the ticket? (will be up to 20 patches in summary I 
> guess)

Please attach a single patch by running svn diff from

file:///C:/j2ee/open-sources/cocoon/cocoon-2.2-trunk-2015/

Let's try to first make this working, thanks.

Regards.

> From: Francesco Chicchiriccò <ilgrosso@apache.org>
> To: dev@cocoon.apache.org
> Date: 27.10.2015 14:00
> Subject: Re: Cocoon 2.2 with Java 8 and Spring Framework 4.2?
> ------------------------------------------------------------------------
>
>
>
> On 27/10/2015 13:37, Javier Puerto wrote:
> Hi all,
>
> @Gabriel, sounds very interesting and the update can bring some new 
> energy to the project. :)
>
> > Hum, is there anyone around with enough know-how about 2.2.?
> Sorry Francesco, I was quite busy last three months but I will have 
> some spare time in December so I could take a look into the changes.
>
> Thanks Javier!
> I have already set my very first question for you - see my comment in 
> COCOON-2347.
>
> Regards.
>
> 2015-10-27 13:25 GMT+01:00 Gabriel Gruber 
> <_Gabriel.Gruber@workflow.at_ <mailto:Gabriel.Gruber@workflow.at>>:
> Hello Folks,
>
> nice to see the project still being alive :-)  I decided to make a 
> jira issue about our attempt to make cocoon 2.2 work with spring 
> framework 4.2.x.
> _
> __https://issues.apache.org/jira/browse/COCOON-2347_
>
> I will append comments about progress etc. there and give you an 
> update on the mailing list as soon as something substantial could be 
> found out.
>
> greets,
> gabriel
>
>
> > Francesco Chicchiriccò <_ilgrosso@apache.org_ 
> <mailto:ilgrosso@apache.org>> wrote on 26.10.2015 15:37:00:
>
> >> Hi Gabriel,
> >> I do run actually few Cocoon instances in production, but that's 3.
> >> 0.0(-beta-1-SNAPSHOT...). I used to run Cocoon 2.1.X as well.
> >>
> >> Unfortunately, I am not very confident with 2.2, but if you would
> >> like to provide some patches against Spring Configurator [1] or any
> >> other component to bring them to latest Spring version, I would be
> >> happy to review and handle your contribution(s).
> >>
> >> Please be sure to review our contribution docs[2].
>
> >
> > I am successfully running spring 4.0.6 with cocoon 2.2 in production.
> >
> > I had to patch:
> > - cocoon-pipeline-impl
> > - cocoon-servlet-service-impl
> > - cocoon-sitemap-impl
> >
> > anything higher in spring version fails. I do not recall the actual
> > problems but they were deep in cocoon internals and I was unable to
> > debug it properly.
> >
> > I have not been commiting those to cocoon repo as I have too little
> > knowledge how these changes might affect cocoon overall. I could
> > create a branch and commit my changes for someone more experienced 
> than me.
> >
> > WDYT?
> >
> > Hum, is there anyone around with enough know-how about 2.2.?

-- 
Francesco Chicchiriccò

Tirasa - Open Source Excellence
http://www.tirasa.net/

Involved at The Apache Software Foundation:
member, Syncope PMC chair, Cocoon PMC, Olingo PMC
http://people.apache.org/~ilgrosso/


Mime
View raw message