cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.nl>
Subject Using spring configurator (for properties) in block
Date Wed, 28 Jan 2009 17:50:57 GMT
Hi all,

 

I read the documentation on the spring configurator.  First let me
describe the usecase.  I want to develop a block which should do not
much more then reading xml files from the filesystem.  I want to use a
property file for the sitemap of the block. 

 

Example:

<map:generate src="file://${repository.dir.flyerdefinitions}/{1}.xml
<file:///\\$%7brepository.dir.flyerdefinitions%7d\%7b1%7d.xml> " />

 

So I created following  property file in
/META-INF/cocoon/properties/application.properties

 

repository.dir=D:/testdata

repository.dir.released=${repository.dir}/XML Repository

repository.dir.flyerdefinitions=${repository.dir.released}/Flyer
Definitions

 

However, to activate the spring configurator I would need to modify the
web.xml (configure listeners) and applicationContext.xml (initialize the
springconfigurator) of the webapp.  Since I built the webapp using the
maven archetype all this was already in place.  But it is not clear to
me if I need to perform an extra step to be able to read/use the
properties in the block which I declared as a dependency of my webapp.

 

 

Now I get following stacktrace so it seems the property file is not
found or properly read by the spring configurator.  

 

Many thanks in advance,

Robby Pelssers

 

[INFO] Started Jetty Server

2009-01-28 18:12:36.069::WARN:  Nested in
javax.servlet.ServletException: org.apache.cocoon.ProcessingException:
Sitemap: error invoking matcher

        at <map:match> -
file:///D:/development/workspaces/nxp/productpreview2/target/work/blocks
/common/sitemap.xmap:30:36:

org.apache.cocoon.ProcessingException: Sitemap: error invoking matcher

        at <map:match> -
file:///D:/development/workspaces/nxp/productpreview2/target/work/blocks
/common/sitemap.xmap:30:36

        at
org.apache.cocoon.ProcessingException.throwLocated(ProcessingException.j
ava:111)

        at
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(Matc
hNode.java:90)

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

        at
org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(P
ipelineNode.java:143)

        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:239)

        at
org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process
(ConcreteTreeProcessor.java:171)

        at
org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreePro
cessor.java:247)

        at
org.apache.cocoon.servlet.RequestProcessor.process(RequestProcessor.java
:351)

        at
org.apache.cocoon.servlet.RequestProcessor.service(RequestProcessor.java
:169)

        at
org.apache.cocoon.sitemap.SitemapServlet.service(SitemapServlet.java:84)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

        at
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.fo
rward(ServletServiceContext.java:468)

        at
org.apache.cocoon.servletservice.ServletServiceContext$PathDispatcher.fo
rward(ServletServiceContext.java:443)

        at
org.apache.cocoon.servletservice.spring.ServletFactoryBean$ServiceInterc
eptor.invoke(ServletFactoryBean.java:264)

        at
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(Ref
lectiveMethodInvocation.java:171)

        at
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAo
pProxy.java:204)

        at $Proxy5.service(Unknown Source)

        at
org.apache.cocoon.servletservice.DispatcherServlet.service(DispatcherSer
vlet.java:106)

        at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)

        at
org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)

        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan
dler.java:1093)

        at
org.apache.cocoon.servlet.multipart.MultipartFilter.doFilter(MultipartFi
lter.java:131)

        at
org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHan
dler.java:1084)

        at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)

        at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:2
16)

        at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)

        at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)

        at
org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)

        at
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandler
Collection.java:206)

        at
org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.jav
a:114)

        at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

        at org.mortbay.jetty.Server.handle(Server.java:324)

        at
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)

        at
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConne
ction.java:828)

        at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)

        at
org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)

        at
org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)

        at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
395)

        at
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.ja
va:450)

Caused by: org.apache.cocoon.sitemap.PatternException: No value for
xpath: repository.dir

        at
org.apache.cocoon.components.treeprocessor.variables.StringTemplateParse
rVariableResolver.resolve(StringTemplateParserVariableResolver.java:81)

        at
org.apache.cocoon.components.treeprocessor.sitemap.GenerateNode.invoke(G
enerateNode.java:62)

        at
org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.
invokeNodes(AbstractParentProcessingNode.java:55)

        at
org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(Matc
hNode.java:87)

        ... 39 more

Caused by: org.apache.commons.jxpath.JXPathException: No value for
xpath: repository.dir

        at
org.apache.cocoon.components.treeprocessor.variables.LegacySubstitutions
.toString(LegacySubstitutions.java:57)

        at
org.apache.cocoon.components.treeprocessor.variables.StringTemplateParse
rVariableResolver.resolve(StringTemplateParserVariableResolver.java:77)



Mime
View raw message