cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hugh Sparks" <h...@csparks.com>
Subject Re: Re: Cocoon 2.2 - Webapp without blocks
Date Thu, 18 Oct 2007 12:07:16 GMT
----- Original Message ----- 
> Michel Erard suggests:
> Try something like this in applicationContext.xml:
>
> <!-- Servlet service -->
> <bean id="org.hugh.yourapp" 
> class="org.apache.cocoon.sitemap.SitemapServlet">
>  <servlet:context mount-path="/" context-path="/">
>        <!--servlet:connections>
>            <entry key="ajax" 
> value-ref="org.apache.cocoon.ajax.impl.servlet"/>
>            <entry key="forms" 
> value-ref="org.apache.cocoon.forms.impl.servlet"/>
>        </servlet:connections-->
>   </servlet:context>
> </bean>

Thanks for the suggestion!

I create the webapp "MinWebapp" using the cocoon-22-archetype-webapp.
I added this bean to the applicationContext.xml based on your idea:

<!-- Servlet service -->
<bean id="csparks.com.MinWebapp" 
class="org.apache.cocoon.sitemap.SitemapServlet">
  <servlet:context mount-path="/" context-path="/"/>
</bean>

When I did a jetty:run I got:

2007-10-18 20:25:30.531::WARN:  Failed startup of context
org.mortbay.jetty.webapp.WebAppContext@3e1d25{/blah-blah\MinWebapp\target\MinWebapp-1.0}
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 
42 in XML document
from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; 
nested exception is
org.xml.sax.SAXParseException: The prefix "servlet" for element 
"servlet:context" is not bound.

Inspired by that message, I added bunch of dependencies to the pom that I'd 
used in a block that runs
successfully:

    cocoon-core
    cocoon-servlet-service-component
    cocoon-template-impl
    cocoon-flowscript-impl

Unfortunately, this had no effect and I got the same error message.

Following an idea from Gritsenko's slide show "Using Cocoon 2.2 the Classic 
Way"
at the Cocoon 2007 Get Together, I added a great many components to the 
WEB-INF/cocoon
directory. I took everything out of the beans element in 
applicationContext.xml and added
this element:

    <import resource="cocoon/spring/core.xml"/>

The contents of the cocoon directory is from Gritsenko's download.
This got me a little farther, now jetty:run complains that

org.springframework.beans.factory.BeanDefinitionStoreException:
Unable to read Avalon configuration from '/WEB-INF/cocoon.xconf'

But the cocoon.xconf was in the WEB-INF directory...

What I'm trying to do is exactly what his paper is about. Unforturnately,
he is working with parts of cocoon 2.2 taken from the distant future or
the distant past: They don't fit together with the stuff I get from the svn
repository.

I'm tempted to set this ambition aside for now. If the Gods had intended
us to use webapps without blocks, They would have provided us with
an approprite archetype.

Thanks anyway!

-Hugh Sparks


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message