tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cox, Charlie" <c...@cincom.com>
Subject RE: Static class not working under multiple webapps deployment
Date Tue, 15 Oct 2002 14:27:58 GMT
sorry, I am not familiar with Visual Cafe. It must be implementing its own
classloader somehow or making your jars available to the bootstrap.

Charlie 

> -----Original Message-----
> From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> Sent: Tuesday, October 15, 2002 9:50 AM
> To: 'Tomcat Users List'
> Subject: RE: Static class not working under multiple webapps 
> deployment
> 
> 
> That's where it is running (WEB-INF/classes/com/.....). The 
> problem might be
> that I am running Tomcat under Visual Café 4.51 expert 
> edition. Without any
> changes I run Tomcat from the command line and it works like magic. No
> problems.
> 
> I wonder how running under Visual Café can affect the 
> classloader for the
> webapp? 
> 
> Maybe it's because I have to list the jar's for Tomcat in the 
> Café classpath
> and this somehow screws things up. It won't compile if I don't do this
> obviously...
> Any ideas on how to get over this are welcome...
> 
> 
> On a similar note, I am using log4j for logging and under 
> café the logging
> for each webapp is configured from whichever log4j.xml file I 
> modify last.
> Running from the command line allows the setting for each 
> webapp too be
> configured seperatly (ie: debug, warn, error levels). Catch 
> 23 here too in
> that I must include log4j.jar in the classpath to compile the code.
> 
> Any idea how to get around this behaviour?
> Donie
> 
> Note: I have the following jar's in the Café classpath
> 
> bootstrap.jar
> catalina.jar
> slflogger.jar
> servlets-defaults.jar
> xerces.jar
> servlets-common.jar
> servlets-invoker.jar
> servlet.jar
> naming-common.jar
> naming-resource.jar
> log4j.jar
> 
> 
> 
> 
> 
> -----Original Message-----
> From: Cox, Charlie [mailto:ccox@cincom.com]
> Sent: 15 October 2002 14:29
> To: 'Tomcat Users List'
> Subject: RE: Static class not working under multiple webapps 
> deployment
> 
> where is this class located? if it is in /common/classes or 
> shared/classes,
> that is the correct result.
> 
> you will have to copy the .class file to each webapp under its
> WEB-INF/classes to get the result that you desire.
> 
> Charlie
> 
> > -----Original Message-----
> > From: Donie Kelly [mailto:donie.kelly@tecnomen.ie]
> > Sent: Tuesday, October 15, 2002 6:12 AM
> > To: 'Tomcat Users List'
> > Subject: Static class not working under multiple webapps deployment
> >
> >
> > Hi
> > I have written a static class which is populated with data on
> > startup of my
> > servlets and is suppose to be use in the context of the
> > request. However,
> > the static class seems to return the same information for all
> > webapps and
> > holds the configuration of the last servlet run on startup.
> > Here is the
> > code... As you can see I want to use something that looks like the
> > System.Properties but System.Properties is gloabal so it's no
> > use to me. I
> > want to be able to set the webapp name here so it's used
> > during processing
> > but at the moment it's only returning the last name
> > configured for the last
> > webapp.
> >
> > Any ideas why this is happening. What have I done wrong to
> > make this class
> > appear global?
> > Thanks
> > Donie
> >
> >
> > import org.apache.log4j.Category;
> > import java.util.Hashtable;
> > import java.util.Properties;
> > import java.io.InputStream;
> >
> > public class vMmsc
> > {
> > static Category log = Category.getInstance(vMmsc.class.getName());
> > public final static String version = "$Revision:   1.3 
> > $$Date:   10 Oct
> > 2002 11:57:48  $";
> > public static String getVersion() { return version; }
> > private static Properties props=new Properties();
> >
> >     // Defeats instantiation
> >     private vMmsc(){}
> >    
> >     public static void load(InputStream is)
> >     {
> >         try
> >         {
> >             props.load(is);      
> >         }
> >         catch(Exception ex)
> >         {
> >             log.error("Problem loading property file: " +
> > ex.getMessage());
> >
> >         }
> >     }
> >    
> >     public static void setProperty(String Name, String Value)
> >     {
> >         props.setProperty(Name, Value);
> >     }
> >    
> >     public static String getProperty(String Name)
> >     {
> >         String Value = props.getProperty(Name);
> >         if(Value==null || Value.equalsIgnoreCase(""))
> >             log.debug("The property value " + Name + " is not
> > defined");
> >         return Value;
> >     }
> >    
> >     public static String getProperty(String Name, String 
> defaultValue)
> >     {
> >         String Value = props.getProperty(Name);
> >         if(Value==null || Value.equalsIgnoreCase(""))
> >         {
> >             log.debug("The property value " + Name + " is
> > returning it's
> > default value");
> >             return defaultValue;
> >         }
> >         return Value;
> >     }
> >    
> >     public static Integer getInteger(String Name)
> >     {
> >         String Value = getProperty(Name);
> >         if(Value==null || Value.equalsIgnoreCase(""))
> >             log.debug("The property value " + Name + " is not
> > defined");
> >            
> >         return new Integer(Value);
> >     }
> >    
> >     public static Integer getInteger(String Name, int defaultValue)
> >     {
> >         String Value = getProperty(Name);
> >         if(Value==null || Value.equalsIgnoreCase(""))
> >         {
> >             log.debug("The property value " + Name + " is
> > returning it's
> > default value");
> >             return new Integer(defaultValue);
> >         }   
> >         return new Integer(Value);
> >     }
> >
> >     // Return true if property is enabled/yes/true
> >     public static boolean isEnabled(String Name)
> >     {
> >         String Value = getProperty(Name);
> >        
> >         if(Value!=null)
> >             if(Value.equalsIgnoreCase("yes") ||
> >                 Value.equalsIgnoreCase("true") ||
> >                 Value.equalsIgnoreCase("enabled") ||
> >                 Value.equalsIgnoreCase("1"))
> >                 return true;
> >         return false;   
> >     }
> > }
> >
> > --
> > To unsubscribe, e-mail:  
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message