Re: Workers, workers, how do they work??

2005-03-10 Thread Adrian Robert
On Mar 10, 2005, at 2:29 PM, Klaus-F. Kaal wrote:
I am not really sure that I understand the workers right.
I interface Apache 2.0.48 with Tomcat 5.0.28 via mod_jk.
It looks like you're trying to use a mod_jk2 config file format with 
mod_jk.  You want a file (better called "workers.properties") w/the 
following:

workers.tomcat_home= [insert CATALINA_BASE here]
workers.java_home= [insert JAVAHOME here]
ps=/
worker.list=worker1
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=1
worker.loadbalancer.type=lb
worker.loadbalancer.balanced_workers=worker1
(You can tweak the load balancing lines.)
Also, make sure the JkWorkersFile in httpd.conf occurs outside of any 
VirtualHost section.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Working fine on Tomcat 5.0 but not on 5.5.7

2005-03-07 Thread Adrian Robert
On Mar 7, 2005, at 10:21 AM, micky none wrote:
Hi Friends,
I have this simple method which works fine on my system(Tomcat 5.0,jdk 
1.5)..but not on the server(Tomcat 5.5.7,jdk1.5).Can someone explain 
me why:
See the thread just before this on JDK1.5 -- Java 1.5 is supported in 
servlets but not JSP due to a limitation in the JSP compiler.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-03 Thread Adrian Robert
OK, thanks to your vote of confidence in the method, I dug further 
and
discovered that my WEB-INF/classes/log4j.properties was never being
found.  If I put the log4j.properties into the same jar (in
WEB-INF/lib) with the class that was instantiating the Logger, it
worked correctly.

That's extremely odd.  What version of Tomcat are you running?  
That's a bug
because WEB-INF/classes should be put in the classpath before jars in
WEB-INF/lib.
This is 5.5.7, with the 1.4 compatibility package on MacOS.  I've 
experienced similar issues before with different tomcat versions, 
though I had forgotten that in this case..

Note I do NOT unpack the app from a war, just copy the full hierarchy 
straight under webapps.  Also, the WEB-INF/classes/log4j.properties 
file was a symblic link.  Maybe one of these makes a difference?
It turns out it WAS the symbolic link.  I get the following results:
- symbolic link, relative (e.g., WEB-INF/classes/log4j.properties -> 
resources/log4j.properties): not found

