[ 
https://issues.apache.org/jira/browse/COCOON-2265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12749745#action_12749745
 ] 

Mark Diggory commented on COCOON-2265:
--------------------------------------

This does appear to work with the demo I provided.  I can add the following 
dependencies and web.xml listener and it will start and I can access the block 
in my browser.

However, when I apply the same strategy to our configuration in the 
dspace-xmlui project I get the following exception (and I do not find that 
cocoon-spring-configurator-2.1.0.jar contains 
org/apache/cocoon/spring/configurator/impl/DeploymentUtil anymore as it appears 
to be moved under a new package in cocoon-block-deployment-1.1.0.jar

Aug 31, 2009 8:28:25 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of 
class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.apache.cocoon.template.script.ScriptManager' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-template-impl-1.1.0.jar!/META-INF/cocoon/spring/cocoon-template.xml]:
 Cannot resolve reference to bean 'org.apache.cocoon.core.xml.SAXParser' while 
setting bean property 'saxParser'; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.apache.cocoon.core.xml.SAXParser' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-xml-impl-1.0.0.jar!/META-INF/cocoon/spring/cocoon-xml-impl.xml]:
 Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.xml.sax.EntityResolver' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-xml-resolver-1.0.0.jar!/META-INF/cocoon/spring/cocoon-xml-resolver.xml]:
 Invocation of init method failed; nested exception is 
java.lang.NoClassDefFoundError: 
org/apache/cocoon/spring/configurator/impl/DeploymentUtil
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:104)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1245)
        ...
        at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'org.apache.cocoon.core.xml.SAXParser' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-xml-impl-1.0.0.jar!/META-INF/cocoon/spring/cocoon-xml-impl.xml]:
 Initialization of bean failed; nested exception is 
org.springframework.beans.factory.BeanCreationException: Error creating bean 
with name 'org.xml.sax.EntityResolver' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-xml-resolver-1.0.0.jar!/META-INF/cocoon/spring/cocoon-xml-resolver.xml]:
 Invocation of init method failed; nested exception is 
java.lang.NoClassDefFoundError: 
org/apache/cocoon/spring/configurator/impl/DeploymentUtil
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:480)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
        at java.security.AccessController.doPrivileged(Native Method)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
        ...
        at 
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:269)
        ... 33 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error 
creating bean with name 'org.xml.sax.EntityResolver' defined in URL 
[jar:file:/webapps/dspace-xmlui-webapp/WEB-INF/lib/cocoon-xml-resolver-1.0.0.jar!/META-INF/cocoon/spring/cocoon-xml-resolver.xml]:
 Invocation of init method failed; nested exception is 
java.lang.NoClassDefFoundError: 
org/apache/cocoon/spring/configurator/impl/DeploymentUtil
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
        ...
        at 
org.apache.cocoon.core.xml.impl.AbstractJaxpParser.setBeanFactory(AbstractJaxpParser.java:109)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1325)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
        ... 42 more
Caused by: java.lang.NoClassDefFoundError: 
org/apache/cocoon/spring/configurator/impl/DeploymentUtil
        at 
org.apache.cocoon.core.xml.resolver.CocoonSystemResolver.init(CocoonSystemResolver.java:49)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        ...
        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
        at 
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
        ... 54 more

