Dynamic logging configuration updates in Tomcat

2007-10-09 Thread Adam Gordon

Hi-

We have a web application in which we'd like to get dynamic logging 
working.  By dynamic logging, I mean live changes to the webapps' 
logging.properties file are read and applied without having to restart 
Tomcat.  We have all the code written and running but it appears to not 
work exactly as it should.  That is, I can change a logger's logging 
level once and it works, but if I change it again, it doesn't.  If I 
change the global logger level (.level) the change is picked up but, 
obviously, that affects ALL the loggers in our webapp.


I pulled the code out of tomcat and ran it as a stand-alone Java 
application and it works perfectly.  I then created a very tiny/simple 
webapp to run this logging code and the problem appears again.  I'm at a 
loss as to what Tomcat can possibly be doing to prevent the properties 
from being read subsequent times after the first change.


We're using the java.util.logging API and have our own LogHandler 
class.  We have a ServletContextListener that starts a background thread 
when the webapp starts up.  This background thread finds the 
logging.properties file for this webapp and if it has been modified in 
the last 60 second, creates an InputStream to this file and passes this 
InputStream to the LogManager.getLogManager().readConfiguration(...) 
method.  We are aware of this bug:  
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5035854 in the Java 
logging API, but we are using the workaround in this bug to reapply the 
logging levels.


If we can't find a solution to this using readConfiguration(...), we 
have a solution we've not tried which is to read the properties file 
ourselves, and loop over the loggers applying any levels that have 
changed - which is exactly what the LogManager is doing - but at least 
this is our code.  Again, we've not tried this brute-force method yet, 
so I don't know if it will work.


Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dynamic logging configuration updates in Tomcat

2007-10-11 Thread Adam Gordon
Wow, no one had any ideas as to what is going on?

Anyway.  We never figured out why Tomcat has an issue with this, but we
found a suitable workaround by basically doing what the LogHandler does
when it re-reads and refreshes the logging configuration - we take the
new logging level values and apply them to their respective loggers.

In fact, my first test was an exact copy of the LogHandler code and the
test worked (i.e., dynamic logging worked), whereas using the LogHandler
didn'th.

--adam

-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 1:55 PM
To: users@tomcat.apache.org
Subject: Dynamic logging configuration updates in Tomcat

Hi-

We have a web application in which we'd like to get dynamic logging 
working.  By dynamic logging, I mean live changes to the webapps' 
logging.properties file are read and applied without having to restart 
Tomcat.  We have all the code written and running but it appears to not 
work exactly as it should.  That is, I can change a logger's logging 
level once and it works, but if I change it again, it doesn't.  If I 
change the global logger level (.level) the change is picked up but, 
obviously, that affects ALL the loggers in our webapp.

I pulled the code out of tomcat and ran it as a stand-alone Java 
application and it works perfectly.  I then created a very tiny/simple 
webapp to run this logging code and the problem appears again.  I'm at a

loss as to what Tomcat can possibly be doing to prevent the properties 
from being read subsequent times after the first change.

We're using the java.util.logging API and have our own LogHandler 
class.  We have a ServletContextListener that starts a background thread

when the webapp starts up.  This background thread finds the 
logging.properties file for this webapp and if it has been modified in 
the last 60 second, creates an InputStream to this file and passes this 
InputStream to the LogManager.getLogManager().readConfiguration(...) 
method.  We are aware of this bug:  
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5035854 in the Java 
logging API, but we are using the workaround in this bug to reapply the 
logging levels.

If we can't find a solution to this using readConfiguration(...), we 
have a solution we've not tried which is to read the properties file 
ourselves, and loop over the loggers applying any levels that have 
changed - which is exactly what the LogManager is doing - but at least 
this is our code.  Again, we've not tried this brute-force method yet, 
so I don't know if it will work.

Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Tomcat 5 and SSL

2007-10-11 Thread Adam Gordon
The file is called "cacerts" and is located in your Java SDK directory's
jre/lib/security folder.  I'm running Ubuntu and it's actually a simlink
to a sub-directory in /etc.  A fellow engineer is running Fedora 7 and
it's not a simlink.

Regarding your error, do you have gcj installed?  And if so, does THAT
java binary appear first in your path?  The keytool command does not
like gcj's java binary.  If you don't have gcj installed, make sure the
java binary on your path that's being used is indeed SUN's binary.  If
none of that applies, there may be a problem with your certificate.

--adam

