User: starksm 
  Date: 01/11/11 00:10:48

  Modified:    catalina/src/main/org/jboss/web/catalina Tag: Branch_2_4
                        EmbeddedCatalinaServiceSX.java
  Log:
  Fixes for sourceforge bugs #471225 and #475302
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +25 -4     
contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java
  
  Index: EmbeddedCatalinaServiceSX.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/contrib/catalina/src/main/org/jboss/web/catalina/EmbeddedCatalinaServiceSX.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- EmbeddedCatalinaServiceSX.java    2001/09/30 21:06:07     1.2
  +++ EmbeddedCatalinaServiceSX.java    2001/11/11 08:10:48     1.2.2.1
  @@ -50,6 +50,8 @@
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
   import org.apache.catalina.Realm;
  +import org.apache.catalina.Valve;
  +import org.apache.catalina.authenticator.AuthenticatorBase;
   import org.apache.catalina.connector.http.HttpConnector;
   import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.loader.WebappClassLoader;
  @@ -63,7 +65,7 @@
    @see org.apache.catalina.startup.Embedded
    
    @author [EMAIL PROTECTED]
  - @version $Revision: 1.2 $
  + @version $Revision: 1.2.2.1 $
    */
   public class EmbeddedCatalinaServiceSX extends AbstractWebContainer implements 
EmbeddedCatalinaServiceSXMBean
   {
  @@ -243,6 +245,11 @@
      protected WebApplication performDeploy(String ctxPath, String warUrl,
         WebDescriptorParser webAppParser) throws Exception
      {
  +      if( ctxPath.equals("/") )
  +      {
  +       category.info("Changing root context path from '/' to ''");
  +       ctxPath = "";
  +      }
         category.info("deploy, ctxPath="+ctxPath+", warUrl="+warUrl);
         ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
   
  @@ -292,9 +299,6 @@
         engine.addChild(catalinaHost);
         engine.setParentClassLoader(parent);
   
  -      Context root = catalina.createContext("", webAppsRoot);
  -      catalinaHost.addChild(root);
  -
         // Install the assembled container hierarchy
         catalina.addEngine(engine);
   
  @@ -325,6 +329,7 @@
         final WebApplication appInfo = new WebApplication(warUrl.getPath(), warUrl, 
loader);
         final StandardContext context = (StandardContext) 
catalina.createContext(ctxPath, warUrl.getFile());
         context.setParentClassLoader(loader);
  +
         /* We need to establish the JNDI ENC prior to the start of the web container
          so that init on startup servlets are able to interact with their ENC. We
          hook into the context lifecycle events to be notified of the start of the
  @@ -368,6 +373,22 @@
                  return;
               }
   
  +            /* We need to go through the context valves and set the cache flag
  +             on any AuthenticatorBase to false or else the JBossSecurityMgrRealm
  +             is not asked to authenticate every request. This can result in
  +             an authenticated user thread not receiving its authenticated
  +             Subject and this results in an authorization failure.
  +             */
  +            Valve[] valves = ((StandardContext)context).getValves();
  +            for(int v = 0; v < valves.length; v ++)
  +            {
  +               Valve valve = valves[v];
  +               if( valve instanceof AuthenticatorBase )
  +               {
  +                  AuthenticatorBase auth = (AuthenticatorBase) valve;
  +                  auth.setCache(false);
  +               }
  +            }
               // Get the web-app.xml and jboss-web.xml deployment descriptors 
               DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
               DocumentBuilder parser = factory.newDocumentBuilder();
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to