Hi,
I am trying to implement basic keycloak login in my web application, but i cannot start
the Jetty server once the adapter has been installed. I have a custom web app that needs
to use Fispace keycloak authentiction and I have successfully integrated the Javascript
adapter, but I am having trouble with the Jetty adapter.
My Jetty version is 9.2.0.M0
Keycloak 1.3.1. Final
Keycloak Jetty 9.2 adapter is downloaded from :
http://sourceforge.net/projects/keycloak/files/1.3.1.Final/adapters/
Adapter is configured according to:
http://keycloak.github.io/docs/userguide/html/ch08.html#jetty9-adapter
I use keycloak.json provided from Fispace which is used also with the javascript adapter.
But when I try to run jetty, i get the following error:
2015-07-03 10:27:34.047:WARN:oejx.XmlConfiguration:main: Config error at <Set
name="authenticator">|???<New
class="org.keycloak.adapters.jetty.KeycloakJettyAuthenticator"/>|??</Set>
java.lang.NoSuchMethodException: class
org.eclipse.jetty.security.ConstraintSecurityHandler.setAuthenticator(class
org.keycloak.adapters.jetty.KeycloakJettyAuthenticator) in
file:/C:/Users/mrd/AppData/Local/Temp/jetty-0.0.0.0-8080-MVNJettyHello.war-_MVNJettyHello-any-5285823088457280813.dir/webapp/WEB-INF/jetty-web.xml
2015-07-03 10:27:34.047:WARN:oejx.XmlConfiguration:main: Config error at <Get
name="securityHandler"><Set name="authenticator">|???<New
class="org.keycloak.adapters.jetty.KeycloakJettyAuthenticator"/>|??</Set></Get>
java.lang.NoSuchMethodException: class
org.eclipse.jetty.security.ConstraintSecurityHandler.setAuthenticator(class
org.keycloak.adapters.jetty.KeycloakJettyAuthenticator) in
file:/C:/Users/mrd/AppData/Local/Temp/jetty-0.0.0.0-8080-MVNJettyHello.war-_MVNJettyHello-any-5285823088457280813.dir/webapp/WEB-INF/jetty-web.xml
2015-07-03 10:27:34.057:WARN:oejw.WebAppContext:main: Failed startup of context
o.e.j.w.WebAppContext@13fcdbd{/MVNJettyHello,file:/C:/Users/mrd/AppData/Local/Temp/jetty-0.0.0.0-8080-MVNJettyHello.war-_MVNJettyHello-any-5285823088457280813.dir/webapp/,STARTING}{C:\jetty\jetty-distribution-9.2.11.v20150529\webapps\MVNJettyHello.war}
java.lang.NoSuchMethodException: class
org.eclipse.jetty.security.ConstraintSecurityHandler.setAuthenticator(class
org.keycloak.adapters.jetty.KeycloakJettyAuthenticator)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(XmlConfiguration.java:582)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:411)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.get(XmlConfiguration.java:662)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:420)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:298)
at org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:248)
at
org.eclipse.jetty.webapp.JettyWebXmlConfiguration.configure(JettyWebXmlConfiguration.java:102)
at org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:479)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1337)
at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:741)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:505)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.eclipse.jetty.deploy.bindings.StandardStarter.processBinding(StandardStarter.java:41)
at org.eclipse.jetty.deploy.AppLifeCycle.runBindings(AppLifeCycle.java:186)
at org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(DeploymentManager.java:498)
at org.eclipse.jetty.deploy.DeploymentManager.addApp(DeploymentManager.java:146)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider.fileAdded(ScanningAppProvider.java:180)
at org.eclipse.jetty.deploy.providers.WebAppProvider.fileAdded(WebAppProvider.java:455)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(ScanningAppProvider.java:64)
at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:609)
at org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:528)
at org.eclipse.jetty.util.Scanner.scan(Scanner.java:391)
at org.eclipse.jetty.util.Scanner.doStart(Scanner.java:313)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.eclipse.jetty.deploy.providers.ScanningAppProvider.doStart(ScanningAppProvider.java:150)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.eclipse.jetty.deploy.DeploymentManager.startAppProvider(DeploymentManager.java:560)
at org.eclipse.jetty.deploy.DeploymentManager.doStart(DeploymentManager.java:235)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:132)
at org.eclipse.jetty.server.Server.start(Server.java:387)
at
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:114)
at org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:61)
at org.eclipse.jetty.server.Server.doStart(Server.java:354)
at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1255)
at java.security.AccessController.doPrivileged(Native Method)
at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1174)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:321)
at org.eclipse.jetty.start.Main.start(Main.java:817)
at org.eclipse.jetty.start.Main.main(Main.java:112)