我启动jetty,报下面异常:
2011-08-24 10:34:22.799:INFO::jetty-7.2.2.v20101205
2011-08-24 10:34:28.665:WARN::FAILED org.eclipse.jetty.security.ConstraintSecurityHandler@17ec9f7: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@3b1f38 in org.eclipse.jetty.security.ConstraintSecurityHandler@17ec9f7
2011-08-24 10:34:28.665:WARN::FAILED org.eclipse.jetty.server.session.SessionHandler@fd918a: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@3b1f38 in org.eclipse.jetty.security.ConstraintSecurityHandler@17ec9f7
2011-08-24 10:34:28.665:WARN::Failed startup of context o.e.j.w.WebAppContext{/,file:/E:/workspace/sms/WebRoot/}
java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@3b1f38 in org.eclipse.jetty.security.ConstraintSecurityHandler@17ec9f7
at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:45)
at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:335)
at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:228)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93)
at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:97)
at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:114)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93)
at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:97)
at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:630)
at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:228)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1181)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:584)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:496)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:93)
at org.eclipse.jetty.server.Server.doStart(Server.java:243)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55)
at util.OneWebAppUnassembled.main(OneWebAppUnassembled.java:21)
结果我将下面这两行代码加上在执行便没有问题了:
HashLoginService dummyLoginService = new HashLoginService("TEST-SECURITY-REALM");
webAppCtx.getSecurityHandler().setLoginService(dummyLoginService);
有些web应用在我当前jetty下是可以正常运行的,但我部署另一个web应用就会出现上面的异常,我现在没搞清楚是什么原因导致的,还有这两句代码都做了什么事情实现了什么功能,妄解答!谢谢
问题补充:对于一个web容器,为什么会出现有些web应用可以正常运行,有些则不可以,对于jetty嵌入到应用中,需要实现哪些方面功能,才能得以支持所有的web应用!