Further debugging shows that the method ServletFactoryBean.getObject() is
called by Spring (DefaultListableBeanFactory.getObjectFromFactoryBean(...))
*before* the embeddedServlet or any other property was set. So
embeddedServlet is null, which makes the code inside getObject() fail:
public Object getObject() throws Exception {
ProxyFactory proxyFactory = new ProxyFactory(this.embeddedServlet);
proxyFactory.addAdvice(new ServiceInterceptor());
if (this.mountPath != null) {
proxyFactory.addAdvisor(new MountableMixinAdvisor());
}
proxyFactory.addAdvisor(new ServletServiceContextMixinAdvisor());
return proxyFactory.getProxy();
}
We have lots of spring config files now, so I don't see if we have any
special config which triggers this problem. Any idea?
Alex
Alexander Klimetschek schrieb:
1)
I changed the spring configuration to look like the following snippet,
but I get an exception (see below). Debugging showed that the
embeddedServlet field in ServletFactoryBean is null. But it should be of
type o.a.c.sitemap.SitemapServlet, the declared class of the bean??
<bean id="com.mindquarry.dforms.dforms-block"
class="org.apache.cocoon.sitemap.SitemapServlet">
<servlet:context mount-path="/dforms"
context-path="blockcontext:/mindquarry-dforms/">
<servlet:connections>
<entry key="resources"
value-ref="com.mindquarry.webapp.resources-block" />
<entry key="teams"
value-ref="com.mindquarry.teamspace.teamspace-block" />
<entry key="tasks"
value-ref="com.mindquarry.tasks.tasks-block" />
</servlet:connections>
</servlet:context>
</bean>
Caused by: org.springframework.aop.framework.AopConfigException: Can't
proxy null object
at
org.springframework.aop.framework.ProxyFactory.<init>(ProxyFactory.java:49)
at
org.apache.cocoon.servletservice.spring.ServletFactoryBean.getObject(ServletFactoryBean.java:194)
at
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectFromFactoryBean(AbstractBeanFactory.java:1211)
--
Alexander Klimetschek
http://www.mindquarry.com