Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/eclipse/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Jetty身份验证配置示例_Java_Eclipse_Authentication_Webserver_Jetty - Fatal编程技术网

Java Jetty身份验证配置示例

Java Jetty身份验证配置示例,java,eclipse,authentication,webserver,jetty,Java,Eclipse,Authentication,Webserver,Jetty,我真的需要你的帮助: 我想实现以下示例: 我从教程末尾下载了完整的源代码,所以一切都应该是正确的。我正在使用EclipseIDEforJava开发人员版本:Neon.1a发行版(4.6.1)、Jetty(来自市场)和JDK的最新版本。当我按play时,出现以下错误: 配置: C:\Users\DiebolPa\AppData\Local\Temp\eclipseJettyPlugin.config.jetty_authentication_example.xml Version: 8.

我真的需要你的帮助:

我想实现以下示例:

我从教程末尾下载了完整的源代码,所以一切都应该是正确的。我正在使用EclipseIDEforJava开发人员版本:Neon.1a发行版(4.6.1)、Jetty(来自市场)和JDK的最新版本。当我按play时,出现以下错误:

配置:

C:\Users\DiebolPa\AppData\Local\Temp\eclipseJettyPlugin.config.jetty_authentication_example.xml
    Version: 8.1.14.v20131031
    Context: /
    Port: 8080
    Classpath: C:/Users/DiebolPa/.m2/repository/javax/servlet/javax.servlet-api/3.1.0/javax.servlet-api-3.1.0.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-http/9.2.11.v20150529/jetty-http-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-io/9.2.11.v20150529/jetty-io-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-security/9.2.11.v20150529/jetty-security-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-server/9.2.11.v20150529/jetty-server-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-servlet/9.2.11.v20150529/jetty-servlet-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-util/9.2.11.v20150529/jetty-util-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-webapp/9.2.11.v20150529/jetty-webapp-9.2.11.v20150529.jar
    C:/Users/DiebolPa/.m2/repository/org/eclipse/jetty/jetty-xml/9.2.11.v20150529/jetty-xml-9.2.11.v20150529.jar
    C:/Users/DiebolPa/workspace/jetty-authentication-example/target/classes
    2016-11-15 18:46:38.952:INFO:oejs.Server:jetty-8.1.14.v20131031
    2016-11-15 18:46:39.166:INFO::main: Logging initialized @2835ms
    2016-11-15 18:46:39.205:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@5891e32e in org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20
    java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@5891e32e in org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20
    at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:61)
    at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:377)
    at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:453)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:124)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
    at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
    2016-11-15 18:46:39.206:WARN:oejuc.AbstractLifeCycle:FAILED org.eclipse.jetty.server.session.SessionHandler@8e24743: java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@5891e32e in org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20
    java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@5891e32e in org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20
    at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:61)
    at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:377)
    at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:453)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:124)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
    at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
    2016-11-15 18:46:39.207:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/C:/Users/DiebolPa/workspace/jetty-authentication-example/src/main/webapp/},C:\Users\DiebolPa\workspace\jetty-authentication-example\src\main\webapp
    java.lang.IllegalStateException: No LoginService for org.eclipse.jetty.security.authentication.BasicAuthenticator@5891e32e in org.eclipse.jetty.security.ConstraintSecurityHandler@cb0ed20
    at org.eclipse.jetty.security.authentication.LoginAuthenticator.setConfiguration(LoginAuthenticator.java:61)
    at org.eclipse.jetty.security.SecurityHandler.doStart(SecurityHandler.java:377)
    at org.eclipse.jetty.security.ConstraintSecurityHandler.doStart(ConstraintSecurityHandler.java:453)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.session.SessionHandler.doStart(SessionHandler.java:124)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.handler.ScopedHandler.doStart(ScopedHandler.java:115)
    at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:763)
    at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
    at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1242)
    at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
    at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:494)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
    at org.eclipse.jetty.server.Server.doStart(Server.java:282)
    at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedAdapter.start(JettyEmbeddedAdapter.java:67)
    at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:84)
    at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)
    2016-11-15 18:46:39.484:INFO:oejs.AbstractConnector:Started SelectChannelConnector@0.0.0.0:8080
    ------------------------------------------------
        Jetty startup finished in 2,7 s.
        Used memory: 5,4 MB of 123,0 MB (1,8 GB maximum)
    Console available: type "help".
    ------------------------------------------------
如果我打开,页面如下所示:

HTTP ERROR: 503

Problem accessing /. Reason:

Service Unavailable

Powered by Jetty:// 
非常感谢您的帮助