-Original Message-
From: uberalles [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 09, 2007 11:54 PM
To: users@tomcat.apache.org
Subject: Tomcat 5 and SSL


I'm using Tomcat 5 on a Fedora Linux box. I originally created a
self-signed
certificate (for testing purposes) without the keystore entry (still new
to
this) and I have no idea where that file is. I ran a search for anything
.keystore from root and nothing shows up.
A keytool -list command shows that there is only one keystore entry and
it
was made days ago (I thought I had made more since but I guess not).
When I
try to delete the entry I get the following error:
"keytool error: java.lang.IllegalStateException: masked envelope"
Does anyone know what this means? Thanks in advance.
-- 
View this message in context:
http://www.nabble.com/Tomcat-5-and-SSL-tf4598759.html#a13129881
Sent from the Tomcat - User mailing list archive at Nabble.com.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: How to share tomcat sessions across multiple IE windows

2007-10-11 Thread Adam Gordon
Hmmm, we have a webapp that requires authentication to launch a specific
function and we spawn multiple windows with window.open() and we don't
have any problem with the browser session IDs being changed.  Are you
switching from http to https or vice versa?  This would certainly result
in different session ID's being created.  Additionally, if you're
somehow invalidating the primary window's session before spawning the
new window, then it would also get a new session ID.

Hope that helps.

--adam

-Original Message-
From: Adam Lipscombe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 10, 2007 2:54 AM
To: Tomcat Users List
Subject: How to share tomcat sessions across multiple IE windows

Folks,


Apologies, this is not strictly a tomcat question but I wonder if anyone
else has run into it and 
has a solution.  My app spawns another window to display help, via the
window.open() javascript call.

The new window does not share the same session as the original, the
session ID is always different.
Occasionally the ID of the new window is that of a session that has
expired so the user is 
redirected to the login page.


I think his behaviour is IE specific, I found a couple of (non tomcat)
explanations here:

http://classicasp.aspfaq.com/general/how-do-i-manage-a-session-across-mu
ltiple-windows.html.

http://de3.php.net/session-start

In the latter it says:
"The problem is that IE doesn't always use the same IE process to host a
new pop-up window - it 
chooses one (using some mysterious strategy) from the pool of running IE
processes! Since session 
information (cookies) is not preserved across processes, the pop-up may
loose the session (and 
probably redirect the user to your log-in page.)"




Does anyone know how to make the new window use the same session as the
original window?
Or at least use a brand-new session rather than a recycled old one?




TIA - Adam







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Dynamic logging configuration updates in Tomcat

2007-10-15 Thread Adam Gordon
> I have no idea if Tomcat supports this -- the logging-related
> configuration directives in the docs should say if it is directly 
> supported.

I didn't see anything in the logging documentation that's indicated
either way whether or not this was supported.  The JVM theoretically
supports it with the LogManager.readConfiguration(...) method but as I
originally noted, there's a known bug in the JVM that causes new
configurations to not be loaded, however there is a work-around.

> Where do you do this? In your webapp or somewhere else?

We already have several servlet context listeners, so in the one that
initializes the web app (database, initializes static classes, etc...)
we add a thread to our thread pool whose sole job is to read the
logging.properties file and if it's changed within the last minute apply
those changes.  Originally, we constructed an InputStream from this file
and passed the stream to LogManager.readConfiguration(...) but as I've
mentioned (and even with the bug work-around) this only works for the
first couple of log file changes.  After the first few changes, it stops
working entirely in that no subsequent changes to the logging.properties
file is picked up short of changing the .level log level property.

> If you come up with something, consider logging a bug/enhancement  and
> submitting a patch. Suggestions with patches are usually given higher
> priority than those without patches ;)

I'd love to submit a patch, only I never found out where in Tomcat (if
it's even IN Tomcat) the problem is occurring.  My first test was
copying verbatim the code from LogManager that reads the properties from
the InputStream and iterates over the logging level properties applying
them to their respective loggers.  It worked consistently when I copied
it over, but not when I relied on LogManager to do it.  Once I got it
working consistently, I tweaked the code a little to maintain a mapping
of logger names to log levels so I could reset log levels for loggers
who had been removed from the logging.properties file during subsequent
changes.

--adam

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
Sent: Thursday, October 11, 2007 12:39 PM
To: Tomcat Users List
Subject: Re: Dynamic logging configuration updates in Tomcat

-----BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam,

Adam Gordon wrote:
> Wow, no one had any ideas as to what is going on?

I have no idea if Tomcat supports this -- the logging-related
configuration directives in the docs should say if it is directly
supported.

If you're using log4j, I know that there are tools you can use to modify
the in-memory configuration of the logging framework, but they won't be
persisted to the disk (and they don't allow you re-read the
configuration file AFAIK).

> Anyway.  We never figured out why Tomcat has an issue with this, but
we
> found a suitable workaround by basically doing what the LogHandler
does
> when it re-reads and refreshes the logging configuration - we take the
> new logging level values and apply them to their respective loggers.

Where do you do this? In your webapp or somewhere else?

> In fact, my first test was an exact copy of the LogHandler code and
the
> test worked (i.e., dynamic logging worked), whereas using the
LogHandler
> didn'th.

If you come up with something, consider logging a bug/enhancement  and
submitting a patch. Suggestions with patches are usually given higher
priority than those without patches ;)

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHDm2x9CaO5/Lv0PARAhWXAJ4nVi21oqN7A99wtoZMtY1HzfUQNwCcDR8Q
ivOydqjYdN1xGwtd1WqrU8c=
=4Bp9
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Dynamic logging configuration updates in Tomcat

2007-10-15 Thread Adam Gordon
I've never heard of embedded Tomcat.  That said, the whole deal w/ 
embedded systems is that the API is drastically limited so if logging 
isn't working, and this may sound like a dumb question but, is it 
possible that logging just isn't supported?


Regardless, space isn't really an issue for us in that this webapp is on 
it's own production quality serverunless there's a totally logical 
reason to use an embedded Tomcat instance.


--adam

Carl Mosca wrote:

Adam,

Have you tried your code with the embedded Tomcat?

(I am not having any success getting a webapp to do logging within embedded
Tomcat.)

TIA,
Carl

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Avoiding same server to server HTTP calls to generate HTML pages via JSPs

2008-01-03 Thread Adam Gordon
Any one know if there exists a JSP writer engine in the Tomcat API that 
allows for the generation of HTML pages via JSP code but without having 
to make server to server HTTP calls?


Right now we basically have a URL dispatcher that when a specific 
request comes in, we make another request to retrieve the contents of a 
URI (a JSP page to generate HTML) via a server-to-server HTTP call and 
then essentially slap that into a MimeBodyPart for sending text/html 
email messages.


It would be nice (and make for much easier unit testing) if we could do 
this purely in Java land without having to make a server-to-server HTTP 
call behind the scenes.  Any one know a way or if this functionality 
even exists?


Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat 5.5.23 - Connector URIEncoding="UTF-8"

2008-02-13 Thread Adam Gordon

AFAIK, we had to add two things to support UTF-8 in our environment:

1.  We had to add a Filter to Tomcat to set the encoding on every 
request to UTF-8, see this page:  http://wiki.apache.org/tomcat/Tomcat/UTF-8


2.  Add "JkOptions +ForwardURICompatUnparsed" to our apache config file 
in sites-enabled.  Note that this only applies if you are using Apache 
to redirect requests to Tomcat.


