[jboss-jira] [JBoss JIRA] Updated: (JBAS-6562) Context entries don't work as explained in tomcat docs.

Jason T. Greene (JIRA) jira-events at lists.jboss.org
Mon Apr 13 14:32:23 EDT 2009


     [ https://jira.jboss.org/jira/browse/JBAS-6562?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason T. Greene updated JBAS-6562:
----------------------------------

    Fix Version/s: JBossAS-6.0.0.Alpha1
                       (was: JBossAS-Branch_4_2)
                       (was: JBossAS-5.1.0.CR1)


Rescheduling due to no activity

> Context entries don't work as explained in tomcat docs.
> -------------------------------------------------------
>
>                 Key: JBAS-6562
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6562
>             Project: JBoss Application Server
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: Web (Tomcat) service
>            Reporter: Vicky Kak
>            Assignee: Vicky Kak
>             Fix For: JBossAS-6.0.0.Alpha1
>
>
> The documentation about the context configuration in Tomcat does not work in JbossAS deployments.
> I have just spend some time looking at the related code at
> http://anonsvn.jboss.org/repos/jbossas/branches/JBPAPP_4_2/tomcat/src/main/org/jboss/web/tomcat/service/TomcatDeployer.java
> Here is the code snippet
> ****************************************************************
> private String findConfig(URL warURL) throws IOException
>   {
>      String result = null;
>      // See if the warUrl is a dir or a file
>      File warFile = new File(warURL.getFile());
>      if (warURL.getProtocol().equals("file") && warFile.isDirectory() == true)
>      {
>         File webDD = new File(warFile, CONTEXT_CONFIG_FILE);
>         if (webDD.exists() == true) result = webDD.getAbsolutePath();
>      }
>      else
>      {
>         ZipFile zipFile = new ZipFile(warFile);
>         ZipEntry entry = zipFile.getEntry(CONTEXT_CONFIG_FILE);
>         if (entry != null)
>         {
>            InputStream zipIS = zipFile.getInputStream(entry);
>            byte[] buffer = new byte[512];
>            int bytes;
>            result = warFile.getAbsolutePath() + "-context.xml";
>            FileOutputStream fos = new FileOutputStream(result);
>            while ((bytes = zipIS.read(buffer)) > 0)
>            {
>               fos.write(buffer, 0, bytes);
>            }
>            zipIS.close();
>            fos.close();
>         }
>         zipFile.close();
>      }
>      return result;
>   }
> ****************************************************************
> This code needs to be modified in such a way that it uses these configurations
> **************************************************************************************
> 1. in the $CATALINA_HOME/conf/[enginename]/[hostname]/context.xml.default file: the Context element information will be loaded by all webapps of that host
> 2. in individual files (with a ".xml" extension) in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory. The name of the file (less the .xml) extension will be used as the context path. Multi-level context paths may be defined using #, e.g. context#path.xml. The default web application may be defined by using a file called ROOT.xml.
> 3. if the previous file was not found for this application, in an individual file at /META-INF/context.xml inside the application files
> inside a Host element in the main conf/server.xml
> **************************************************************************************
> The point[3] is already rejected earlier by Scott, here is the related jira
> https://jira.jboss.org/jira/browse/JBAS-2290

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list