- symbolic link, absolute (e.g., WEB-INF/classes/log4j.properties -> 
/usr/java/tomcat/webapps/foo/WEB-INF/classes/resources/log4j.properties 
- OR - regular file: found and prevents common/classes/log4j.properties 
from being found (tomcat-general stuff goes into webapp's log file)

- file in jar with class that instantiates Logger: both tomcat's 
(common/classes/) and webapp's log4j.properties are found and heeded

Sorry about the bother if this is just standard knowledge of how tomcat 
operates on Unix.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-03 Thread Adrian Robert
OK, thanks to your vote of confidence in the method, I dug further and
discovered that my WEB-INF/classes/log4j.properties was never being
found.  If I put the log4j.properties into the same jar (in
WEB-INF/lib) with the class that was instantiating the Logger, it
worked correctly.
That's extremely odd.  What version of Tomcat are you running?  That's 
a bug
because WEB-INF/classes should be put in the classpath before jars in
WEB-INF/lib.
This is 5.5.7, with the 1.4 compatibility package on MacOS.  I've 
experienced similar issues before with different tomcat versions, 
though I had forgotten that in this case..

Note I do NOT unpack the app from a war, just copy the full hierarchy 
straight under webapps.  Also, the WEB-INF/classes/log4j.properties 
file was a symblic link.  Maybe one of these makes a difference?

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-03 Thread Adrian Robert
Understandable.  I was a little dismayed to see that what had been more
automatic in Tomcat-5.0.xx had become less so in Tomcat-5.5.  What I 
mean is,
in Tomcat-5.0.xx, one could add a  to the context 
configuration file,
deploy that with the webapp, and dynamically get a log file for
ServletContext.log() output.  In Tomcat-5.5, one has to have this in 
the logger
config file at Tomcat startup, therefore forcing one to predict the 
apps that
will be deployed to the appserver during runtime
...
 I was trying to achieve this with multiple
separate log4j.properties, one in the container (common/classes/) for
the uncaught stack trace and other general logging, and others in each
webapp.  With my setup below I was expecting to get THREE files:
catalina.out (with stdout/err), tomcat.log (with the container's log4j
output), and bar.log (with the webapp's log4j output, which I changed
from ServletContext.log() to use Logger.info()).  Instead, I got only
catalina.out and tomcat.log, the latter containing everything that I
thought the webapp would be sending to bar.log.
And this should have worked.  It works in every case I have ever 
tried.  I
suggest you double and triple check that you have log4j.jar in both 
common/lib
and WEB-INF/lib and make sure you have log4j.properties in both 
common/classes
and WEB-INF/classes.
OK, thanks to your vote of confidence in the method, I dug further and 
discovered that my WEB-INF/classes/log4j.properties was never being 
found.  If I put the log4j.properties into the same jar (in 
WEB-INF/lib) with the class that was instantiating the Logger, it 
worked correctly.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Migration from Tomcat 4.1 to Tomcat 5.0

2005-03-02 Thread Adrian Robert
On Mar 2, 2005, at 9:39 AM, Kiran Patel wrote:
Thank you.
I setup an environment variable JAVS_HOME and it is working now.
Now, I have another question.  How to setup a context?  In Tomcat 4.1,  
I have it in server.xml.  What I found from the documentation is that  
to create a separate file for context, but I don't know where to put  
the file and what to include in it.  The context for my webapps in  
server.xml is as follow.  Please help.
Put the  tag and everything it contains in a file named CA.xml  
(maybe the name can be anything) and put it in  
$CATALINA_BASE/conf/Catalina/localhost/ .  You can also toss it in a  
META-INF directory under your web-app, but I'm not sure if this goes at  
the top level or under WEB-INF.



 
   
   
  
   
factoryorg.apache.commons.dbcp.BasicDataSourceFactory

  
  maxActive100
  
  maxIdle30
  
   maxWait1
   
   usernamesa
   passwordadmin
   

driverClassNamesun.jdbc.odbc.JdbcOdbcDriver

   

urljdbc:odbc:cms-rms

 
 
Kiran Patel
Software Engineer
Solutions Inc.
817.637.9060 [Work]

hi!

look at your environment-variables JAVA_HOME should be set correctly!


hth

-Christianx

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-02 Thread Adrian Robert
On Mar 2, 2005, at 12:25 AM, Jacob Kjome wrote:
You first talk about ServletContext.log(), but then talk about log4j  
loggers in your app.  These are two completely separate things.  Which  
were you focusing on?  With your setup, it it makes sense that  
ServletContext.log() messages are going to catalina.log.  However, if  
you have log4j.jar in WEB-INF/lib and your application log4j logging  
is going to catalina.log, then your setup is different than what you  
describe here.  There is quite simply no way that can happen given the  
setup you've described.  They should go to "bar.log" since that's the  
only appender that your application's log4j configuration can see.  In  
any case, you don't need a separate log4j.jar in WEB-INF/lib for  
ServletContext.log() messages to go to app-specific log files.  Just  
define those in your log4j.properties just like you have defined the  
host logger.  Here's my setup for Log4j-1.2.9 in  
common/classes.log4j.properties (You can use log4j.xml when using  
Log4j-1.3 because it uses a the new JoranConfigurator which doesn't  
define a log4j.dtd.  The current DOMConfigurator's dtd defines the  
 "name" attribute as an ID and the host and context logger  
names that Tomcat uses characters not allowed in attributes of type  
"id")
Thanks for your input.. I realize I wasn't clear about one thing.  I  
don't want to define webapp-specific logging in the tomcat-global  
log4j.properties file.  Instead, I want individual log4j.properties  
stored under webapp/*/WEB-INF/classes to cause logging to web-app  
specific files, without the container needing to be hard-coded for the  
webapps it is hosting.  I was trying to achieve this with multiple  
separate log4j.properties, one in the container (common/classes/) for  
the uncaught stack trace and other general logging, and others in each  
webapp.  With my setup below I was expecting to get THREE files:  
catalina.out (with stdout/err), tomcat.log (with the container's log4j  
output), and bar.log (with the webapp's log4j output, which I changed  
from ServletContext.log() to use Logger.info()).  Instead, I got only  
catalina.out and tomcat.log, the latter containing everything that I  
thought the webapp would be sending to bar.log.


...
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localho 
st].[/myapp]=INFO, MYAPP
log4j.additivity.org.apache.catalina.core.ContainerBase.[Catalina].[loc 
alhost].[/myapp]=false
I don't understand this bracket notation.  Is it documented anywhere?   
Is interpretation of it something implemented by tomcat or by log4j?   
Would it help me achieve what I'm trying to get without changing my  
webapp's code away from ServletContext.log()?


BTW, you don't need commons-logging in your webapp.  It is only Tomcat  
that needs it, so just put it in common/lib, not WEB-INF/lib.  You can  
continue to put log4j.jar in both places if you desire.  Otherwise,  
you can also use a repository selector to separate webapp logging with  
a single log4j.jar in common/lib.  This makes more sense to start  
doing with Log4j-1.3, though, using the ContextJNDISelector.  You get  
the same effect by having log4j.jar in WEB-INF/lib since the  
classloader isolation will, effectively, create logging isolation per  
webapp.
Hmm..  I'm using log4j-1.2.9.  I had the jar in both places but wasn't  
getting the isolation since my webapp was still pumping things into  
tomcat.log according to the container's log4j.properties..  However,  
I'm creating the logger in a static block in one of my webapp's classes  
-- could that have been the issue?



At 06:18 PM 3/1/2005 -0500, you wrote:
>I'm having trouble approximating the earlier tomcat per-context
> functionality using log4j under tomcat-5.5.  Basically, I
>would like to have one file coming out under $CATALINA_BASE/logs/ per
>web application context.  This appears to be no longer possible  
through
>ServletContext.log().  So I tried using log4j:
>
>1) put log4j.jar, commons-logging.jar in common/lib AND
>webapps/*/WEB-INF/lib
>2) put log4j.properties in common/classes AND  
webapps/*/WEB-INF/classes
>
>However, I can't seem to find the right combination of  
log4j.properties
>lines, or maybe I'm trying something impossible.  (I can't find good
>docs on the uses of log4j.properties when used inside the hierarchical
>classloading context that tomcat provides.)  What keeps happening is
>that the webapp's log statements keep going into the global tomcat  
log.
>  Would I be better off with JDK logging instead?
>
>common/classes/log4j.properties
>---
>log4j.rootLogger   info, R
>log4j.appender.R   org.apache.log4j.RollingFileAppender
>log4j.appender.R.File  ${catalina.base}/logs/tomcat.log
>log4j.appender.R.MaxFileSize   10MB
>log4j.appender.R.MaxBackupIndex10
>log4j.appender.R.layoutorg.apache.log4j.PatternLayout
>
>log4j.appender.R.layout.ConversionPattern  %p %t %c - %m

Re: How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-02 Thread Adrian Robert
On Mar 1, 2005, at 6:45 PM, Remy Maucherat wrote:
On Tue, 01 Mar 2005 18:18:49 -0500, Adrian Robert
<[EMAIL PROTECTED]> wrote:
However, I can't seem to find the right combination of 
log4j.properties
lines, or maybe I'm trying something impossible.  (I can't find good
docs on the uses of log4j.properties when used inside the hierarchical
classloading context that tomcat provides.)  What keeps happening is
that the webapp's log statements keep going into the global tomcat 
log.
  Would I be better off with JDK logging instead?
I am working at the moment on a small package (which will be an
implementation of java.util.logging) which will allow you doing that
using the JDK logging. The main issue with it as supplied in the JDK
is that there is only one global configuration per JVM. The trick is
to make that per classloader, with delegation, so that webapps are
isolated. At the moment, I think log4j is your only choice
(unfortunately, I'm no expert, so I can't give you tricks with this
particular configuration).
In the same package, I will also provide a handler with daily rotation.
It should be done by the end of the week (it doesn't work at the
moment, I'm busy debugging ;) ).
Great news.  I'm happy to help test this.  I'd rather use JDK logging 
than log4j if possible to avoid an additional deployment dependency.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


How to approximate tomcat-5.0/4.x/3.x logging in 5.5?

2005-03-01 Thread Adrian Robert
I'm having trouble approximating the earlier tomcat per-context  
 functionality using log4j under tomcat-5.5.  Basically, I  
would like to have one file coming out under $CATALINA_BASE/logs/ per  
web application context.  This appears to be no longer possible through  
ServletContext.log().  So I tried using log4j:

1) put log4j.jar, commons-logging.jar in common/lib AND  
webapps/*/WEB-INF/lib
2) put log4j.properties in common/classes AND webapps/*/WEB-INF/classes

However, I can't seem to find the right combination of log4j.properties  
lines, or maybe I'm trying something impossible.  (I can't find good  
docs on the uses of log4j.properties when used inside the hierarchical  
classloading context that tomcat provides.)  What keeps happening is  
that the webapp's log statements keep going into the global tomcat log.  
 Would I be better off with JDK logging instead?

common/classes/log4j.properties
---
log4j.rootLoggerinfo, R
log4j.appender.Rorg.apache.log4j.RollingFileAppender
log4j.appender.R.File   ${catalina.base}/logs/tomcat.log
log4j.appender.R.MaxFileSize10MB
log4j.appender.R.MaxBackupIndex 10
log4j.appender.R.layout org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern   %p %t %c - %m%n
#log4j.logger.org.apache.catalina   info, R
#log4j.logger.org.apache.catalina.session   info, R
#log4j.logger.org.apache.catalina.session.ManagerBase   info, R
log4j.logger.org.apache.catalina.core.ContainerBase.[Catalina].[localhos 
t]=info, R
---

webapp/*/classes/log4j.properties
---
# is this necessary?  tried with and without...
log4j.rootLoggerinfo, A1
log4j.category.com.foo  , A1
log4j.appender.A1   org.apache.log4j.DailyRollingFileAppender
log4j.appender.A1.File  ${catalina.base}/logs/bar.log
log4j.appender.A1.MaxFileSize   10MB
log4j.appender.A1.MaxBackupIndex10
log4j.appender.A1.layoutorg.apache.log4j.PatternLayout
log4j.appender.A1.Appendtrue
log4j.appender.A1.layout.ConversionPattern  %p %t %c - %m%n
log4j.logger.com.fooinfo, A1
---
Code in webapp:
---
Logger logger = Logger.getLogger("com.foo");
logger.info("bar");
---
Any help appreciated..
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]