Make a new jetty base directory for this. Put your webapp into it. Enable
modules such as http,  security, deploy, and ext and any others you might
need   (take a look at $jetty.home/demo-base/ to get some ideas).  Put your
jar with the LoginService impl into your jetty base lib/ext directory.
Then, take the lines from your WEB-INF/jetty-web.xml file that sets up the
login service and put them into a context xml file for your webapp so they
are read first, rather than last as is the case with jetty-web.xml when
configuring your webapp.

Finally, if its still not working, open an issue and attach a small
reproduction test case and we'll take a close look.

cheers
Jan

On 24 May 2017 at 16:51, mortac8 <[email protected]> wrote:

> Thanks for your help!  Below is my full log.  I am using jetty-9.4.2
> though I
> have tried 8.1.9 and 9.4.5 as well.
>
> I still get the same error no matter where I put my "MyLoginService".  It
> had been in my .war but per your suggestion I took it out of the war and
> built it into a standalone jar which I have tried putting in
> jetty.home/resources, or jetty.home/lib, or jetty.home/lib/ext, or using
> jetty-runner with the --lib flag.
>
> I still always get the same error:
>
> D:\jetty-distribution-9.4.2.v20170220>java -jar start.jar
> 2017-05-24 09:41:37.022:INFO::main: Logging initialized @2503ms to
> org.eclipse.jetty.util.log.StdErrLog
> 2017-05-24 09:41:37.641:WARN:oejs.HomeBaseWarning:main: This instance of
> Jetty is not running from a separate {jetty.base} directory, this is not
> reco
> mmended.  See documentation at
> http://www.eclipse.org/jetty/documentation/current/startup.html
> 2017-05-24 09:41:37.798:INFO:oejs.Server:main: jetty-9.4.2.v20170220
> 2017-05-24 09:41:37.875:INFO:oejdp.ScanningAppProvider:main: Deployment
> monitor [file:///D:/jetty-distribution-9.4.2.v20170220/webapps/] at
> interval
> 1
>
> 2017-05-24 09:41:38.976:INFO:oeja.AnnotationConfiguration:main: Scanning
> elapsed time=468ms
> Setting MyLoginService name to: testrealm
> 2017-05-24 09:41:39.050:WARN:oejx.XmlConfiguration:main: Config error at
> <Set name="authenticator">|      <New
> class="org.eclipse.jetty.security.authe
> ntication.FormAuthenticator"><Set name="alwaysSaveUri">true</Set></New>|
> </Set> java.lang.NoSuchMethodException: class org.eclipse.jetty.security.C
> onstraintSecurityHandler.setAuthenticator(class
> org.eclipse.jetty.security.authentication.FormAuthenticator) in
> file:/D:/jetty-distribution-9.4.2.v201
> 70220/webapps/a5-1.0-SNAPSHOT/WEB-INF/jetty-web.xml
> 2017-05-24 09:41:39.056:WARN:oejx.XmlConfiguration:main: Config error at
> <Get name="securityHandler"><Set name="loginService">|     |     <New
> class="
> com.mort.login.MyLoginService"><Set name="name">testrealm</Set><Set
> name="config">|        <SystemProperty name="jetty.home"
> default="."/>/etc/realm.p
> roperties</Set></New>|   </Set><Set name="authenticator">|      <New
> class="org.eclipse.jetty.security.authentication.FormAuthenticator"><Set
> name="al
> waysSaveUri">true</Set></New>|    </Set></Get>
> java.lang.NoSuchMethodException: class
> org.eclipse.jetty.security.ConstraintSecurityHandler.setAuthenti
> cator(class org.eclipse.jetty.security.authentication.FormAuthenticator)
> in
> file:/D:/jetty-distribution-9.4.2.v20170220/webapps/a5-1.0-SNAPSHOT/WEB-IN
> F/jetty-web.xml
> 2017-05-24 09:41:39.064:WARN:oejw.JettyWebXmlConfiguration:main: Error
> applying
> file:///D:/jetty-distribution-9.4.2.v20170220/webapps/a5-1.0-SNAPSHOT/
> WEB-INF/jetty-web.xml
> 2017-05-24 09:41:39.068:WARN:oejw.WebAppContext:main: Failed startup of
> context
> o.e.j.w.WebAppContext@cb644e{/,file:///D:/jetty-distribution-9.4.2.v20
> 170220/webapps/a5-1.0-SNAPSHOT/,UNAVAILABLE}{D:\jetty-distribution-9.4.2.
> v20170220\webapps\a5-1.0-SNAPSHOT}
> java.lang.NoSuchMethodException: class
> org.eclipse.jetty.security.ConstraintSecurityHandler.
> setAuthenticator(class
> org.eclipse.jetty.security.authenti
> cation.FormAuthenticator)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.set(
> XmlConfiguration.java:593)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.
> configure(XmlConfiguration.java:411)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.get(
> XmlConfiguration.java:675)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.
> configure(XmlConfiguration.java:420)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.
> configure(XmlConfiguration.java:300)
>         at
> org.eclipse.jetty.xml.XmlConfiguration.configure(
> XmlConfiguration.java:245)
>         at
> org.eclipse.jetty.webapp.JettyWebXmlConfiguration.lambda$configure$0(
> JettyWebXmlConfiguration.java:93)
>         at
> org.eclipse.jetty.webapp.WebAppClassLoader.runWithServerClassAccess(
> WebAppClassLoader.java:159)
>         at
> org.eclipse.jetty.webapp.JettyWebXmlConfiguration.configure(
> JettyWebXmlConfiguration.java:93)
>         at
> org.eclipse.jetty.webapp.WebAppContext.configure(WebAppContext.java:512)
>         at
> org.eclipse.jetty.webapp.WebAppContext.startContext(
> WebAppContext.java:1437)
>         at
> org.eclipse.jetty.server.handler.ContextHandler.
> doStart(ContextHandler.java:799)
>         at
> org.eclipse.jetty.servlet.ServletContextHandler.doStart(
> ServletContextHandler.java:261)
>         at
> org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:540)
>         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:188)
>         at
> org.eclipse.jetty.deploy.DeploymentManager.requestAppGoal(
> DeploymentManager.java:499)
>         at
> org.eclipse.jetty.deploy.DeploymentManager.addApp(
> DeploymentManager.java:147)
>         at
> org.eclipse.jetty.deploy.providers.ScanningAppProvider.
> fileAdded(ScanningAppProvider.java:180)
>         at
> org.eclipse.jetty.deploy.providers.WebAppProvider.
> fileAdded(WebAppProvider.java:437)
>         at
> org.eclipse.jetty.deploy.providers.ScanningAppProvider$1.fileAdded(
> ScanningAppProvider.java:64)
>         at org.eclipse.jetty.util.Scanner.reportAddition(Scanner.java:610)
>         at
> org.eclipse.jetty.util.Scanner.reportDifferences(Scanner.java:529)
>         at org.eclipse.jetty.util.Scanner.scan(Scanner.java:392)
>         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:561)
>         at
> org.eclipse.jetty.deploy.DeploymentManager.doStart(
> DeploymentManager.java:236)
>         at
> org.eclipse.jetty.util.component.AbstractLifeCycle.
> start(AbstractLifeCycle.java:68)
>         at
> org.eclipse.jetty.util.component.ContainerLifeCycle.
> start(ContainerLifeCycle.java:131)
>         at org.eclipse.jetty.server.Server.start(Server.java:452)
>         at
> org.eclipse.jetty.util.component.ContainerLifeCycle.
> doStart(ContainerLifeCycle.java:113)
>         at
> org.eclipse.jetty.server.handler.AbstractHandler.
> doStart(AbstractHandler.java:113)
>         at org.eclipse.jetty.server.Server.doStart(Server.java:419)
>         at
> org.eclipse.jetty.util.component.AbstractLifeCycle.
> start(AbstractLifeCycle.java:68)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1511)
>         at
> org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1438)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at
> org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1437)
>         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:222)
>         at org.eclipse.jetty.start.Main.start(Main.java:486)
>         at org.eclipse.jetty.start.Main.main(Main.java:79)
> 2017-05-24 09:41:39.159:INFO:oejs.AbstractConnector:main: Started
> ServerConnector@4b53f538{HTTP/1.1,[http/1.1]}{0.0.0.0:8080}
> 2017-05-24 09:41:39.161:INFO:oejs.Server:main: Started @4643ms
>
>
>
> --
> View this message in context: http://jetty.4.x6.nabble.com/
> Jetty-custom-LoginService-question-tp4966621p4966623.html
> Sent from the Jetty User mailing list archive at Nabble.com.
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>



-- 
Jan Bartel <[email protected]>
www.webtide.com
*Expert assistance from the creators of Jetty and CometD*
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to