Thanks,
I tried, but it doesn't work.
Here what i did exactly:
I got 4 maven projects: common, storage, export, and webapp
obviously storage depends on common, export on storage and webapp
depends on export.
webapp does not contain any java code nor any sitemap.
common defines it's spring configuration in
src/main/resources/META-INF/cocoon/spring/application-context-common.xml
(it only defines a logging component)
storage defines it's spring conf in
src/main/resources/META-INF/cocoon/spring/application-context-storage.xml
(it only defines the dao and transaction stuff)
export defines it's spring stuff in
src/main/resources/META-INF/cocoon/spring/
It defines the block and the generator i try to test
like this:
<bean id="com.fcompany.ma-i.block"
class="org.apache.cocoon.sitemap.SitemapServlet">
<servlet:context mount-path="/ma-i"
context-path="blockcontext:/ma-i/" />
</bean>
<bean id="serviceProgramsGenerator"
name="org.apache.cocoon.generation.Generation/serviceProgramsGenerator"
class="com.company.project.ServiceProgramsGenerator">
<property name="helperA">
<ref bean="AHelper" />
</property>
<property name="helperMI">
<ref bean="MIHelper" />
</property>
</bean>
My pipeline is defined in src/main/resources/COB-INF/
<map:pipeline>
<map:match pattern="servicePrograms">
<map:generate type="serviceProgramsGenerator" />
<map:serialize type="xml" />
</map:match>
</map:pipeline>
In webapp, i create the main web.xml and the main applicationContext.xml
located in src/main/webapp/WEB-INF/
The war is correctly created.
it is also correctly started in jonas. But ther is a problem when
calling it from a web browser.
The exception i see in the browser has a root cause which is :
org.apache.avalon.framework.configuration.ConfigurationException: Type
'serviceProgramsGenerator' does not exist for 'map:generate' at
file:/E:/JONAS_4_8_4/work/jonas/localhost/ma-webapp-1.0-SNAPSHOT/blocks/ma-import/sitemap.xmap:62:53
org.apache.cocoon.components.treeprocessor.sitemap.SitemapLanguage.getTypeForStatement(SitemapLanguage.java:558)
I can recognise cocoon has correctly found my sitemap in the COB-INF in
the jar in the webapp, but it seems not to found the spring component
What did i do wrong ?
Regards
Raphaël
Grzegorz Kossakowski a écrit :
Raphaël Piéroni pisze:
Do you mean something like this:
in my jar defining my block sitemap, i do
META-INF/c/s/myGenerators-services.xml
in which i do <bean name="o.a.c...Generator/myGeneratorName">
and in my sitemap i do
<map:pipeline>
<map:match pattern="myPipeline">
<map:generate type="myGeneratorName"/>
<map:serialize type="xml"/>
</map:match>
</map:pipeline>
and also in the sitemap, i don't define
<map:components>
<map:generators >
<map:generator name="myGeneratorName"
src="com.company.project.MyGeneratorClass"/>
Exactly. We decided that configuring components in sitemap is not such a good
idea because it
greatly pollutes it. Using standard (Spring-based) way of configuring all
components is also easier
for people because they don't have to learn anything new.
So general advice for all people: if you develop new components don't declare
them in a sitemap.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]