> Cannot use cocoon-servlet-service-impl 1.2.0 because 
> java.net.MalformedURLException: Could not resolve blockcontext:/...
> ------------------------------------------------------------------------------------------------------------------------
>
>                 Key: COCOON-2265
>                 URL: https://issues.apache.org/jira/browse/COCOON-2265
>             Project: Cocoon
>          Issue Type: Bug
>          Components: - Servlet service framework
>    Affects Versions: 2.2, 2.2-dev (Current SVN)
>            Reporter: Mark Diggory
>         Attachments: test.zip
>
>
> The following issue occurs with the blockcontext URL when trying to use 
> cocoon-servlet-service-impl 1.2.0 and mounting a servlet using the default 
> architype with this dependency added.  I am including an example project for 
> others to test this against.
> I am trying to replicate this in a test example is we are having sever 
> difficulties using 1.2.0 and most specifically using 
> org.apache.cocoon.sitemap.SitemapServlet in our Cocoon project located here..,
> http://jira.dspace.org/jira/browse/DS-253
> Here we were able to alleviate 
> https://issues.apache.org/jira/browse/COCOON-2217, by upgrading to 1.2.0, but 
> it is causing other problems now.
> I am including a new example multimodule project that replicates this.  To 
> execute this project do:
> cd test
> mvn package install
> to execute the first application
> cd test-original-webapp
> mvn jetty:run
> this application should run without issues
> to execute the second modified webapplication do:
> cd ../test-new-webapp
> mvn jetty:run
> It is comprised of two example block/webapp pairs
> test/test-original-block
> test/test-original-webapp
> The above example was generated off the cocoon archetypes, in needed to be 
> altered to adjust for the problem identified in
> http://www.nabble.com/Creating-a-parent-POM-td18173518.html
> I corrected for this by adding the maven-war-plugin as a plugin in 
> test/pom.xml, otherwise it is unaltered accept to insert test-original-block 
> in test-original-webapp.  This example works but uses: 
> org.apache.cocoon:cocoon-servlet-service-impl:1.0.0
> The next example is generated the same way but adds dependencies to upgrade 
> the block to use org.apache.cocoon:cocoon-servlet-service-impl:1.2.0
> test/test-new-block
> test/test-new-webapp
> But I needed to also add an explicit addition of the dependency: 
> org.apache.excalibur.components:excalibur-sourceresolve:2.2.3 to correct for 
> the following problem as well...
> 2009-08-22 17:25:03.216::WARN:  Failed startup of context 
> org.mortbay.jetty.plugin.jetty6pluginwebappcont...@e696f9{/,/Users/mdiggory/test-works/test-new-webapp/target/test-new-webapp-1.0}
> org.springframework.beans.factory.BeanDefinitionStoreException: Unable to 
> read Avalon configuration from 'resource://org/apache/cocoon/cocoon.xconf'.; 
> nested exception is 
> org.apache.avalon.framework.configuration.ConfigurationException: Unable to 
> create class for component with role 
> org.apache.cocoon.generation.Generator/imagedirectory with class: 
> org.apache.cocoon.generation.ImageDirectoryGenerator
>       at 
> org.apache.cocoon.core.container.spring.avalon.BridgeElementParser.parse(BridgeElementParser.java:86)
> ...
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.apache.avalon.framework.configuration.ConfigurationException: 
> Unable to create class for component with role 
> org.apache.cocoon.generation.Generator/imagedirectory with class: 
> org.apache.cocoon.generation.ImageDirectoryGenerator
>       at 
> org.apache.cocoon.core.container.spring.avalon.BridgeElementParser.createConfig(BridgeElementParser.java:216)
>       ... 58 more
> Caused by: java.lang.NoClassDefFoundError: 
> org/apache/excalibur/source/SourceException
>       at java.lang.Class.forName0(Native Method)
>       at 
> org.apache.cocoon.core.container.spring.avalon.BridgeElementParser.createConfig(BridgeElementParser.java:207)
>       ... 60 more
> 2009-08-22 17:25:03.228::WARN:  Nested in 
> org.springframework.beans.factory.BeanDefinitionStoreException: Unable to 
> read Avalon configuration from 'resource://org/apache/cocoon/cocoon.xconf'.; 
> nested exception is 
> org.apache.avalon.framework.configuration.ConfigurationException: Unable to 
> create class for component with role 
> org.apache.cocoon.generation.Generator/imagedirectory with class: 
> org.apache.cocoon.generation.ImageDirectoryGenerator:
> java.lang.NoClassDefFoundError: org/apache/excalibur/source/SourceException
>       at java.lang.Class.forName0(Native Method)
>       at java.lang.Class.forName(Class.java:164)
>       at 
> org.apache.cocoon.core.container.spring.avalon.BridgeElementParser.createConfig(BridgeElementParser.java:207)
> ...
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> 2009-08-22 17:25:03.261::INFO:  Started selectchannelconnec...@0.0.0.0:8888
> [INFO] Started Jetty Server
> Once this excalibur bridge error is corrected for, the resulting error occurs 
> in our application as well... and reflects that for some reason in 
> org.apache.cocoon:cocoon-servlet-service-impl:1.2.0 that the "blockcontext:" 
> URL scheme is no longer being properly handled by the application
> 2009-08-22 17:21:15.052:/:INFO:  Apache Cocoon Spring Configurator v1.0.2 is 
> running in mode 'prod'.
> 2009-08-22 17:21:17.084::WARN:  Failed startup of context 
> org.mortbay.jetty.plugin.jetty6pluginwebappcont...@66b7ea{/,/Users/mdiggory/test-works/test-new-webapp/target/test-new-webapp-1.0}
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'com.example.test-new-block.service': Invocation of init method 
> failed; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Could not create 
> configuration for TreeProcesoor; nested exception is 
> java.net.MalformedURLException: unknown protocol: blockcontext
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1337)
> ...
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> Caused by: org.springframework.beans.factory.BeanCreationException: Could not 
> create configuration for TreeProcesoor; nested exception is 
> java.net.MalformedURLException: unknown protocol: blockcontext
>       at 
> org.apache.cocoon.sitemap.SitemapServlet$RequestProcessor.getProcessor(SitemapServlet.java:113)
> ...
>       at 
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
>       ... 53 more
> Caused by: java.net.MalformedURLException: unknown protocol: blockcontext
>       at java.net.URL.<init>(URL.java:574)
>       at java.net.URL.<init>(URL.java:464)
>       at java.net.URL.<init>(URL.java:413)
>       at 
> org.apache.cocoon.servletservice.ServletServiceContext.getResource(ServletServiceContext.java:108)
>       at 
> org.apache.cocoon.sitemap.SitemapServlet$RequestProcessor.createTreeProcessorConfiguration(SitemapServlet.java:162)
>       at 
> org.apache.cocoon.sitemap.SitemapServlet$RequestProcessor.getProcessor(SitemapServlet.java:111)
>       ... 76 more
> 2009-08-22 17:21:17.097::WARN:  Nested in 
> org.springframework.beans.factory.BeanCreationException: Error creating bean 
> with name 'com.example.test-new-block.service': Invocation of init method 
> failed; nested exception is 
> org.springframework.beans.factory.BeanCreationException: Could not create 
> configuration for TreeProcesoor; nested exception is 
> java.net.MalformedURLException: unknown protocol: blockcontext:
> java.net.MalformedURLException: unknown protocol: blockcontext
>       at java.net.URL.<init>(URL.java:574)
>       at java.net.URL.<init>(URL.java:464)
>       at java.net.URL.<init>(URL.java:413)
>       at 
> org.apache.cocoon.servletservice.ServletServiceContext.getResource(ServletServiceContext.java:108)
> ...
>       at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> 2009-08-22 17:21:17.128::INFO:  Started selectchannelconnec...@0.0.0.0:8888
> [INFO] Started Jetty Server

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to