Hope this helps.


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Debugging tomcat with eclipse

2008-02-13 Thread Adam Gordon

It's actually MUCH easier than that... :-)

If you use Tomcat's start and stop scripts, pass the "jpda" parameter to 
the script, e.g. "/usr/local/tomcat/bin/catalina.sh jpda start"


Then, in Eclipse, select the Debug Perspective and then click the down 
arrow in the little green bug icon in the toolbar and select "Open Debug 
Dialog."


Right-click on "Remote Application Server" in the list on the left and 
select "New."  Name it whatever you want and use the Browse button to 
select the project you want to debug.  If tomcat is running on the same 
box, leave the host and port alone and click the Debug button in the 
lower right corner.


You should see a ton of threads appear in the Debug frame in the upper 
left.  You are now connected.


--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Debugging tomcat with eclipse

2008-02-13 Thread Adam Gordon
Actually, if one looks at the catalina.sh script, one woudl see that 
those are the defaults (unless they were changed) so one shouldn't need 
to change anything.


-adam

Luis Rivera wrote:

And don't forget to set

JPDA_ADDRESS=8000

JPDA_TRANSPORT=dt_socket

as you did before :)

--Luis R.

On Feb 13, 2008 9:19 AM, Adam Gordon <[EMAIL PROTECTED]> wrote:

  

It's actually MUCH easier than that... :-)

If you use Tomcat's start and stop scripts, pass the "jpda" parameter to
the script, e.g. "/usr/local/tomcat/bin/catalina.sh jpda start"

Then, in Eclipse, select the Debug Perspective and then click the down
arrow in the little green bug icon in the toolbar and select "Open Debug
Dialog."

Right-click on "Remote Application Server" in the list on the left and
select "New."  Name it whatever you want and use the Browse button to
select the project you want to debug.  If tomcat is running on the same
box, leave the host and port alone and click the Debug button in the
lower right corner.

You should see a ton of threads appear in the Debug frame in the upper
left.  You are now connected.

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

A couple of issues:

We've set our session expiration to 12 hours (I know it's long) and 
we're seeing behavior where certain browsers (namely IE) apparently 
can't count that high (we set the meta Refresh header but the page 
doesn't reload after the allotted time, session expiration time + 20 
minutes).


Since this issue was discovered, we've added background AJAX timers on 
some of our web pages that refresh (authenticated) content.  While this 
happily works, unfortunately, if the user chooses to remain on one of 
these pages, and then goes on vacation, the session stays active because 
the AJAX calls keep the session alive.


Our first attempt at a solution was to have a JavaScript counter that, 
after every 20 minutes, incremented a counter and if that counter ever 
got to 37, we knew that the user hadn't changed web pages and we could 
log them out (window.location = .  The problem is that this 
doesn't appear to work either and additionally, it relies on JavaScript 
bypassing Tomcat's built-in features.  User's cannot log in w/o having 
JavaScript enabled, so it's not a matter of a user potentially disabling 
it, rather it puts the onus on the browser to inform the server that the 
user's session needs to be expired.


Does anyone have experience in this area and if so, how have you solved 
this problem?  I know Google uses AJAX with their Gmail webapp, but they 
don't seem to care about not expiring the user's session.  Any help 
would be appreciated.


Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

Paul-

> Are you saying that certain browser will never expire their sessions?
> Or are you saying that certain browsers kill their sessions before 12
> hours (because they can't count that high)?

The former, i.e. that browsers will never expire the sessions.

> The way I understand it - you are using ajax to keep a session alive.
> Why not set the session expiration to live as long as the browser is
> open, or for some other length of time? The session mechanism should
> work. I don't understand the need to hack sessions using ajax.

As indicated from the tone of my original post (see the second sentence 
of the second paragraph in my original post), are not intentionally 
using AJAX to keep the session alive - it is a side-effect which we 
would like to obviate, hence the JavaScript counter.


> Isn't that part of the browser's job?

Uh, I would have to argue that this is a HUGE no.  I think it's VERY 
obvious to anyone that has done any sort of web development with 
cross-browser compatibility in mind that browser makers cannot be relied 
upon to implement ANY sort of common standard in the same way (case and 
point look at how you instantiate an XmlHttpRequest object in JavaScript 
across different browsers, not to mention CSS functionality).  Besides 
if it were the browser's job, why would Tomcat even have support for 
it?  It's like making an assumption that user's never leave their 
browsers open or never click the back button.  I think the only thing 
one can absolutely rely on a user doing in a web application using it in 
a manner to which one had not considered.


So, all that said, is there anyone out there who's had experience with 
this problem and knows of a solution?  Thanks.


--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

Martin-

We are using Struts, however, version 1.2.9.  But, after looking at the 
link, I'm not sure this will help as it doesn't really address the 
problem.  Storing the date/time a user logs in on the session is 
probably useful, but our problem is that we want to forcefully log the 
user out if there's no human present at the computer and the AJAX tasks 
keep a user's session active indefinitely, whether or not they mean it to.


Additionally, assuming we didn't have the AJAX tasks, we'd have to check 
the logged in time from the session on every request and that's just not 
realistic when you have hundreds of Struts actions, even with a unique 
parent Action class.  That said, I'm beginning to suspect that this may 
be the only way to go, i.e., have  base Action for Struts actions and 
base action for AJAX actions.  My only issue with this is that then the 
onus is on the developer to use the right Action and if they don't, a 
session could inadvertently be left open which is a security risk.


Alternatively, we could simply force the logout on the user after 12 
hours period...which would kind of suck for the user if they were in the 
middle of something and so I can almost guarantee that our product 
management team wouldn't go for it since it's not really creating a 
positive user experience.


--adam

Martin Gainty wrote:

Hi Adam-

You can try this with Struts..
http://struts.apache.org/2.x/docs/simplelogin-with-session.html
insert the starting-date-time intio Session variable
and then in the logoutAction.execute method do some quick math on the
time-delta to determine if you want to quiesce the session

HTH
M-

- Original Message -
From: "Adam Gordon" <[EMAIL PROTECTED]>
To: "Tomcat Users List" 
Sent: Monday, February 25, 2008 11:04 AM
Subject: Session expiration and AJAX issues


  

A couple of issues:

We've set our session expiration to 12 hours (I know it's long) and
we're seeing behavior where certain browsers (namely IE) apparently
can't count that high (we set the meta Refresh header but the page
doesn't reload after the allotted time, session expiration time + 20
minutes).

