Hi!

I''m trying to get my T5 application up and running with Spring. I've placed
the "kitchen sink" spring.jar in my WEB-INF/lib together with
tapestry-spring.jar. I'm using T5.0.18.

I'm testing this on Tomcat 6.0.10 and Jetty 6.1.12. Tomcat initializes
correctly, and spring injects work nicely from Tapestry pages. But in Jetty,
spring won't initialize on startup, and I get the exception listed below.

I have ONE spring listener and ZERO spring servlets and filters. I have
replaced TapestryFilter with TapestrySpringFilter. If I remove the spring
context loader listener, I get the expected message from tapestry saying
that the spring context hasn't been initialized. But all this seems
meaningless to pursue, since spring/tapestry integration is working
correctly in Tomcat with my current setup. Does anyone have a clue? Does
Jetty have some kind of built-in spring support that gets in my way?

I realize that the problem seems to be related to Jetty and Spring, and not
to Tapestry. I'm still hoping that you guys can help me on this one, as this
is a very common case for most of us.

2009-02-14 09:48:14.995:/moby:INFO:  Initializing Spring root
WebApplicationContext
2009-02-14 09:48:15.941::WARN:  Failed startup of context
org.mortbay.jetty.webapp.webappcont...@7afaa550
{/moby,c:/dev/projects/Moby/web}
java.lang.IllegalStateException: Cannot initialize context because there is
already a root application context present - check whether you have multiple
ContextLoader* definitions in your web.xml!
    at
org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:182)
    at
org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:45)
    at
org.mortbay.jetty.handler.ContextHandler.startContext(ContextHandler.java:547)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:136)
    at
org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233)
    at
org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:516)
    at
org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:459)
    at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
    at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
    at
org.mortbay.jetty.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:156)
    at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
    at
org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCollection.java:152)
    at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
    at
org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
    at org.mortbay.jetty.Server.doStart(Server.java:222)
    at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:42)
    at org.mortbay.xml.XmlConfiguration.main(XmlConfiguration.java:985)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.mortbay.start.Main.invokeMain(Main.java:194)
    at org.mortbay.start.Main.start(Main.java:523)
    at org.mortbay.start.Main.main(Main.java:119)

Reply via email to