Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Jetty 9, ContextLoaderListener problem?

I have an embedded application that runs great with jetty 8 -- I just
tried running with jetty 9, and things fail with an error from Spring
about ContextLoaderListener?

Is there something different about context loaders in jetty 9 /
servlets 3.1?  I have:

  <listener>
    <listener-class>my.company.MyContextLoaderListener</listener-class>
  </listener>

it does not appear to get called, and I get the full error:


2012-10-24 15:58:18,554 WARN org.eclipse.jetty.webapp.WebAppContext -
Failed startup of context
o.e.j.w.WebAppContext@7d7715a{/,file:/Users/ryan/workspace/xxxx/main/xxxx-launcher/target/test-classes/xxxx/,STARTING}
javax.servlet.ServletException: java.lang.IllegalStateException: No
WebApplicationContext found: no ContextLoaderListener registered?
	at org.apache.shiro.web.servlet.AbstractFilter.init(AbstractFilter.java:105)
	at org.eclipse.jetty.servlet.FilterHolder.doStart(FilterHolder.java:117)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
	at org.eclipse.jetty.servlet.ServletHandler.doStart(ServletHandler.java:161)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:376)
	at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:457)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
	at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:106)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:733)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:279)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1265)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:689)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:490)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:90)
	at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:58)
	at org.eclipse.jetty.server.Server.doStart(Server.java:275)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:69)
	at voyager.launcher.VoyagerLauncher.launch(VoyagerLauncher.java:463)
	at voyager.launcher.DevRunner.run(DevRunner.java:18)
	at voyager.launcher.DevRunner.main(DevRunner.java:33)
Caused by: java.lang.IllegalStateException: No WebApplicationContext
found: no ContextLoaderListener registered?
	at org.springframework.web.context.support.WebApplicationContextUtils.getRequiredWebApplicationContext(WebApplicationContextUtils.java:90)
	at xxxxx.security.MySecurityFilter.createDefaultSecurityManager(MySecurityFilter.java:44)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.ensureSecurityManager(AbstractShiroFilter.java:189)
	at org.apache.shiro.web.servlet.AbstractShiroFilter.onFilterConfigSet(AbstractShiroFilter.java:153)
	at org.apache.shiro.web.servlet.AbstractFilter.init(AbstractFilter.java:97)
	... 36 more


thanks
ryan


Back to the top