Since this issue was discovered, we've added background AJAX timers on
some of our web pages that refresh (authenticated) content.  While this
happily works, unfortunately, if the user chooses to remain on one of
these pages, and then goes on vacation, the session stays active because
the AJAX calls keep the session alive.

Our first attempt at a solution was to have a JavaScript counter that,
after every 20 minutes, incremented a counter and if that counter ever
got to 37, we knew that the user hadn't changed web pages and we could
log them out (window.location = .  The problem is that this
doesn't appear to work either and additionally, it relies on JavaScript
bypassing Tomcat's built-in features.  User's cannot log in w/o having
JavaScript enabled, so it's not a matter of a user potentially disabling
it, rather it puts the onus on the browser to inform the server that the
user's session needs to be expired.

Does anyone have experience in this area and if so, how have you solved
this problem?  I know Google uses AJAX with their Gmail webapp, but they
don't seem to care about not expiring the user's session.  Any help
would be appreciated.

Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon
Adding a time decay in our timer task is an interesting idea and were it 
not for IE's JavaScript counting ineptness, that'd probably work.


Bob Hall wrote:

--- 10:10AM Mon 25 Feb 2008, Adam Gordon
<[EMAIL PROTECTED]> wrote:

  

Storing the date/time a user logs in on
the session is 
probably useful, but our problem is that we want to
forcefully log the 
user out if there's no human present at the computer
and the AJAX tasks 
keep a user's session active indefinitely, whether

or not they mean it to.




If there's a user input side to the AJAX tasks, would
it be possible for the AJAX task time interval to
increase over time w/o user input? Eventually, this
would lead to a session timeout.

-Bob


  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Session expiration and AJAX issues

2008-02-26 Thread Adam Gordon

Not easily.  See Christopher's response in this thread chain.  There is
not currently a way to not tell Tomcat that a request has come in and
not update the last ping time (or similar) on the Session.


Jason Pyeron wrote:
 

  

-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 25, 2008 13:11

To: Tomcat Users List
Subject: Re: Session expiration and AJAX issues

Martin-

We are using Struts, however, version 1.2.9.  But, after 
looking at the 
link, I'm not sure this will help as it doesn't really address the 
problem.  Storing the date/time a user logs in on the session is 
probably useful, but our problem is that we want to 
forcefully log the 
user out if there's no human present at the computer and the 
AJAX tasks 
keep a user's session active indefinitely, whether or not 
they mean it to.



Can url patterns be excluded from session prolonging magic?

  
Additionally, assuming we didn't have the AJAX tasks, we'd 
have to check 
the logged in time from the session on every request and 
that's just not 
realistic when you have hundreds of Struts actions, even with 
a unique 
parent Action class.  That said, I'm beginning to suspect 
that this may 
be the only way to go, i.e., have  base Action for Struts actions and 
base action for AJAX actions.  My only issue with this is 
that then the 
onus is on the developer to use the right Action and if they don't, a 
session could inadvertently be left open which is a security risk.


Alternatively, we could simply force the logout on the user after 12 
hours period...which would kind of suck for the user if they 
were in the 
middle of something and so I can almost guarantee that our product 
management team wouldn't go for it since it's not really creating a 
positive user experience.


--adam





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache/Tomcat - mod_jk issues

2008-02-26 Thread Adam Gordon

Lessie-

Sorry to hear you're having trouble.  We use Apache/Tomcat in the same 
way and assuming your snippets are reasonably complete I've noticed some 
issues that may or may not be helping to cause problems:


1.  First and foremost, your worker list defines the worker name as 
"tomcat" yet in your J/K mount in your VirtualHost you say "ajp13" as 
the worker name.  I.e., "JkMount /*.jsp ajp13" should be "JkMount /*.jsp 
tomcat".


2.  While I've not used the redirectPort attribute on the Connector 
element, I'm assuming you are redirecting everything to HTTPS.  If this 
is the case, I'm curious as to why you don't define either 
SSLCertificateFile or SSLCertificateKeyFile in your VirtualHost.  We 
have to to ensure the right certificate is served up with the right IP 
since we don't have a site domain certificate.


3.  I don't see them but I'm also assuming that each of your webapps 
have their own Context defined in the META-INF directory.


That's all I noticed after a quick glance, but the biggie is #1.  Let us 
know how it goes.


--adam

Lessie Z. Mitch wrote:

Greetings list.

 


For some reason web browser queries are not passing through apache to tomcat
via mod_jk. I understand I may have a misconfiguration somewhere, I just
cannot find it. L

 


I am trying to host 4 separate domains, all with different java apps. Each
domain has its own IP and own configurations, but they all run within one
instance of Tomcat. When I disable Apache, my webapps run fine and are
called forth by the web browser fine. 

 


When I reconfigure for Apache, I do not hit my site(s).

 


When I attempt to view the my domain, I see the standard Apache welcome page
and no error in catalina.out.

 



When I force it to go to port 8009, I get a standard browser error (64 -
Host not available) and the following in catalina.out: 



Feb 23, 2008 7:13:19 PM org.apache.jk.common.MsgAjp processHeader

SEVERE: BAD packet signature 18245

Feb 23, 2008 7:13:19 PM org.apache.jk.common.ChannelSocket processConnection

SEVERE: Error, processing connection

java.lang.IndexOutOfBoundsException

at java.io.BufferedInputStream.read(BufferedInputStream.java:306)

at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:626)

at
org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:583)

at
org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:691)

