Thanks Jan,
Seeing that the HashLoginService is sufficient, and that it is
associated with a realm, I found
https://wiki.eclipse.org/Jetty/Tutorial/Realms
and per that I added an /etc/jetty.xml file:
<Configure id="Server"
class="org.eclipse.jetty.server.Server">
<Call name="addBean">
<Arg>
<New
class="org.eclipse.jetty.security.HashLoginService">
<Set name="name">Test Realm</Set>
<Set name="config"><SystemProperty
name="jetty.home"
default="."/>/etc/realm.properties</Set>
<Set name="refreshInterval">0</Set>
</New>
</Arg>
</Call>
</Configure>
However when I start jetty with this file and a simple
etc/realm.properties file, I get this on loading the standard
jetty-http.xml:
2015-09-29 23:28:12.676:WARN:oejx.XmlConfiguration:main: Config
error at <Call name="addConnector"><Arg>| <New
id="httpConnector"
class="org.eclipse.jetty.server.ServerConnector"><Arg
name="server"><Ref refid="Server"/></Arg><Arg
name="acceptors" type="int"><Property
name="jetty.http.acceptors" deprecated="http.acceptors"
default="-1"/></Arg><Arg name="selectors"
type="int"><Property name="jetty.http.selectors"
deprecated="http.selectors" default="-1"/></Arg><Arg
name="factories">| <Array
type="org.eclipse.jetty.server.ConnectionFactory"><Item>|
<New
class="org.eclipse.jetty.server.HttpConnectionFactory"><Arg
name="config"><Ref
refid="httpConfig"/></Arg></New>|
</Item></Array>| </Arg><Set
name="host"><Property name="jetty.http.host"
deprecated="jetty.host"/></Set><Set
name="port"><Property name="jetty.http.port"
deprecated="jetty.port" default="8080"/></Set><Set
name="idleTimeout"><Property name="jetty.http.idleTimeout"
deprecated="http.timeout" default="30000"/></Set><Set
name="soLingerTime"><Property name="jetty.http.soLingerTime"
deprecated="http.soLingerTime"
default="-1"/></Set><Set
name="acceptorPriorityDelta"><Property
name="jetty.http.acceptorPriorityDelta"
deprecated="http.acceptorPriorityDelta"
default="0"/></Set><Set
name="acceptQueueSize"><Property
name="jetty.http.acceptQueueSize"
deprecated="http.acceptQueueSize"
default="0"/></Set></New>|
</Arg></Call>
java.lang.reflect.InvocationTargetException in
file:/Users/priot/jetty/org.eclipse.jetty.project/jetty-distribution/target/distribution/etc/jetty-http.xml
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.jetty.start.Main.invokeMain(Main.java:214)
at org.eclipse.jetty.start.Main.start(Main.java:457)
at org.eclipse.jetty.start.Main.main(Main.java:75)
Caused by: java.lang.reflect.InvocationTargetException
at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at
java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at
org.eclipse.jetty.util.TypeUtil.construct(TypeUtil.java:627)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:782)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1233)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1138)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newArray(XmlConfiguration.java:860)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1237)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1138)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.newObj(XmlConfiguration.java:766)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.itemValue(XmlConfiguration.java:1233)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.value(XmlConfiguration.java:1138)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.access$500(XmlConfiguration.java:274)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$AttrOrElementNode.getList(XmlConfiguration.java:1366)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration$AttrOrElementNode.getList(XmlConfiguration.java:1341)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.call(XmlConfiguration.java:704)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:417)
at
org.eclipse.jetty.xml.XmlConfiguration$JettyXmlConfiguration.configure(XmlConfiguration.java:358)
at
org.eclipse.jetty.xml.XmlConfiguration.configure(XmlConfiguration.java:259)
at
org.eclipse.jetty.xml.XmlConfiguration$1.run(XmlConfiguration.java:1498)
at java.security.AccessController.doPrivileged(Native
Method)
at
org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:1435)
... 7 more
Caused by: java.lang.IllegalArgumentException: Null
HttpConfiguration
at
org.eclipse.jetty.server.HttpConnectionFactory.<init>(HttpConnectionFactory.java:45)
... 31 more
Speaking of problems, I just did a git pull in case the problem
was an earlier pull, and got this on building:
[ERROR] symbol: class NamingContext <== seems to be gone
[ERROR] location: class
org.eclipse.jetty.jndi.local.localContextRoot
Thanks,
Bill
On 9/29/2015 6:44 PM, Jan Bartel wrote: