Wednesday, February 10, 2010

Jetty 7 maven plugin authentication realms

The configuration directive UserRealm seems to no longer work with the jetty 7 maven plugin (jetty-maven-plugin). I received the following error:

java.lang.IllegalStateException: No LoginService for in ConstraintSecurityHandler@28f52a14@

Fixing this involved:

  • Creating a jetty configuration file, such as the following:

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "">
    <Configure class="org.eclipse.jetty.webapp.WebAppContext">
      <Get name="securityHandler">
        <Set name="loginService">
          <New class="">
            <Set name="name">YourSecurityRealmHere</Set>
            <Set name="config">src/test/resources/</Set>
            <Call name="start"/>
        <Set name="checkWelcomeFiles">true</Set>

    To be saved as src/test/resources/jetty-test.xml

  • Create a src/test/resources/ with your Jetty 7 password file.

  • Updating the jetty configuration in my pom.xml:


    The important entry is webAppXML. The extra dependency to jetty-servlets was added to support GZip in Jetty 7.


  1. Hi Max,
    Thanks for the tip.

    I found also something usefull if you have to manage multimodule projects.

    Instead of setting up the LoginService in the jetty-test.xml file, you can provide it within the pom.xml file which allows you to use ${} elements :

    <loginService implementation="">

    Hope this helps.

  2. Thanks, your solution worked perfectly.

  3. Throughout the entire new player registration and deposit course of, the customer service group is out there for any questions you may have|you may have|you would possibly have}. If you’d wish to read up more on registering at the on line casino, take a look at|check out} our How-To guide for more data. As any major on line casino 온라인 카지노 fan will know, entry to|gaining entry to|having entry to} atempting welcome bonusis an important component to any on line casino experience. With their years of experience, Spin Casino is a model who recognise this and look to maintain their new prospects as pleased as potential. Most on-line casinos have quantity of} options for each desk recreation, however Hell Spin has tons of. There are ninety eight blackjack video games alone, including single deck and excellent pairs.

  4. In any case, the effortlessness of WordPress conceals a high level framework that, with a tad of additional information, can be made to do staggering things.