at
org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java
:895)

at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:685)

at java.lang.Thread.run(Thread.java:595)

 

 

 

 


Below are my configurations. Please note all specific information has been
xx’d out. If more is needed let me know.

 


Server:

RHE 4

Apache 2.0.52

Tomcat 5.5.23

mod_jk 1.2.21 

 


/etc/httpd/conf/httpd.conf

~~ other configurations

Include conf.d/*.conf

~~ other configurations



ServerName mydomain.com

ServerAlias HYPERLINK "http://www.mydomain.com"www.mydomain.com

DocumentRoot /home/sites/mydomain.com/webapps/mydomain

ErrorLog /home/sites/mydomain.com/logs/mydomain_error_log

CustomLog /home/sites/mydomain.com/logs/mydomain_access_log common

JkMount /*.jsp ajp13

JkMount /servlet/* ajp13




~~ other virtual hosts follow, mimic same format

 


/etc/httpd/conf.d/mod_jk.conf

LoadModulejk_module  /usr/lib/httpd/modules/mod_jk.so

JkWorkersFile /etc/httpd/conf/workers.properties

JkShmFile /var/log/httpd/mod_jk.shm

JkLogFile /var/log/httpd/mod_jk.log

JkLogLevelinfo

JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "

 


/etc/httpd/conf/workers.properties

worker.list=tomcat

worker.tomcat.host=localhost

worker.tomcat.port=8009

worker.tomcat.type=ajp13

 


/conf/server.xml

~~ other configurations, 


~~ http & ssl are both removed


   enableLookups="false" 

   redirectPort="8443" 


   protocol="AJP/1.3" />

~~ other configurations



name="mydomain.com"

appBase="someotherdirectory/mydomain.com/webapps"

unpackWARs="true" 


autoDeploy="true">



~~ other hosts to follow, mimic same format

 

 


I have read so much and now I am more confused than ever. Can someone please
shed some light?

 

 


~LZM~


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.1/1297 - Release Date: 2/25/2008

9:22 AM
 

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Connection Pooling

2008-02-26 Thread Adam Gordon
Hi, I think you may be confusing the number of allowable processes with 
the number of allowable threads.


Per Tomcat's documentation, maxActive refers to the maximum number of DB 
connections whereas the Oracle error you are seeing refers to the 
maximum number of processes (threads?) which are not necessarily 
connections.  It's been too many years since I've worked with Oracle, 
let alone 9i, so I can't point you where to look in your config files, 
but I suspect that's where the problem may be.


As an aside, the solution is probably not to just up the number of 
processes but to determine why Oracle is generating so many (if 150 is 
indeed considered "many.").


Hope this helps.

--adam

abhishek reddy wrote:

 Here are the pool configuration details in context.xml file.



 software:
 database : oracle 9i
 server: tomcat 5.5

 iam getting the following error:

 java.sql.SQLException: [Oracle][ODBC][Ora]ORA-00020: maximum number
of processes (150) exceeded.

 I have set the maxActive to 130 then how will the number of processes
exceeds 150?

 tell me when will the maximum number of processes (150) exceeded in
the oracle and how do i solve the problem?

 I have checked the application 5 to 10 times and there is no
connection leakage problem.

 the application is under going performance testing.with around
200 users at a time, for the first time it worked perfeclty, next time
the
 above mentioned error is comming..

 i need your help in solving this problem..


  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache/Tomcat - mod_jk issues

2008-02-28 Thread Adam Gordon

No worries, happens to the best of us.

I don't "think" tomcat is a reserved worker name - that said, I've seen 
stranger things...


Anyway, regarding your host question, it depends.  "localhost" should 
work fine out of the box if your apache/tomcat are running on the same 
server (assuming your hosts file is setup correctly, which it should be 
for localhost).  We're running it all on apache load balancers and they 
hand off the JK mounts to the Tomcat server computers as appropriate.  
For the host parameter to work correctly I think all you'll need to 
ensure is that either the host value is mapped correctly in the hosts 
file or in DNS - we use DNS.


Next up, what exactly happens when you try to go to a Tomcat URL?  Do 
you get a 404?  Regardless of whether you do or not, do you get any type 
of error?  Is the error an Apache error or Tomcat error?  If you haven't 
change the defaults of Apache or Tomcat, an Apache error will generally 
tell you the apache version in black text whereas the Tomcat error page 
usually has green or grey colored bars across it and will not display 
anything about Apache.


If you get an Apache error, it's definitely not going to Tomcat-land and 
if it gets to Tomcat-land, then your Apache configuration is probably 
correct.  I would next suggest turning up your JK logging and monitor 
your request logging to make sure 1) your requests are coming through 
and look as you expect them (in your apache access log), and then 2) 
look at your mod_jk log to see what's going on.


Another thing to make sure is that Tomcat is listening on port 8009.  
Not sure what platform you're on, but a "netstat -a" will tell you which 
ports are active - you should see 8009.  And on that note, make sure 
your ports.conf file has you listening on both port 80 and 443.


--adam

Lessie Z. Mitch wrote:

Thank you Adam!

1-  eepers! Okay, that was overlooked! Changed that. ^.^

2- Not everything is secure (https). SSL is configured outside of the 
httpd.conf file for security reasons and defined in conf.d/someotherfile.conf, 
with conf.d being included (see previous post)

3- context files are located in their respective directories within catalin 
home (/tomcat_home/conf/Catalina/mydomain1.com  et al)
I followed option #2 of 
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html




Okay, fixed the virtual Host:
JkMount /*.jsp tomcat
JkMount /servlet/* tomcat

Restarted, yet Apache is still not handing off to TC. The TC serves up my 
webapps fine when standalone (either as 80 or 8080).

Should the localhost property in workers.properties be changed to the IP (or domain name) of the designated webapp? 


IE:
/somedirectory/worker.properties
   worker.list=tomcat
   worker.tomcat.host=localhost   change "localhost" to "123.234.345.1" or 
"mydomain.com"???
   worker.tomcat.port=8009
   worker.tomcat.type=ajp13




~LZM~






-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, February 26, 2008 12:39 PM

To: Tomcat Users List
Subject: Re: Apache/Tomcat - mod_jk issues

Lessie-

Sorry to hear you're having trouble.  We use Apache/Tomcat in the same 
way and assuming your snippets are reasonably complete I've noticed some 
issues that may or may not be helping to cause problems:


1.  First and foremost, your worker list defines the worker name as 
"tomcat" yet in your J/K mount in your VirtualHost you say "ajp13" as 
the worker name.  I.e., "JkMount /*.jsp ajp13" should be "JkMount /*.jsp 
tomcat".


2.  While I've not used the redirectPort attribute on the Connector 
element, I'm assuming you are redirecting everything to HTTPS.  If this 
is the case, I'm curious as to why you don't define either 
SSLCertificateFile or SSLCertificateKeyFile in your VirtualHost.  We 
have to to ensure the right certificate is served up with the right IP 
since we don't have a site domain certificate.


3.  I don't see them but I'm also assuming that each of your webapps 
have their own Context defined in the META-INF directory.


That's all I noticed after a quick glance, but the biggie is #1.  Let us 
know how it goes.


--adam

 


No virus found in this outgoing message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.1/1299 - Release Date: 2/26/2008 9:08 AM
 

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Apache/Tomcat - mod_jk issues

2008-02-28 Thread Adam Gordon

Chris-

That makes sense, because the SSL is between the web server and the 
browser, and not a connector between two web servers - I've just never 
used it so at first glance it looks like it redirects incoming traffic 
to port 8443, which is Tomcat's default SSL port...


Thanks for the clarification.

--adam

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam,

Adam Gordon wrote:
| 2.  While I've not used the redirectPort attribute on the Connector
| element, I'm assuming you are redirecting everything to HTTPS.  If this
| is the case, I'm curious as to why you don't define either
| SSLCertificateFile or SSLCertificateKeyFile in your VirtualHost.  We
| have to to ensure the right certificate is served up with the right IP
| since we don't have a site domain certificate.

AJP doesn't do encryption, so any redirectPort would be expected to
point to an HTTPS connection, which would be handled by something other
than the AJP connector. Therefore, no SSL configuration on the AJP
connector is necessary.

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfFcM0ACgkQ9CaO5/Lv0PAkDgCgnJ1x4OC5hAnd5PVuyAyiUT1d
oMkAoKU5DTG2jd/busAKlssQ5MWAIj68
=B4kk
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Leap-year problem with commons-net

2008-02-29 Thread Adam Gordon
Short of downloading/patching the source code and redeploying, just a 
stab in the dark here, but maybe just execute "touch -d " in the 
offending directory/directories.  There's no recursive flag though, 
bummer.  At least it'll only be a problem for 12 more hours (MST).


HTH,

--adam

David kerber wrote:
I have found that the commons-net ftp.listfiles() fails to get files 
whose date on the server is on feb 29.  Googling indicates that this a 
known problem (at least since this morning), but I haven't found a 
quick fix.  Does anybody know of one?


D



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Leap-year problem with commons-net

2008-02-29 Thread Adam Gordon

Dave-

Just set a cron job to do it every minute or (some other interval) and 
then you don't have to worry about it - just don't forget to remove the 
job tonight.


--adam

David kerber wrote:
Yeah, that's what I've done so far today, but the files come in 
continuously throughout the day for a total of 1000 or so, and we need 
to process them as they come in, so I've been letting them build up 
and doing it every hour or so.  It's a pain, and I hope they get this 
fixed sometime before the next leap year (and enough before it that I 
have time to implement and test it!!!)


D


Adam Gordon wrote:
Short of downloading/patching the source code and redeploying, just a 
stab in the dark here, but maybe just execute "touch -d " in 
the offending directory/directories.  There's no recursive flag 
though, bummer.  At least it'll only be a problem for 12 more hours 
(MST).


HTH,

--adam

David kerber wrote:
I have found that the commons-net ftp.listfiles() fails to get files 
whose date on the server is on feb 29.  Googling indicates that this 
a known problem (at least since this morning), but I haven't found a 
quick fix.  Does anybody know of one?


D



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Leap-year problem with commons-net

2008-02-29 Thread Adam Gordon

I mean a cron job to touch the files and change the date

David kerber wrote:
The problem is that ftp.getfiles won't even retrieve the files from 
the server!  It sees them as invalid because of the date issue.  So I 
have to retrieve them manually.  Yeah, I could script up that part as 
well, but I don't think it's worth it for now.



Adam Gordon wrote:

Dave-

Just set a cron job to do it every minute or (some other interval) 
and then you don't have to worry about it - just don't forget to 
remove the job tonight.


--adam

David kerber wrote:
Yeah, that's what I've done so far today, but the files come in 
continuously throughout the day for a total of 1000 or so, and we 
need to process them as they come in, so I've been letting them 
build up and doing it every hour or so.  It's a pain, and I hope 
they get this fixed sometime before the next leap year (and enough 
before it that I have time to implement and test it!!!)


D


Adam Gordon wrote:
Short of downloading/patching the source code and redeploying, just 
a stab in the dark here, but maybe just execute "touch -d " 
in the offending directory/directories.  There's no recursive flag 
though, bummer.  At least it'll only be a problem for 12 more hours 
(MST).


HTH,

--adam

David kerber wrote:
I have found that the commons-net ftp.listfiles() fails to get 
files whose date on the server is on feb 29.  Googling indicates 
that this a known problem (at least since this morning), but I 
haven't found a quick fix.  Does anybody know of one?


D



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: encoding - web.xml,struts struts-config.xml

2008-03-03 Thread Adam Gordon
Just a stab in the dark here since I don't know where Polish alphabet 
characters lie in the code charts, but you will probably want to use 
UTF-8 instead of ISO-8859.  We've had plenty of issues with users 
cutting and pasting text from RTF applications (e.g. MS Word) into our 
web app's text areas only to see some of the characters not be encoded 
correctly.


If you go this route, it's a multi-step process:  you need to set the 
form encoding on your HTML forms (acceptCharset="UTF-8" 
enctype="application/x-www-form-urlencoded; charset=UTF-8"), you will 
need to set the character encoding in your JSP pages 
(pageEncoding="UTF-8"/>), and most importantly, you need a filter that 
sets the character encoding on each request 
(http://wiki.apache.org/tomcat/Tomcat/UTF-8) *BEFORE* you attempt to 
read any parameters.


I don't know what the requirements of your web app will be regarding 
text input, but I've discovered that you must always assume that the 
user will do something you didn't expect.


I've mucked around with this a bunch in resolving a ton of problems, so 
if you need any pointers, feel free to ask away.


--adam

Raghuveer wrote:
 


I am working on i18n application that needs to be worked in English and
Polish language.

 


This application is working on Tomcat Servers on windows system In India,
But getting Question Marks Polish language in Poland Windows System.

 


Is there anything that needs to be handled in "web.xml" and
"struts-config.xml" with encoding attribute? 

 




 


I don't find any difference when modified to "ISO-8859-2"

 




 


Any advice or suggestion ?

 



  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat on Windows in India and Poland

2008-03-03 Thread Adam Gordon

Chris-

Great, now you tell me - after I went through all the trouble of 
replying to his first (of three) posts, which all turned out to be on 
the same topic...  :-)


--adam

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Peter,

Peter Crowther wrote:
|> From: Raghuveer [mailto:[EMAIL PROTECTED]
|> I have deployed a struts web application on Windows 2003
|> Server in Poland and India.
|>
|> Application needs to display Polish language coming from SAP.
|>
|> This is working in India on Windows 2003 Servers.
|>
|> But Messages are coming Question marks from Similar Configuration
|> Server(language is polish) in Poland .
|>
|> Any advice on this?
|
| Sounds like another character set / encoding issue - I'd be checking
| the installed and configured character sets every step of the way
| through the system, on your two sets of servers.  If one set is
| working and the other set is failing, you should be able to spot the
| difference fairly easily.  Start at SAP's output character set and
| work your way through.

Don't bother. We've given him the answer many times ("use UTF-8
throughout") and he just doesn't do it. Check the archives. :(

- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkfMB1cACgkQ9CaO5/Lv0PA8lACdFDw83h4A90fTlIir7w0hjq4Z
krkAnjcrrH/rWZFsCDw/jiJeijefPLwu
=dber
-END PGP SIGNATURE-

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Logging individual web applications

2008-03-04 Thread Adam Gordon

Neha-

First, I assume you meant to say the WEB-INF/classes directory as that's 
where the log4j.properties file needs to be placed for a given web app.


Second, you probably don't want to set the rootLogger to DEBUG as any 
libraries you use could potentially be affected by this and if you've 
ever used Apache libraries before, their verbose logging is VERY 
verbose...  a better way is to set it to INFO, and then define any 
package specific loggers ala:


log4j.rootLogger=INFO, cc1

# lock down apache logging to only INFO or higher
log4j.logger.org.apache=INFO

# lock down quartz logging to only INFO or higher
log4j.logger.org.quartz=INFO

# webapp specific loggers
log4j.logger.com.foo.bar=TRACE

Thirdly, I don't see the threshold set anywhere (and I don't know what 
the default is), ala:

log4j.threshold=ALL

This level basically dictates the lowest level of logging that is to be 
permitted by ALL loggers so it should be set to the finest level possible.


If none of this helps, pull the log4j.properties file out of your webapp 
and just write a test java class that uses it and prints out a logging 
statement at each level.  This way you don't have to restart your webapp 
every time you tweak your properties file to get it working.  Use a 
log4j provided Appender so you don't have to muck with your custom one.  
If it works right away, w/ no other modifications to the appender 
definition, then the problem lies within your custom appender.


HTH,

--adam

Neha Agrawal wrote:

Hello
   i have configured log4j for system logging in
Tomcat5.5 .Als othe log is rotating..
Now iwant to configure my individual web-apps using
log4j
i have copied log4j.jar and common-logging.jar and the
Date-File-appender.jar files in the web-apps lib
directory and also created log4j.properties file in
the webapps classes directory..
how do i configure this log4j.properties?
i used the following configuration, but nothing is
being logged by my webapp..

log4j.rootLogger=DEBUG,S
log4j.appender.S=biz.minaret.log4j.DatedFileAppender
log4j.appender.S.layout=org.apache.log4j.PatternLayout
log4j.appender.S.layout.ConversionPattern=%d [%t] %-5p
%c - %m%n

log4j.appender.S.Directory=/usr/share/tomcat5.5.25/webapps/sample/logs

log4j.appender.S.Prefix=sample.

# Suffix: The log file name suffix.
log4j.appender.S.Suffix=.log

Is some thing wrong in this?
Thanks
nEha


  Why delete messages? Unlimited storage is just a click away. Go to 
http://help.yahoo.com/l/in/yahoo/mail/yahoomail/tools/tools-08.html

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Does mod_jk support chunked encoding?

2008-07-15 Thread Adam Gordon

Hi-

We're running Tomcat 5.5.16 behind Apache2 and one functionality of our 
web app serves up ZIP files which are created on the fly.


We'd like to implement chunked-encoding to serve up the ZIP file so we 
don't have to actually create a temporary file on disk first but also so 
that we can immediately begin streaming the content to a user (i.e. a 
user doesn't have to wait for the files to be compressed into one 
file).  We just can't seem to find any documentation on how to set up 
Apache, Tomcat, and mod_jk to support chunked encoding.


Can anyone point us in the right direction?  Thanks.

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Does mod_jk support chunked encoding?

2008-07-16 Thread Adam Gordon
Really?  I mean, we already have mod_jk setup and all, it's just that we zip 
the files up server side and when that's all finished, we send the file on down 
via the response's output stream.  I tried modifying our servlet last night to 
construct the ZipOutputStream from the response's output stream and it worked, 
only the file we tested it on was only around 600K and I don't know what the 
threshold is to trigger chunked encoding.  Unfortunately, everything is over 
HTTPS which means I can't use WireShark to look at the HTTP headers to make 
sure it's actually using chunked encoding and when I removed the rewrite rule 
that forced everything over HTTPS, i.e. do the download over HTTP, the download 
actually stopped working...

I'll just write a new servlet this morning that's (mostly) independent of our 
web app and try again over HTTP with a much larger file.  If it works, 
fantastic!

Thanks for the response.

--adam

-Original Message-
From: Tim Whittington [mailto:[EMAIL PROTECTED]
Sent: Tue 7/15/2008 6:51 PM
To: Tomcat Users List
Subject: Re: Does mod_jk support chunked encoding?
 
mod_jk does chunked encoding on all dynamic responses (e.g. From Tomcat)
that don¹t already have some form of response end set (e.g. A Content-Length
header).
To be accurate I think this is more a function of Apache than mod_jk.
All you should need to do is connect Tomcat to Apache using mod_jk and it
should work out of the box.

tim 


From: Adam Gordon <[EMAIL PROTECTED]>
Reply-To: Tomcat Users List 
Date: Tue, 15 Jul 2008 15:29:02 -0600
To: Tomcat Users List 
Subject: Does mod_jk support chunked encoding?

Hi-

We're running Tomcat 5.5.16 behind Apache2 and one functionality of our
web app serves up ZIP files which are created on the fly.

We'd like to implement chunked-encoding to serve up the ZIP file so we
don't have to actually create a temporary file on disk first but also so
that we can immediately begin streaming the content to a user (i.e. a
user doesn't have to wait for the files to be compressed into one
file).  We just can't seem to find any documentation on how to set up
Apache, Tomcat, and mod_jk to support chunked encoding.

Can anyone point us in the right direction?  Thanks.

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Communicating on the Tomcat admin port

2008-08-13 Thread Adam Gordon
Is there a way to communicate with Tomcat via the admin port but not 
have to use the web interface?  We're looking at completely automating 
our deployment process and it would be nice if we could send a signal to 
Tomcat to shutdown via the command-line.


Additionally, if it is possible, are there other things one can do via 
the admin port?


Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Communicating on the Tomcat admin port

2008-08-13 Thread Adam Gordon

Perfect!  Thanks!

Angus Mezick wrote:

This page shows how to use ant to execute commands against the manager.

http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html

And this is all about using the JMXRemote stuff:

http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html

--Angus Mezick

-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2008 10:59 AM

To: Tomcat Users List
Subject: Communicating on the Tomcat admin port

Is there a way to communicate with Tomcat via the admin port but not 
have to use the web interface?  We're looking at completely automating 
our deployment process and it would be nice if we could send a signal to


Tomcat to shutdown via the command-line.

Additionally, if it is possible, are there other things one can do via 
the admin port?


Thanks,

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat admin webapp configuration with mod_jk

2008-08-13 Thread Adam Gordon
We currently use Apache/Tomcat and mod_jk for our webapp.  I've 
downloaded and installed (correctly, I think) the admin web app but am 
having trouble configuring Apache and Tomcat to recognize that the admin 
webapp is present.  I suspect it's simply a config issue, but can't 
figure it out.  Here's our original server.xml:




 
   

   

 

   
 
   
 
   
 


I've tried adding another connector (on port 8080) and also adding 
another  based on the admin.xml file but nothing seems to be 
working correctly.  I have workers.properties configured to redirect to 
Tomcat and that's working b/c I'm getting a Tomcat 404 error and not an 
Apache one.  I don't care by which means I connect to the admin webapp 
(either via mod_jk or directly via another port, say 8080 but I just 
can't seem to figure the configuration issue out.


--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Tomcat admin webapp configuration with mod_jk

2008-08-13 Thread Adam Gordon
I just figured it out when verifying my installation per your request of 
my installation steps.  It finally clicked when I was looking at the 
subdirectories in TOMCAT_HOME/conf...there's a Standalone directory and 
a Catalina directory.


Our Engine name is Standalone and host name is localhost - so I moved 
the admin.xml from the default of conf/Catalina/localhost to 
conf/Standalone/localhost and voila! it worked.


So, now I have a problem whereby I can't log in and Tomcat is 
complaining that I don't have a LoginModule configured for Standalone.  
I assume I need to add a JAAS Realm in admin.xml (like we're doing for 
our web app) but it's not clear how it needs to be configured.


Any ideas?

--adam

Caldarale, Charles R wrote:

From: Adam Gordon [mailto:[EMAIL PROTECTED]
Subject: Tomcat admin webapp configuration with mod_jk

I've downloaded and installed (correctly, I think) the admin
web app but am having trouble configuring Apache and Tomcat
to recognize that the admin webapp is present.



Obviously, it's not correctly installed, or you wouldn't be having a problem.

Don't suppose you want to give us a hint about what version of Tomcat you're 
using?  Guessing from the contents of server.xml is rather pointless.  Exactly 
what steps did you take to install the admin web app?  Where is Tomcat 
installed?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers.

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

  


-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Tomcat admin webapp LoginModule configuration

2008-08-14 Thread Adam Gordon
I've got the Tomcat admin webapp up and running but am seeing an error 
(when I try and log in) in catalina.out informing me that there are "no 
LoginModules configured for "


We use JAAS for our web app so I'm familiar with the concept of the 
LoginModule and we have a JAAS Realm defined in our context.xml file for 
our web app.  I would assume that I need to add something similar to the 
admin.xml file for the admin web app, only I have no idea what to add 
and Google searching doesn't seem to yield anything useful.


Any ideas?

--adam

-
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]