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.
<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>
|
Where
CONTEXT PATH is the context path you want to assign to your webappLOCATION OF WEBAPP is the location of the war or expanded war of your webappUse a jetty-web.xml or a jetty-env.xml file to set the server classes, like so:
<?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>
|