Re: Cocoon 2.2 in servlet 3.0 environment fails to initialize when webjars present on classpath.

2016-09-28 Thread Peter Hunsberger
Hi Leszek,

although there are a few of us still hanging around I suspect you're
going to have to figure this one out on your own.  Running Cocoon
under Jetty is interesting to me personally but I won't have any time
to look at this in the near future...
Peter Hunsberger


On Wed, Sep 28, 2016 at 4:11 AM, Leszek Gawron  wrote:
> I wonder if there is still anyone able to answer my question but still:
>
> I have found a problem that prevents deploying cocoon to 3.0 containers if
> the webapp contains webjars - by webjar I mean a jar containing
> META-INF/resources folder which is specially treated by sevlet container
> (the resources from that folder are served by container itself bypassing any
> webapp setup).
>
> This happens on jetty 9.x. No matter if I set webapp to be 2.5 servlet
> compliant or 3.0.
> Does not happen on jetty 8 which is ancient as of now.
>
>
> I try running my app in embedded Jetty 9 - it works - as long as there is no
> actual .war - there is no scanning for META-INF resources.
>
> As soon as I build a war this is how a configured context looks like:
>
>
> startup of context o.e.j.w.WebAppContext@5bcab519{/,[
>
> file:///C:/cygwin/tmp/jetty-0.0.0.0-8080-root.war-_-any-1513195852101013802.dir/webapp/,
> jar:file:///C:/temp/jetty/mywebapp/smart-libs/modernizr-2.8.3.jar!/META-INF/resources,
> jar:file:///C:/temp/jetty/mywebapp/smart-libs/openlayers-3.2.0.jar!/META-INF/resources,
> jar:file:///C:/temp/jetty/mywebapp/smart-libs/bootstrap-3.3.2.jar!/META-INF/resources,
> jar:file:///C:/temp/jetty/mywebapp/smart-libs/jquery-1.11.1.jar!/META-INF/resources],UNAVAILABLE}
> {C:\temp\jetty-gemini\gemini/root.war}
>
> suddenly there is more than one root for static resources.
>
> This yields following error:
>
> org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'org.apache.cocoon.Processor': Initialization of bean failed;
> nested exception is org.springframework.beans.factory.BeanCreationException:
> Unable to initialize Avalon component with role org.apache.cocoon.Processor;
> nested exception is
> org.apache.avalon.framework.configuration.ConfigurationException: Cannot
> resolve context://sitemap.xmap
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
> at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
> at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
> at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
> at
> org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
> at
> org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
> at
> org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
> at
> org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
> at
> org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
> at
> org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:843)
> at
> org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:533)
> at
> org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:816)
> at
> org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:345)
> at
> org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)
> at
> org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
> at
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
> at
> org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)
> at
> org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
> at
> org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
> at
> org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
> at
> 

[jira] [Created] (COCOON-2353) Cocoon 2.2 in servlet 3.0 environment fails to initialize when webjars present on classpath.

2016-09-28 Thread Leszek Gawron (JIRA)
Leszek Gawron created COCOON-2353:
-

 Summary: Cocoon 2.2 in servlet 3.0 environment fails to initialize 
when webjars present on classpath.
 Key: COCOON-2353
 URL: https://issues.apache.org/jira/browse/COCOON-2353
 Project: Cocoon
  Issue Type: Bug
  Components: * Cocoon Core
Affects Versions: 2.2
Reporter: Leszek Gawron


 have found a problem that prevents deploying cocoon to 3.0 containers if the 
webapp contains webjars - by webjar I mean a jar containing META-INF/resources 
folder which is specially treated by sevlet container (the resources from that 
folder are served by container itself bypassing any webapp setup).

This happens on jetty 9.x. No matter if I set webapp to be 2.5 servlet 
compliant or 3.0.
Does not happen on jetty 8 which is ancient as of now.


I try running my app in embedded Jetty 9 - it works - as long as there is no 
actual .war - there is no scanning for META-INF resources.

