Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Detailed Description

If you are experiencing ClassNotFound exceptions using JAAS with Jetty6.0.x the workaround is to put some extra configuration into the jetty.xml file to make the jetty jaas classes visible.

Remedy

For Jetty Standalone

Code Block
xml
xml
   
<New class="org.mortbay.jetty.webapp.WebAppContext">
      <Arg><Ref id="contexts"/></Arg>
      <Arg><SystemProperty name="jetty.home" default="."/>LOCATION OF WEBAPP</Arg>
      <Arg>/CONTEXT PATH</Arg>
      <!-- workaround for JAAS classloading issue for 6.0.x -->
      <Set name="serverClasses">
        <Array type="java.lang.String">
          <Item>-org.mortbay.jetty.plus.jaas.</Item>
          <Item>org.mortbay.jetty</Item>
          <Item>org.slf4j.</Item>
        </Array>
      </Set>
</New>

...

  • CONTEXT PATH is the context path you want to assign to your webapp
  • LOCATION OF WEBAPP is the location of the war or expanded war of your webapp

For the Jetty Maven Plugin

Use a jetty-web.xml or a jetty-env.xml file to set the server classes, like so:

Code Block
xml
xml

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<Configure class="org.mortbay.jetty.webapp.WebAppContext">
     <!-- workaround for JAAS classloading issue for 6.0.x -->
     <Set name="serverClasses">
         <Array type="java.lang.String">
          <Item>-org.mortbay.jetty.plus.jaas.</Item>
          <Item>org.mortbay.jetty</Item>
          <Item>org.slf4j.</Item>
        </Array>
      </Set>
</Configure>
Contact the core Jetty developers at www.webtide.com
private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services from 1 day to full product delivery