As soon as I build a war this is how a configured context looks like:


startup of context o.e.j.w.WebAppContext@5bcab519{/,[

file:///C:/cygwin/tmp/jetty-0.0.0.0-8080-root.war-_-any-1513195852101013802.dir/webapp/,
 
jar:file:///C:/temp/jetty/mywebapp/smart-libs/modernizr-2.8.3.jar!/META-INF/resources,
 
jar:file:///C:/temp/jetty/mywebapp/smart-libs/openlayers-3.2.0.jar!/META-INF/resources,
 
jar:file:///C:/temp/jetty/mywebapp/smart-libs/bootstrap-3.3.2.jar!/META-INF/resources,
 
jar:file:///C:/temp/jetty/mywebapp/smart-libs/jquery-1.11.1.jar!/META-INF/resources],UNAVAILABLE}
{C:\temp\jetty-gemini\gemini/root.war}

suddenly there is more than one root for static resources. 

This yields following error:

org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.apache.cocoon.Processor': Initialization of bean failed; nested 
exception is org.springframework.beans.factory.BeanCreationException: Unable to 
initialize Avalon component with role org.apache.cocoon.Processor; nested 
exception is org.apache.avalon.framework.configuration.ConfigurationException: 
Cannot resolve context://sitemap.xmap
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at 
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at 
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at 
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at 
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at 
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
at 
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at 
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at 
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at 
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at 
org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:843)
at 
org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:533)
at 
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:816)
at 
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:345)
at 
org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)
at 
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)
at 
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at 
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at 
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)
at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at 
org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
at 
org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
at 
org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499)
at 

Cocoon 2.2 in servlet 3.0 environment fails to initialize when webjars present on classpath.

2016-09-28 Thread Leszek Gawron
I wonder if there is still anyone able to answer my question but still:

I have found a problem that prevents deploying cocoon to 3.0 containers if
the webapp contains webjars - by webjar I mean a jar containing
META-INF/resources folder which is specially treated by sevlet container
(the resources from that folder are served by container itself bypassing
any webapp setup).

This happens on jetty 9.x. No matter if I set webapp to be 2.5 servlet
compliant or 3.0.
Does not happen on jetty 8 which is ancient as of now.


I try running my app in embedded Jetty 9 - it works - as long as there is
no actual .war - there is no scanning for META-INF resources.

As soon as I build a war this is how a configured context looks like:


startup of context o.e.j.w.WebAppContext@5bcab519{/,[

file:///C:/cygwin/tmp/jetty-0.0.0.0-8080-root.war-_-any-1513195852101013802.dir/webapp/,
jar:file:///C:/temp/jetty/mywebapp/smart-libs/modernizr-2.8.3.jar!/META-INF/resources,
jar:file:///C:/temp/jetty/mywebapp/smart-libs/openlayers-3.2.0.jar!/META-INF/resources,
jar:file:///C:/temp/jetty/mywebapp/smart-libs/bootstrap-3.3.2.jar!/META-INF/resources,
jar:file:///C:/temp/jetty/mywebapp/smart-libs/jquery-1.11.1.jar!/META-INF/resources],UNAVAILABLE}
{C:\temp\jetty-gemini\gemini/root.war}

suddenly there is more than one root for static resources.

This yields following error:

org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'org.apache.cocoon.Processor': Initialization of bean
failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Unable to
initialize Avalon component with role org.apache.cocoon.Processor; nested
exception is
org.apache.avalon.framework.configuration.ConfigurationException: Cannot
resolve context://sitemap.xmap
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:547)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476)
at
org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:303)
at
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at
org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:299)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:194)
at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:755)
at
org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:759)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480)
at
org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:434)
at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306)
at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106)
at
org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:843)
at
org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:533)
at
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:816)
at
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:345)
at
org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1404)
at
org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1366)
at
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:778)
at
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:262)
at
org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:520)
at
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
at
org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:188)
at
org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:499)
at
org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:147)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at
org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:458)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
at