Re: why does mod_jk still try to send the request to a shutdown machine?

2007-08-24 Thread Rainer Jung
David Rees schrieb:
 So in case the remote host is dead (i.e. it's not only Tomcat not
 answering or no Tomcat there), we have the problem, that TCP as a
 reliable problem tries hard to establish a connection with several
 resends of SYNs in increasing intervals, leading to long waiting times.
 
 So with connect_timeout set to 500, mod_jk won't give up on the
 connection attempt after 500 ms have elapsed?

Not in general. It depends on which part of the connect needs long. For
the TCP connect it will use the socket_timeout configured. For the
following Cping/Cpong the connect_timeout.

 Mostly I agree, but I would set a timeout for athe connection pool.
 
 Perhaps the default configuration and docs could be updated to reflect
 that instead of setting to zero? I normally use these settings on my
 servers:
 
 socket_keepalive=1
 socket_timeout=300
 connection_pool_timeout=300
 connect_timeout=500
 prepost_timeout=500

We never changed the defaults out of compatibility considerations. Most
of the timeouts didn't exist from the beginning and that's why they are
unfortunately disabled by default.

 I also normally set the worker maintain and lb worker recover_time to
 something lower than the default as well so that mod_jk picks up
 recovering workers more quickly. It would be nice if worker
 maintenance could be done by a process other than the
 processes/threads which also process requests!
 
 -Dave

That on the TODO for the next major release, provisionary named JK3. We
will use the APR libs as an infrastructure, so that we can easily use
threads. One use case will be a management thread, that does the
maintenance and concurrently monitors the backend status.

No timeline for that yet.

Regards,

Rainer

-
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: Is Tomcat being hacked by curl ?

2007-08-24 Thread Lyallex
On 8/23/07, Christopher Schultz [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Duncan,

 Not to belabor this thread too much, but...

 Lyallex wrote:
  I never actually suggested [curl] was a
  hacking tool

 See the subject line.

Yes ... fair point :-}

-
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: why does mod_jk still try to send the request to a shutdown machine?

2007-08-24 Thread Guofeng Zhang
Thanks for all the replies about this question.

But I still can not know if it could be solved by tuning the attributes
in worker.properties.

I read that doc carefully and make some changes to the worker.proerties.
There is no improvement.

It seems that mod_jk try to establish a TCP connection to the master and
failed by timeout (about one minute). Then it forwards the request to
the salve/backup machine.

The following is the content of worker.properties.
# Define list of workers that will be used

# for mapping requests
worker.list=loadbalancer,status

# Define Master
worker.master.host=192.168.225.195
worker.master.port=8009
worker.master.type=ajp13
worker.master.lbfactor=1
#socket timeout in seconds
worker.master.socket_timeout=5
worker.master.prepost_timeout=250
worker.master.connect_timeout=500
worker.master.recovery_options=3

# Define prefered failover node for master
worker.master.redirect=slave 

# Define Slave
worker.slave.host= 192.168.225.116
worker.slave.port=8009
worker.slave.type=ajp13
worker.slave.lbfactor=1
#socket timeout in seconds
worker.slave.socket_timeout=5
worker.slave.prepost_timeout=250
worker.slave.connect_timeout=500
worker.slave.recovery_options=3

#Disable slave for all requests except failover
worker.slave.activation=d

# Load-balancing behaviour
worker.loadbalancer.type=lb
worker.loadbalancer.balance_workers=master, slave
worker.loadbalancer.sticky_session=1

# Status worker for managing load balancer
worker.status.type=status

-Original Message-
From: Rainer Jung [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 10:24 PM
To: Tomcat Users List
Subject: Re: why does mod_jk still try to send the request to a shutdown
machine?

Have a look at

http://tomcat.apache.org/connectors-doc/generic_howto/timeouts.html

You could lower you prepost_timeout. The Timeouts will help for
unplanned downtimes. For planned downtimes you should administratively
change the activation attribute of the load balancer members.

Regards,

Rainer


Guofeng Zhang schrieb:
 Hi,
 
  
 
 I use Apache as the load balancer and configured mod_jk to work in
 failover mode. The master and slave run on separate machines. 
 
  
 
 To test how the failover works, I shut down the master machine, then I
 access my application. But it takes about one minute for me to see the
 first page. I think the time is used to try to establish the socket
 connection.
 
  
 
 I think I need to configure something that I missed in the
 worker.properties so that mod_jk could detect the status of the master
 before it sends the request to it.
 
  
 
 Thanks for your help very much.
 
  
 
 I use Apache HTTPD 2.2.4, mod_jk 2.2.4, JBoss 4.0.4/Tomcat 5.5.
 
  
 
 The following the log of mod_jk.
 
  
 
 [Wed Aug 22 17:24:59 2007][1632:1624] [info] mod_jk.c (2775):
 mod_jk/1.2.24 initialized
 
 [Wed Aug 22 17:25:42 2007][1632:6124] [info] jk_connect.c (473):
connect
 to 192.168.225.195:8009 failed (errno=60)
 
 [Wed Aug 22 17:25:42 2007][1632:6124] [info] jk_ajp_common.c (891):
 Failed opening socket to (192.168.225.195:8009) (errno=60)
 
 [Wed Aug 22 17:25:42 2007][1632:6124] [info] jk_ajp_common.c (1311):
 (master) error connecting to the backend server (errno=60)
 
 [Wed Aug 22 17:25:42 2007][1632:6124] [info] jk_ajp_common.c (2071):
 (master) sending request to tomcat failed,  recoverable operation
 attempt=1
 
  
 
  
 
 The following is the content of worker.properties.
 
 # Define list of workers that will be used 
 
 # for mapping requests
 
 worker.list=loadbalancer,status 
 
  
 
 # Define Master
 
 worker.master.host=192.168.225.195
 
 worker.master.port=8009
 
 worker.master.type=ajp13
 
 worker.master.lbfactor=1
 
 worker.master.cachesize=10
 
 worker.master.cache_timeout=600
 
 worker.master.socket_timeout=180
 
 worker.master.recycle_timeout=100
 
 worker.master.prepost_timeout=50
 
 worker.master.recovery_options=0 
 
  
 
 # Define prefered failover node for master
 
 worker.master.redirect=slave 
 
  
 
 # Define Slave
 
 worker.slave.host= 192.168.225.116
 
 worker.slave.port=8009
 
 worker.slave.type=ajp13
 
 worker.slave.lbfactor=1
 
 worker.slave.cachesize=10
 
 worker.slave.cache_timeout=600
 
 worker.slave.socket_timeout=180
 
 worker.slave.recycle_timeout=100
 
 worker.slave.prepost_timeout=50
 
 worker.slave.recovery_options=0
 
  
 
 #Disable slave for all requests except failover
 
 worker.slave.activation=disabled 
 
  
 
 # Load-balancing behaviour
 
 worker.loadbalancer.type=lb
 
 worker.loadbalancer.balance_workers=master, slave
 
 worker.loadbalancer.sticky_session=1 
 
  
 
 # Status worker for managing load balancer
 
 worker.status.type=status
 
  
 

-
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: 

Re: why does mod_jk still try to send the request to a shutdown machine?

2007-08-24 Thread Mladen Turk

Guofeng Zhang wrote:

Thanks for all the replies about this question.

But I still can not know if it could be solved by tuning the attributes
in worker.properties.

I read that doc carefully and make some changes to the worker.proerties.
There is no improvement.

It seems that mod_jk try to establish a TCP connection to the master and
failed by timeout (about one minute). Then it forwards the request to
the salve/backup machine.



That is correct.
The reason for such behavior is because one cannot know if the
failed backend is permanently, temporarily disabled or just busy.
So it needs to figure out that by sending a request that can take
up to 1 second if the node is dead. Later you can setup recover_time
for the worker (defaults to 60 seconds) if you need lower recovery
frequency. For example worker.xxx.recover_time=600 will try to
reconnect to failed worker each 10 minutes.

If you know that your backend will be down for designed amout
of time, use the status manager page for mod_jk and completely disable
desired worker. When it comes online back, re-enable it again manually.
In that case there will neither initial nor scheduled retries.

Regards,
Mladen.

-
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: A Global Error Page (JSP or JSF)

2007-08-24 Thread Gregor Schneider
Hi Chris,

I guess you're question pointed to Sam, right?

Anyways, that's also what I think.

According to the specs a *noncaught* exception should trigger the errorpage

At least here it's working as expected ;)

Cheers

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
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: adding datasource to /conf/context.xml without restarting server to find it?

2007-08-24 Thread shunhecun

Because I have several applications which share the same dataource.


David Smith-2 wrote:
 
 Ok... this begs the question: Why did you add the datasource to 
 $TOMCAT_BASE/conf/context.xml?  The datasource should be in your 
 individual webapp's context.xml file where all you have to do is restart 
 the webapp via the manager webapp.
 
 --David
 
 shunhecun wrote:
 
Hi,

I added a jdbc datasource to $TOMCAT_BASE/conf/context.xml using W3C DOM.
But I have to restart the server find the new resource. 

I wonder is there a way to add new resources to
$TOMCAT_BASE/conf/context.xml on Tomcat 5.5.23, without restarting server
to
find it?

Regards,
cun
  

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

-- 
View this message in context: 
http://www.nabble.com/Tomcat-5.5.23%3A-adding-datasource-to--conf-context.xml-without-restarting-server-to-find-it--tf4318541.html#a12309071
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]



Re: Tomcat 5.5.23: adding datasource to /conf/context.xml without restarting server to find it?

2007-08-24 Thread David Smith
Then I don't think you can avoid a restart of tomcat.  The only other 
method of defining a jdbc pool shared across webapps involves defining 
it in the GlobalNamingResources.../GlobalNamingResources of 
conf/server.xml and that also requires a restart.


Pick your poison -- one db pool per webapp restarting each webapp or one 
db pool across all webapps restarting tomcat on change.


--David

shunhecun wrote:

Because I have several applications which share the same dataource.


David Smith-2 wrote:
  
Ok... this begs the question: Why did you add the datasource to 
$TOMCAT_BASE/conf/context.xml?  The datasource should be in your 
individual webapp's context.xml file where all you have to do is restart 
the webapp via the manager webapp.


--David

shunhecun wrote:



Hi,

I added a jdbc datasource to $TOMCAT_BASE/conf/context.xml using W3C DOM.
But I have to restart the server find the new resource. 


I wonder is there a way to add new resources to
$TOMCAT_BASE/conf/context.xml on Tomcat 5.5.23, without restarting server
  

to
  

find it?

Regards,
cun
 

  

-
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]



Clustering/Session Replication

2007-08-24 Thread Andrew Hole
Hello!

What's benefits of using Clustering/Session Replication on same machine?

Thanks a lot


Re: Tomcat commons.net FTPClient

2007-08-24 Thread MARollins

DOH!

Yes, it was a classloading problem. I had assumed the IDE had packaged
commons net in the web app but it hadn't.


MARollins wrote:
 
 Hi,
 I've written an application to download and process a set of files using
 commons.net FTPClient. This runs fine from in a standalone application. 
 
 However, when I incorporate it into a web app (Tomcal/Struts/Spring) it
 fails on the constructor of FTPClient, ie. 
 
 FTPClient ftp=new FTPClient();
 
 Using a debugger I can see that it doesn't even enter the constructor,
 which makes me think it is a class loader problem, but the exception I get
 is as follows...
 
 java.lang.reflect.InvocationTargetException
   sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   java.lang.reflect.Method.invoke(Method.java:585)
 
 com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:404)
 
 com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:267)
 
 org.apache.struts2.interceptor.BackgroundProcess$1.run(BackgroundProcess.java:56)
   java.lang.Thread.run(Thread.java:595)
 
 The whole application is running on my local PC (ie webserver, FTPServer).
 I'm not starting Tomcat with  a security policy (as far as I am aware,
 anyway).
 
 Any suggestions gratefully received! 
 
 Thanks
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat---commons.net-FTPClient-tf4322563.html#a12309772
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]



recovery_options bitmask values for mod_jk

2007-08-24 Thread Gerhardus.Geldenhuis
Hi
Hopefully a simple answer, the documentation says 
recovery_options is a bitmask but what I am unsure of is do I set the
value in binary or do I use integer values?
 
1: don't recover if Tomcat failed after getting the request
2: don't recover if Tomcat failed after sending the headers to client
4: close the connection to Tomcat, if we detect an error when writing
back the answer to the client (browser)
8: always recover requests for HTTP method HEAD (even if Bits 1 or 2 are
set)
16: always recover requests for HTTP method GET (even if Bits 1 or 2 are
set)
 
I understand bit mask as:
1 0001
168421


Thus the value I want to set teh recovery_options to is: 
11000. Integer equivalent would be 24.

Searching the emails I have received from the list since joining shows
people have used normal integer values.

I would be glad if someone could clear this up. 

Regards

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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



Open a session based on the session id

2007-08-24 Thread Hernâni Henrique Ramos Cerqueira
Hello all,
I'm developing a webapp that does lots of ajax requests, but I need to
keep track of the session. Wath i do is to read the JSESSIONID cookie
with javascript and send the value as a POST parameter when I make the
request, but then tomcat doesn't open the session automaticaly. My
question is the following: Is there a way of calling the rigth session
based on the session id passed on the post parameter?

Thanks in advance,
Cheers, Hernâni


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



how to add restriction to a folder?

2007-08-24 Thread hardc0d3r

i want to have a folder that will contain files that can be downloaded/saved
only by going through a servlet.. how can i do this? are there any tutorials
or links? thanks..
-- 
View this message in context: 
http://www.nabble.com/how-to-add-restriction-to-a-folder--tf4323046.html#a12310612
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]



Re: recovery_options bitmask values for mod_jk

2007-08-24 Thread Rainer Jung
[EMAIL PROTECTED] schrieb:
 Hi
 Hopefully a simple answer, the documentation says 
 recovery_options is a bitmask but what I am unsure of is do I set the
 value in binary or do I use integer values?
  
 1: don't recover if Tomcat failed after getting the request
 2: don't recover if Tomcat failed after sending the headers to client
 4: close the connection to Tomcat, if we detect an error when writing
 back the answer to the client (browser)
 8: always recover requests for HTTP method HEAD (even if Bits 1 or 2 are
 set)
 16: always recover requests for HTTP method GET (even if Bits 1 or 2 are
 set)
  
 I understand bit mask as:
 1 0001
 168421
 
 
 Thus the value I want to set teh recovery_options to is: 
 11000. Integer equivalent would be 24.

Integer 24 would be correct.
You should additionally consider vaule 3, making it a 27.

 Searching the emails I have received from the list since joining shows
 people have used normal integer values.
 
 I would be glad if someone could clear this up. 
 
 Regards

Regards,

Rainer

-
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: Mapped File Access Problems in Servlets

2007-08-24 Thread Daniel L. Gross
I am not running in a domain, my servers are running in a workgroup 
only, and the machine tomcat 5.5 is running on is logged into an 
administrator account.  It appears that it sees the mapped drives 
because if I try to access a file that is not available, I get the 
proper JAVA message.  When I try to access an existing file, I get a 
java.io.FileNotFoundException filename (Access is Denied). 

The same user and password exists on the other machine which is why I 
can map the drive.  I tried a simple experiment and wrote a 5 line JAVA 
program and this accessed the drive just fine, but when I put those 5 
lines in the servlet, I got the access denied.


How do I change the configuration in the tomcat service to allow it to 
see other computers?


Thanks, Dan Gross, ATLC


Mark Thomas wrote:


Daniel L. Gross wrote:
 


I have a servlet that does a direct read from a mapped drive in
Windows.  It works fine in tomcat as long as I use a drive on the local
machine.  However, I need to access a mapped drive on a different
machine.  When I run the program, I get a FileNotFound error in JAVA and
(access denied) next to it.  Is there some permissions that need to be
set so my servlet can access a file on another machine.  And how do I
set this in Tomcat/JAVA.

Thanks,  Dan Gross ATLC
   



This comes down to the Windows user Tomcat is running as. You need to
make sure that that user has the necessary access to the network drives.

If you are running as a service, the default user for services has
zero privs on other machines. Usually what is required is to configure
the service to log on as a domain user that has the necessary access.

HTH,

Mark

-
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: Mapped File Access Problems in Servlets

2007-08-24 Thread Daniel L. Gross
I just tried changing the login configuration to log onto the 
administrator account, and I still get access denied.  Any thoughts???


Thanks, Dan Gross, ATLC


Mark Thomas wrote:


Daniel L. Gross wrote:
 


I have a servlet that does a direct read from a mapped drive in
Windows.  It works fine in tomcat as long as I use a drive on the local
machine.  However, I need to access a mapped drive on a different
machine.  When I run the program, I get a FileNotFound error in JAVA and
(access denied) next to it.  Is there some permissions that need to be
set so my servlet can access a file on another machine.  And how do I
set this in Tomcat/JAVA.

Thanks,  Dan Gross ATLC
   



This comes down to the Windows user Tomcat is running as. You need to
make sure that that user has the necessary access to the network drives.

If you are running as a service, the default user for services has
zero privs on other machines. Usually what is required is to configure
the service to log on as a domain user that has the necessary access.

HTH,

Mark

-
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: java.net.SocketException: Invalid argument

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aaron,

Don't hijack threads. Please post a new question to the list.

- -chris

Aaron wrote:
 I am running Tomcat 5.0.28 and Apache 2.2 using mod_jk. I am constantly 
 seeing the following error show up in the catalina.log:
 
 WARNING: Exception executing accept
 java.net.SocketException: Invalid argument
 at java.net.PlainSocketImpl.socketSetOption(Native Method)
 at java.net.PlainSocketImpl.setOption(PlainSocketImpl.java:240)
 at java.net.Socket.setSoLinger(Socket.java:826)
 at org.apache.jk.common.ChannelSocket.accept(ChannelSocket.java:300)
 at 
 org.apache.jk.common.ChannelSocket.acceptConnections(ChannelSocket.java:638)
 at org.apache.jk.common.SocketAcceptor.runIt(ChannelSocket.java:847)
 at 
 org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
 at java.lang.Thread.run(Thread.java:534)
 
 Is this something that I should be concerned with? I don't see any glaring 
 performance issues with my site, but I still don't like the fact that my logs 
 are filling up with errors. Thanks for your help and input.
 
 Aaron Steele
 Technology Manager
  
 Natural Wellness USA, Inc.
 http://www.veria.com
 701 Highlander Blvd, Suite 200 | Arlington, Texas 76015
 p (817) 804-4646 | c (817) 879-7528 | f (817) 804-4696
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztI09CaO5/Lv0PARAg+cAJ0WeOt4LshS8E7L44QqR4KA1QFF4ACeLxrb
aiGKTdwz1ofr0nGVLrV3PLk=
=KeHT
-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]



Re: Need a way to identify tomcat instances at run-time

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brian,

Don't hijack threads. Please post a new question to the list.

- -chris

Brian Barnett wrote:
 I have a struts-based application running on multiple tomcat instances, load 
 balanced by a hardware load balancer, i.e., no Apache Web Server. I need a 
 way at run-time to know which tomcat instance it is. Is there a way to access 
 info in the server.xml or context.xml file at run-time? Can I specify some 
 arbitrary value in either of those xml files that would be available at 
 run-time? Is there some other way to identify the tomcat instance at 
 run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?
 
 Any ideas would be appreciated.
 
 Thanks,
 Brian Barnett
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztJG9CaO5/Lv0PARApqyAJ4kMXAN9wVMarjnz/0XPx6+ZyKoFQCgkrqm
oXqOaGXmC/OFVdo0WY+2erM=
=3Ack
-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]



tomcat 5.5 debian sid

2007-08-24 Thread Gregor Schneider
Der Default-Port fuer Tomcat ist definitiv 8080:

http://tomcat.apache.org/tomcat-5.0-doc/deployer-howto.html

Wenn ich Tante Google mal glauben darf, ist der Default Port fuer Squid 3128.

Lediglich in einigen Tutorials wird 8080 empfohlen, wenn man Squid als
HTTP-Proxy einsetzt - ist aber kein Default.

Insofern stellt sich Debian imho hier klar gegen Standards, oder aber
ich habe was verpasst bzw. mir ist die Motivation hierfuer nicht
ersichtlich.

Mit meinem jetzigen Wissensstand (der natuergemaess begrenzt ist
*hust*) moechte ich das jetzt mal milde formuliert als sehr
unschoen bezeichnen

Gruss

Gregor

PS.: Wir sprechen hier ueber den HTTP-Connector...
--
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
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: adding datasource to /conf/context.xml without restarting server to find it?

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Cun,

shunhecun wrote:
 Because I have several applications which share the same dataource.

I would configure them each separately in their own META-INF/context.xml
file, even though all the values are the same. Is this feasible in your
environment?

- -chris

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

iD8DBQFGztNT9CaO5/Lv0PARAhFhAKCBjWAZEfZavveIJIBsDiKzHjHKzgCfftwv
zEQwBnvJiX/aNe/5BtmFqx4=
=z9Yb
-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]



Re: Mapped File Access Problems in Servlets

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel,

Daniel L. Gross wrote:
 How do I change the configuration in the tomcat service to allow it to
 see other computers?

You don't change the service configuration (unless you run Tomcat as
some other user -- which isn't a bad idea). Instead, you give the
requisite privileges to the effective user account under which Tomcat runs.

- -chris

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

iD8DBQFGztPl9CaO5/Lv0PARAoqjAKCvvwoZuk5T7W91CEMYjGszNQpSjQCgjpFS
pPWX0gtxSYA9Q6tdQv34ysc=
=Nzc+
-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]



Re: java.net.SocketException: Invalid argument

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aaron,

Aaron wrote:
 Sun v245 running Solaris 10

I think this might have been covered before, but I'm not entirely sure.
You'd have to check the circumstances. Search the archives for
SocketException, socketSetOption, and IPv6. I think that you might need
to change the format of your IP address in order to avoid (or require?)
the use of IPv6 addresses.

- -chris

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

iD8DBQFGztR29CaO5/Lv0PARAteGAJ46wocZI4k+iaxrDdddRM8SNKTFkwCgsZX4
voYRKKXjbY0dwn2y6H2iLus=
=ZFSr
-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]



workers.properties confusion

2007-08-24 Thread Gerhardus.Geldenhuis
Hi
Another easy question to answer, hopefully...
 
I just spend a lot of time going through this page:
http://tomcat.apache.org/connectors-doc/reference/workers.html
to decide which parameters we need/want to implement. 
 
However I am a bit confused between the 
/etc/httpd/conf/workers.properties for apache and
/usr/share/tomcat/conf/workers.properties
 
Is the documentation only for the tomcat file or is it for both files?
 
I understand apache:/workers.properties to be the place were I setup how
and to how many tomcats I will be connecting from apache 
and
tomcat:/workers.properties to be where I specify how many tomcat
instances/workers I have.
 
We are expiercing regular as clock work problems with apache getting in
a  W Sending Reply state for all of the child processes and the not
clearing.
 
Currently we are using default setting for mod_jk which needs some
serious tuning to at least make sure that that part of the
infrastructure is working properly.
 
Another potential issue is that we are using apache prefork. From what I
have googled so far it looks like apache mpm would be better for us. We
typically have one apache box sitting in front of 12 tomcats.
 
Regards
 
 
 

__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

Tomcat response time extremely high (minutes)

2007-08-24 Thread Rapthor

Hello,

my Tomcat 6.0.13/14 server is responding in a very long time. It does not
matter if I try to start the main page of the server or one of my webapps.
About 2 minutes for each website. This is not the case, if I test on my
local machine with http://localhost:8080/myapp; (IE or Firefox on a Windows
XP machine).

First I supposed it was something wrong with the installation of Tomcat
6.0.13 so I downloaded the new 14er version. Suddenly everything was
responding like a charm. Even working on a machine in the network was OK
now. But after 1 day the same issue reappeared (response times of about 2
minutes).

I did not change anything in the Tomcat configuration except for server.xml
which is edited by ECLIPSE I suppose:

  Host appBase=webapps autoDeploy=true name=localhost
unpackWARs=true xmlNamespaceAware=false xmlValidation=false

  Context docBase=C:\Programme\tomcat\eclipsewebapps\Asset Register
path=/ar reloadable=true source=org.eclipse.jst.jee.server:Asset
Register//Host

What is wrong? What could be wrong? The machines in the network are in
another subnetwork. My machine is for example IP 10.45.2.35 and the network
machine is on IP 10.45.14.26. Subnet mask 255.255.224.0.

Any ideas?
-- 
View this message in context: 
http://www.nabble.com/Tomcat-response-time-extremely-high-%28minutes%29-tf4323432.html#a12311908
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]



Re: Refresh JSP in Tomcat 5.5

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hezjing,

hezjing wrote:
 In Tomcat 5.5\conf\web.xml, I have defined modificationTestInterval=0
 and that the context's reloadable=true.

Maybe try 'reloading=true' instead?

http://tomcat.apache.org/tomcat-5.5-doc/jasper-howto.html

- -chris

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

iD8DBQFGztUh9CaO5/Lv0PARAlA2AKCc1wDd4K8YJlDU8RKImvPhZYX5KwCeI+Hb
6WyJhi9YQsTVkcR+MqFnp2A=
=017s
-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]



Re: Mapped File Access Problems in Servlets

2007-08-24 Thread Daniel L. Gross
Thanks for all your help, I found out the problem.  It was the service 
privilege running under the local machine.  The default tomcat icon at 
the bottom of the screen that allows you to configure and start/stop 
tomcat would not let me change the user it ran under.  However, I was 
able to change the user to Administrator under the windows services 
window and I can start and stop tomcat there as well.


Again, thanks for your quick responses, got me out of a tight Jam.

Dan Gross, ATLC


Mark Thomas wrote:


Daniel L. Gross wrote:
 


I have a servlet that does a direct read from a mapped drive in
Windows.  It works fine in tomcat as long as I use a drive on the local
machine.  However, I need to access a mapped drive on a different
machine.  When I run the program, I get a FileNotFound error in JAVA and
(access denied) next to it.  Is there some permissions that need to be
set so my servlet can access a file on another machine.  And how do I
set this in Tomcat/JAVA.

Thanks,  Dan Gross ATLC
   



This comes down to the Windows user Tomcat is running as. You need to
make sure that that user has the necessary access to the network drives.

If you are running as a service, the default user for services has
zero privs on other machines. Usually what is required is to configure
the service to log on as a domain user that has the necessary access.

HTH,

Mark

-
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: Mapped File Access Problems in Servlets

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Daniel,

Daniel L. Gross wrote:
 I was
 able to change the user to Administrator

This is basically the same as running as root on a UNIX system: it
works, but nobody can really recommend it since you're giving your app
server full access to everything on your box. Caveat server.

- -chris

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

iD8DBQFGztpN9CaO5/Lv0PARAh9WAJ9uAvVAM/o7mwCpaFawVSUFUU1DLACgmvCo
TFzu87JscSf+fxDbdTmxl+0=
=Mkcz
-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]



filter IP for a webapps through mod_jk

2007-08-24 Thread Sebastien Moretti

Hi,

after some days of tries and research I was able to run properly tomcat 
(5.5.23), apache 2 and mod_jk for the same machine.


So now, my webapps are reachable with both URLs:
http://www.fake.com/webapps
or
http://www.fake.com:8080/webapps


As I understood mod_jk, apache/mod_jk looks in localhost (tomcat and 
apache are on the same machine for me) to reach tomcat.


Thus, I would like to deny access for webapps through port 8080, but not 
for all tomcat !

With it, only http://www.fake.com/webapps could be available.


I tried to add a context rule for webapps but webapps is no more reachable.
Valve className=org.apache.catalina.valves.RemoteAddrValve
allow=127.0.0.1/


How can I do ?
Thanks

--
Sébastien Moretti


-
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: filter IP for a webapps through mod_jk

2007-08-24 Thread ian . blenk

Hi,

Try removing Connector port=8080 ... element from your tomcat server.xml



Quoting Sebastien Moretti [EMAIL PROTECTED]:

 Hi,
 
 after some days of tries and research I was able to run properly tomcat 
 (5.5.23), apache 2 and mod_jk for the same machine.
 
 So now, my webapps are reachable with both URLs:
 http://www.fake.com/webapps
 or
 http://www.fake.com:8080/webapps
 
 
 As I understood mod_jk, apache/mod_jk looks in localhost (tomcat and 
 apache are on the same machine for me) to reach tomcat.
 
 Thus, I would like to deny access for webapps through port 8080, but not 
 for all tomcat !
 With it, only http://www.fake.com/webapps could be available.
 
 
 I tried to add a context rule for webapps but webapps is no more reachable.
  Valve className=org.apache.catalina.valves.RemoteAddrValve
  allow=127.0.0.1/
 
 
 How can I do ?
 Thanks
 
 -- 
 Sébastien Moretti
 
 
 -
 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: java.net.SocketException: Invalid argument

2007-08-24 Thread Filip Hanik - Dev Lists

try adding
|-Djava.net.preferIPv4Stack=true

to your startup script

Filip
|
Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Aaron,

Aaron wrote:
  

Sun v245 running Solaris 10



I think this might have been covered before, but I'm not entirely sure.
You'd have to check the circumstances. Search the archives for
SocketException, socketSetOption, and IPv6. I think that you might need
to change the format of your IP address in order to avoid (or require?)
the use of IPv6 addresses.

- -chris

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

iD8DBQFGztR29CaO5/Lv0PARAteGAJ46wocZI4k+iaxrDdddRM8SNKTFkwCgsZX4
voYRKKXjbY0dwn2y6H2iLus=
=ZFSr
-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: Clustering/Session Replication

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
 What's benefits of using Clustering/Session Replication on same machine?

If you have a really buggy application that crashes a lot, clustering
and session replication can buy you some robustness that your engineers
have not been able to provide. Performance-wise, it's not a very good idea.

- -chris

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

iD8DBQFGztq99CaO5/Lv0PARArGjAKC1NH+rPhlKI8QznZ0aMhpOleSztACfVJ+x
XcfvDnkvGzylN6uCWwg2Cx8=
=2kOs
-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]



Re: workers.properties confusion

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gerhardus,

[EMAIL PROTECTED] wrote:
 However I am a bit confused between the 
 /etc/httpd/conf/workers.properties for apache and
 /usr/share/tomcat/conf/workers.properties

You only need one workers.properties file: it configures mod_jk for
connections to the various Tomcat instances you want to use.

 Another potential issue is that we are using apache prefork. From what I
 have googled so far it looks like apache mpm would be better for us. We
 typically have one apache box sitting in front of 12 tomcats.

Prefork works just fine with mod_jk. IIRC, mpm does /not/ work well with
mod_jk (or maybe you just have to be careful?).

- -chris

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

iD8DBQFGzubP9CaO5/Lv0PARAoBvAJ9EYXMnQ5PZmEj768goCfTOap/k5QCeKf6+
S/IYcgNVyeSFW7FjI0d4j74=
=Qra3
-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]



Re: Tomcat response time extremely high (minutes)

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rapthor,

Rapthor wrote:
 But after 1 day the same issue reappeared (response times of about 2
 minutes).

When you observe the lng response time, try doing a thread-dump of
the JVM to see what's going on. You can see which threads are waiting on
what. You'll probably see a lot of threads doing nothing (waiting for
requests) and one thread doing something (the thread that's taking 2
minutes).

You can even take multiple thread dumps and see if anything changes, or
if the thread is sticking on something in particular.

(Recently, someone posted a question about startup times using APR,
which uses /dev/random for randomness data. If you are using a native
random number source for something (like encryption, or HTTPS, or secure
random session ids, or anything like that), you might be blocking
waiting for randomness to appear on that device. If you run out of other
options, you might want to read that thread for some potential insight).

- -chris

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

iD8DBQFGzue49CaO5/Lv0PARAq2kAJ9uwikNurXp+ILKu+/46AKvKwSLlACeKMEd
hXQ3caNvX1vh96i7plOkYjc=
=xta1
-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]



RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Dan Beaulieu
Right, I understand the function of the reloadable attribute. What I don't
understand is how on a modern computer, registering 2000 locations in
memory/on disk to check for changes could take over a minute. Imagine just
what it is doing, it isn't even checking for changes yet, its just
registering the classes to check for changes. 

Not to mention, it doesn't really make sense when using an unpackable war.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 5:25 PM
To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

even then, you should set reloadable=false
the flag name is misleading, all apps are reloadable, regardless of what 
that setting is (basically autoDeploy=true - webapps are reloadable)

read up on the reloadable flag, you'll see that it actually would add 
all 2000 files to be monitored by tomcat, and could have noticeable impact

Filip

Dan Beaulieu wrote:
 Reloadable is true, and unpack is false.

 If we tell it to unpack it'll take a long time to start up, but then
 subsequent start ups with out deleting the webapp dir are fast.

 Agreed, reloadable shouldn't have that much of an impact.

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 23, 2007 2:43 PM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
 startup with unpacked WAR

 Is it unpacking the war during startup? Unzipping 2000 files takes a
 while (even if they're small).
   




-
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: Open a session based on the session id

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hernâni,

Don't hijack threads. Please post a new question.

- -chris

Hernâni Henrique Ramos Cerqueira wrote:
 Hello all,
 I'm developing a webapp that does lots of ajax requests, but I need to
 keep track of the session. Wath i do is to read the JSESSIONID cookie
 with javascript and send the value as a POST parameter when I make the
 request, but then tomcat doesn't open the session automaticaly. My
 question is the following: Is there a way of calling the rigth session
 based on the session id passed on the post parameter?
 
 Thanks in advance,
 Cheers, Hernâni
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGzuXn9CaO5/Lv0PARAq+XAKCMPau4Sei6eR5etAR40Y1ijfcNawCfa+e8
mxdcstbA6kTnokVMr7iiFQM=
=ZbeP
-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]



Re: Open a session based on the session id

2007-08-24 Thread Hernâni Henrique Ramos Cerqueira
Sex, 2007-08-24 às 10:06 -0400, Christopher Schultz escreveu:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hernâni,
 
 Don't hijack threads. Please post a new question.

???
 
 - -chris
 
 Hernâni Henrique Ramos Cerqueira wrote:
  Hello all,
  I'm developing a webapp that does lots of ajax requests, but I need to
  keep track of the session. Wath i do is to read the JSESSIONID cookie
  with javascript and send the value as a POST parameter when I make the
  request, but then tomcat doesn't open the session automaticaly. My
  question is the following: Is there a way of calling the rigth session
  based on the session id passed on the post parameter?
  
  Thanks in advance,
  Cheers, Hernâni
  
  
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGzuXn9CaO5/Lv0PARAq+XAKCMPau4Sei6eR5etAR40Y1ijfcNawCfa+e8
 mxdcstbA6kTnokVMr7iiFQM=
 =ZbeP
 -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]



Open a session based on the session id

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hernâni,

 I'm developing a webapp that does lots of ajax requests, but I need to
 keep track of the session. What I do is to read the JSESSIONID cookie
 with javascript and send the value as a POST parameter when I make the
 request, but then tomcat doesn't open the session automaticaly.

That's because Tomcat doesn't read POST parameters to look for a session
id. You need to encode the session id in the URL if you are not sure
that your browser will send a cookie.

Try something like this:

var sessionId =  ; read cookie
var URL = http://./foo/bar.baz;; + sessionId + ?param=valueamp;

Note that this is all very silly, since you're using javascript to sniff
the sessionid from a cookie. If you already have a cookie, then the
browser /is/ using cookies, and you don't need to do any of this since
the browser will send the cookie to the server automatically.

- -chris

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

iD8DBQFGzu2t9CaO5/Lv0PARAvURAJ9RXeteg31i2VconN67NaChphXtWgCgw207
FwfauFTn+WvmJ9m/Aea/tmQ=
=L5Bf
-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]



Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Filip Hanik - Dev Lists

Dan Beaulieu wrote:

Right, I understand the function of the reloadable attribute. What I don't
understand is how on a modern computer, registering 2000 locations in
memory/on disk to check for changes could take over a minute. Imagine just
what it is doing, it isn't even checking for changes yet, its just
registering the classes to check for changes. 
  
you have unpackWARs=false, that means that it has to unzip/extract 
2000 files in memory from your .war file, one by one


Filip

Not to mention, it doesn't really make sense when using an unpackable war.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 5:25 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

even then, you should set reloadable=false
the flag name is misleading, all apps are reloadable, regardless of what 
that setting is (basically autoDeploy=true - webapps are reloadable)


read up on the reloadable flag, you'll see that it actually would add 
all 2000 files to be monitored by tomcat, and could have noticeable impact


Filip

Dan Beaulieu wrote:
  

Reloadable is true, and unpack is false.

If we tell it to unpack it'll take a long time to start up, but then
subsequent start ups with out deleting the webapp dir are fast.

Agreed, reloadable shouldn't have that much of an impact.

-Original Message-
From: Len Popp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 2:43 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Is it unpacking the war during startup? Unzipping 2000 files takes a
while (even if they're small).
  






-
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: workers.properties confusion

2007-08-24 Thread gerocoma-forophp
I think that really depends on the path you use inside
your httpd.conf. That's the place where you specify
which workers.properties to use.

Cheers.


--- [EMAIL PROTECTED] escribió:

 Cool, it is starting to make a bit more sense.
 
 Does that mean that setting settings in
 apache:/etc/httpd/conf/workers.properties will
 override any
 workers.properties set in tomcat servers?
 
  -Original Message-
  From: Christopher Schultz
 [mailto:[EMAIL PROTECTED] 
  Sent: 24 August 2007 15:10
  To: Tomcat Users List
  Subject: Re: workers.properties confusion
  
  [EMAIL PROTECTED] wrote:
   However I am a bit confused between the 
   /etc/httpd/conf/workers.properties for apache
 and 
   /usr/share/tomcat/conf/workers.properties
  
  You only need one workers.properties file: it
 configures 
  mod_jk for connections to the various Tomcat
 instances you 
  want to use.
  
   Another potential issue is that we are using
 apache 
  prefork. From what 
   I have googled so far it looks like apache mpm
 would be 
  better for us. 
   We typically have one apache box sitting in
 front of 12 tomcats.
  
  Prefork works just fine with mod_jk. IIRC, mpm
 does /not/ 
  work well with mod_jk (or maybe you just have to
 be careful?).
  
 
 One less thing to worry about then for now. Only
 reason I thought it
 might be an issue was because some web pages suggest
 mpm scales better,
 and works better on multi cpu systems.
 
 Regards
 

__
 This email has been scanned by the MessageLabs Email
 Security System.
 For more information please visit
 http://www.messagelabs.com/email 

__
 

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



  

¡Sé un mejor fotógrafo!
Perfecciona tu técnica y encuentra las mejores fotos.   
http://mx.yahoo.com/promos/mejorfotografo.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]



RE: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Dan Beaulieu
Well I guess this gets into the nuances of classloaders that I am completely
unfamiliar with, but I wonder why it would be any different if those few
thousand classes are now packed in a jar and made available as a library to
the webapp?

We run our standalone appserver from a jar, and loading is instantaneous,
and it has even more classes than the webapp does, from my point of view, it
should be no different.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 10:42 AM
To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Dan Beaulieu wrote:
 Right, I understand the function of the reloadable attribute. What I don't
 understand is how on a modern computer, registering 2000 locations in
 memory/on disk to check for changes could take over a minute. Imagine just
 what it is doing, it isn't even checking for changes yet, its just
 registering the classes to check for changes. 
   
you have unpackWARs=false, that means that it has to unzip/extract 
2000 files in memory from your .war file, one by one

Filip
 Not to mention, it doesn't really make sense when using an unpackable war.

 -Original Message-
 From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 23, 2007 5:25 PM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
 startup with unpacked WAR

 even then, you should set reloadable=false
 the flag name is misleading, all apps are reloadable, regardless of what 
 that setting is (basically autoDeploy=true - webapps are reloadable)

 read up on the reloadable flag, you'll see that it actually would add 
 all 2000 files to be monitored by tomcat, and could have noticeable impact

 Filip

 Dan Beaulieu wrote:
   
 Reloadable is true, and unpack is false.

 If we tell it to unpack it'll take a long time to start up, but then
 subsequent start ups with out deleting the webapp dir are fast.

 Agreed, reloadable shouldn't have that much of an impact.

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 23, 2007 2:43 PM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
 startup with unpacked WAR

 Is it unpacking the war during startup? Unzipping 2000 files takes a
 while (even if they're small).
   
 




 -
 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: Need a way to identify tomcat instances at run-time

2007-08-24 Thread Brian Barnett
Chris,
I don't know what you mean by your response.

-Original Message-
From: Christopher Schultz [mailto:[EMAIL PROTECTED]
Sent: Friday, August 24, 2007 6:43 AM
To: Tomcat Users List
Subject: Re: Need a way to identify tomcat instances at run-time


-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brian,

Don't hijack threads. Please post a new question to the list.

- -chris

Brian Barnett wrote:
 I have a struts-based application running on multiple tomcat instances, load 
 balanced by a hardware load balancer, i.e., no Apache Web Server. I need a 
 way at run-time to know which tomcat instance it is. Is there a way to access 
 info in the server.xml or context.xml file at run-time? Can I specify some 
 arbitrary value in either of those xml files that would be available at 
 run-time? Is there some other way to identify the tomcat instance at 
 run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?
 
 Any ideas would be appreciated.
 
 Thanks,
 Brian Barnett
 
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGztJG9CaO5/Lv0PARApqyAJ4kMXAN9wVMarjnz/0XPx6+ZyKoFQCgkrqm
oXqOaGXmC/OFVdo0WY+2erM=
=3Ack
-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: workers.properties confusion

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Gerhardus,

[EMAIL PROTECTED] wrote:
 Does that mean that setting settings in
 apache:/etc/httpd/conf/workers.properties will override any
 workers.properties set in tomcat servers?

Tomcat never deals with workers.properties at all. Only mod_jk (within
Apache httpd) reads this file.

- -chris

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

iD8DBQFGzuyk9CaO5/Lv0PARAjNdAJ9jkrqsJsEuu8J+FBLmA7WnDhTvwQCgufj3
r5K5aJDiKJrTZhiys7UVpV8=
=Fjhh
-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]



Re: Open a session based on the session id

2007-08-24 Thread Hernâni Henrique Ramos Cerqueira
Thanks, I always tough that with ajax requests cookies were not sended.
This is my first application that mixes ajax requests and session
tracking, and becaus I was not able to read session info, I immediately
assumed that (and i think i had read that somewhere). But the problem
was with the info... My bad, but thanks anyway.

Cheers,
Hernâni

Sex, 2007-08-24 às 10:39 -0400, Christopher Schultz escreveu:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Hernâni,
 
  I'm developing a webapp that does lots of ajax requests, but I need to
  keep track of the session. What I do is to read the JSESSIONID cookie
  with javascript and send the value as a POST parameter when I make the
  request, but then tomcat doesn't open the session automaticaly.
 
 That's because Tomcat doesn't read POST parameters to look for a session
 id. You need to encode the session id in the URL if you are not sure
 that your browser will send a cookie.
 
 Try something like this:
 
 var sessionId =  ; read cookie
 var URL = http://./foo/bar.baz;; + sessionId + ?param=valueamp;
 Note that this is all very silly, since you're using javascript to sniff
 the sessionid from a cookie. If you already have a cookie, then the
 browser /is/ using cookies, and you don't need to do any of this since
 the browser will send the cookie to the server automatically.
 
 - -chris
 
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.7 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
 iD8DBQFGzu2t9CaO5/Lv0PARAvURAJ9RXeteg31i2VconN67NaChphXtWgCgw207
 FwfauFTn+WvmJ9m/Aea/tmQ=
 =L5Bf
 -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: Clustering/Session Replication

2007-08-24 Thread Dwayne
There are some advantages and you can gain higher availability and therefore
improved performance from clustering a single machine.

In my little apps I use terracotta.  Open source Java clustering tool that
lets me acheive a pretty good distributed cache without manually rewriting
code to work with more than one JVM.  They have  thei great tool in the
management console that helps performance tuning.

check 'em out.  The download comes with examples that are actually fun to
play with. terracotta.org

Dwayne Individual

On 8/24/07, Andrew Hole [EMAIL PROTECTED] wrote:

 Hello!

 What's benefits of using Clustering/Session Replication on same machine?

 Thanks a lot



Re: A Global Error Page (JSP or JSF)

2007-08-24 Thread samk
It works most of the time but sometimes it doesn't for no discernible reason. 
:( One of life's great mysteries that I am looking in to.


In Response To: 

Hi Chris,

I guess you're question pointed to Sam, right?

Anyways, that's also what I think.

According to the specs a *noncaught* exception should trigger the errorpage

At least here it's working as expected ;)

Cheers

Gregor
-- 
what's puzzlin' you, is the nature of my game
gpgp-fp: 79A84FA526807026795E4209D3B3FE028B3170B2
gpgp-key available @ http://pgpkeys.pca.dfn.de:11371

-
To start a new topic, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



 Sent from Techienuggets Netbeans IDE Forum: 
http://www.techienuggets.com/Detail?tx=11104

-
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 looses POST parameters

2007-08-24 Thread M4N - Arjan Tijms

Hi,

We're hosting a fairly high traffic web application based on Tomcat. 
It's running on Debian-Etch, JDK 5.0U10 and Tomcat 5.5.20. We're using 
Apache as a front-end with the AJP connector.


The problem I'm encountering is that for a percentage of the POST 
requests, Tomcat seems to loose all parameters. Our application uses a 
filter that logs the (first few characters of) post parameters. This 
filter is installed as the first one in the filter chain, so nothing 
else can interfere with it. For requests originating from pages which 
logically can not produce such an empty post request, the log clearly 
shows there are no parameters.


The problem is often fairly random, although I have been able to 
consistently reproduce it on one occasion. Using a proxy server to 
monitor what my browser was sending, I clearly saw in the raw HTTP 
headers that parameters where being send, yet they weren't received in 
Tomcat. I also enabled TCP/IP packet logging at the server for a while. 
For requests that appeared with empty parameters in Tomcat, the tcp/ip 
log showed the parameters did arrive at the server.


Next to that I enabled debug logging in the AJP connector, and again the 
POST parameters were in the HTTP request but not present when the 
mentioned filter logged the request in Tomcat.


I did notice though that the overwhelming majority of the empty post 
requests concerned Faces requests (we're using MyFaces 1.1.4). We store 
state on client, so typical Faces HTTP post requests are at least 22KB 
in size. Nevertheless, thousands of requests from the same pages from 
all kinds of different browsers arrive with the post parameters intact.


I'm at a loss here how to proceed. Naturally I could change JSF to keep 
state on server, but because of the way some custom components work 
that's currently not an option. It would also not really solve the 
underlying problem of course.


Any help would be greatly appreciated


Kind regards,
Arjan Tijms

--
It's a cult. If you've coded for any length of time, you've run across someone 
from this warped brotherhood. Their creed: if you can write complicated code, 
you must be good.


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



Need a way to identify tomcat instances at run-time

2007-08-24 Thread Brian Barnett
I have a struts-based application running on multiple tomcat instances, load
balanced by a hardware load balancer, i.e., no Apache Web Server. I need a
way at run-time to know which tomcat instance it is. Is there a way to
access info in the server.xml or context.xml file at run-time? Can I specify
some arbitrary value in either of those xml files that would be available at
run-time? Is there some other way to identify the tomcat instance at
run-time? Is there a way to access CATALINA_HOME or CATALINA_BASE at
run-time?

Any ideas would be appreciated.

Thanks,
Brian Barnett


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



Apache authentication information (remoteuser) not visible in Tomcat

2007-08-24 Thread Omar Nafees

Hello,


request.getRemoteUser() returns null in my servlet. 
request.getAttribute(REMOTE_USER) also returns null. I have even 
checked the headers that are being sent to the AJP connector in Tomcat.




Here's what I'm running: apache-2.0.59 in front of tomcat-5.5.23_1 via 
mod_jk-ap2-1.2.23 on FreeBSD 6.2



Snippet of AJP13 header:

0180  6c 61 74 65 00 a0 02 00  07 55 54 46 2d 38 2c 2a   late .UTF-8,*
0190  00 00 0a 4b 65 65 70 2d  41 6c 69 76 65 00 00 03   ...Keep- Alive...
01a0  33 30 30 00 a0 06 00 0a  6b 65 65 70 2d 61 6c 69   300. keep-ali
01b0  76 65 00 a0 05 00 22 42  61 73 69 63 20 62 32 31   veB asic b21
01c0  75 59 57 5a 6c 5a 58 4d  36 5a 6d 46 79 61 54 67   uYWZlZXM 6ZmFyaTg
01d0  35 4f 44 41 32 4e 7a 67  3d 00 a0 08 00 01 30 00   5ODA2Nzg =.0.
01e0  03 00 08 6f 6d 6e 61 66  65 65 73 00 04 00 05 42   ...omnaf eesB
01f0  61 73 69 63 00 0a 00 0b  52 45 4d 4f 54 45 5f 55   asic REMOTE_U
0200  53 45 52 00 00 08 6f 6d  6e 61 66 65 65 73 00 ff   SER...om nafees..


How do I get Tomcat servlet to read remote user as sent above??



Below I reproduce three relevant configuration files:


*
The mod_jk.conf that is included in apache 2's httpd.conf:


   ServerName localhost

   JkMount /webdav ajp13
   JkMount /webdav/* ajp13

   JkMount /servlets-examples ajp13
   JkMount /servlets-examples/* ajp13

   JkMount /jsp-examples ajp13
   JkMount /jsp-examples/* ajp13

   JkMount /balancer ajp13
   JkMount /balancer/* ajp13

   JkMount /~omnafees ajp13
   JkMount /~omnafees/* ajp13

   JkMount /tomcat-docs ajp13
   JkMount /tomcat-docs/* ajp13

   JkMount /submitServer ajp13
   JkMount /submitServer/* ajp13



### Customizations
# Where to put jk logs
JkLogFile /var/log/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel error
# Select the log format
JkLogStampFormat [%a %b %d %H:%M:%S %Y] 
# JkOptions indicate to send SSL KEY SIZE,
#JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat %b %w %V %T %r
# environment variable?
JkEnvVar REMOTE_USER

### Omar's authentication testing
Location /submitServer/*
AuthType Basic
AuthName By Invitation Only
AuthUserFile /usr/local/etc/apache/passwd/passwords
Require valid-user
/Location
***

***
The worker.properties file:

worker.list=ajp13

worker.ajp13.port=8009
worker.ajp13.host=localhost
worker.ajp13.type=ajp13
***

***
Tomcat's server.xml:


!-- Note that component elements are nested corresponding to their
parent-child relationships with each other --

!-- A Server is a singleton element that represents the entire JVM,
which may contain one or more Service instances.  The Server
listens for a shutdown command on the indicated port.

Note:  A Server is not itself a Container, so you may not
define subcomponents such as Valves or Loggers at this level.
--

Server port=8005 shutdown=SHUTDOWN

 !-- Comment these entries out to disable JMX MBeans support used for the
  administration web application --
 Listener className=org.apache.catalina.core.AprLifecycleListener /
 Listener 
className=org.apache.catalina.mbeans.ServerLifecycleListener /
 Listener 
className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener /
 Listener 
className=org.apache.catalina.storeconfig.StoreConfigLifecycleListener/


 !-- Global JNDI resources --
 GlobalNamingResources

   !-- Test entry for demonstration purposes --
   Environment name=simpleValue type=java.lang.Integer value=30/

   !-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users --
   Resource name=UserDatabase auth=Container
 type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
 pathname=conf/tomcat-users.xml /

 /GlobalNamingResources

 !-- A Service is a collection of one or more Connectors that share
  a single Container (and therefore the web applications visible
  within that Container).  Normally, that Container is an Engine,
  but this is not required.

  Note:  A Service is not itself a Container, so you may not
  define subcomponents such as Valves or Loggers at this level.
  --

 !-- Define the Tomcat Stand-Alone Service --
 Service name=Catalina

   !-- A Connector represents an endpoint by which requests are received
and responses are returned.  Each Connector passes requests 

Re: Need a way to identify tomcat instances at run-time

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Brian,

Brian Barnett wrote:
 I have a struts-based application running on multiple tomcat
 instances, load balanced by a hardware load balancer, i.e., no Apache
 Web Server. I need a way at run-time to know which tomcat instance it
 is. Is there a way to access info in the server.xml or context.xml
 file at run-time? Can I specify some arbitrary value in either of
 those xml files that would be available at run-time?

Yes. Look into the Environment element within GlobalNamingResources.

http://tomcat.apache.org/tomcat-5.5-doc/config/globalresources.html

 Is there some other way to identify the tomcat instance at run-time?

Yes. You could set CATALINA_OPTS to include '-Dserver.id=whatever' in
your startup script. Then you can simply access this value using
System.getProperty(server.id).

 Is there a way to access CATALINA_HOME or CATALINA_BASE at run-time?

I don't think there's a reliable way to do this.

- -chris

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

iD8DBQFGzxBe9CaO5/Lv0PARAihCAJ4nvbj2r0F/PX/I6f6O8GMGl2QI/ACfctDM
/AB6MCyxh9QGQ+8oExgFjNA=
=vYWb
-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]



Re: Need a way to identify tomcat instances at run-time

2007-08-24 Thread DJohnson
There may be better ways, but one approach which occurs to me is to set 
unique jvmRoute values on the engines in the server.xml.  Even though you 
aren't using mod_jk, this will result in the provided values being 
appended to the sessionid.  Assuming that you are establishing sessions, 
and that your hardware balancer has sticky session logic, so once a 
session is established, the user's subsequent requests get sent to the 
same backend, this would allow you to distinguish which tomcat instance is 
being used when processing a request for a user.  This would be apparent 
within your webapp by examining the sessionid, but also from the client 
side, by examining the jsessionid cookie value.



Please respond to Tomcat Users List users@tomcat.apache.org

To: Tomcat Users List users@tomcat.apache.org
cc:  
Subject:Need a way to identify tomcat instances at run-time


I have a struts-based application running on multiple tomcat instances, 
load balanced by a hardware load balancer, i.e., no Apache Web Server. I 
need a way at run-time to know which tomcat instance it is. Is there a way 
to access info in the server.xml or context.xml file at run-time? Can I 
specify some arbitrary value in either of those xml files that would be 
available at run-time? Is there some other way to identify the tomcat 
instance at run-time? Is there a way to access CATALINA_HOME or 
CATALINA_BASE at run-time?

Any ideas would be appreciated.

Thanks,
Brian Barnett



-
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: Need a way to identify tomcat instances at run-time

2007-08-24 Thread Nelson, Tracy M.
| From: Brian Barnett [mailto:[EMAIL PROTECTED]
| Sent: Friday, 24 August, 2007 11:54
| 
| I have a struts-based application running on multiple tomcat
instances,
| load
| balanced by a hardware load balancer, i.e., no Apache Web Server. I
need a
| way at run-time to know which tomcat instance it is. Is there a way to
| access info in the server.xml or context.xml file at run-time? Can I
| specify
| some arbitrary value in either of those xml files that would be
available
| at
| run-time?

You could pass something as an init-param to your servlets.  Or you can
get the server name from the HttpRequest.  If you're not deploying each
instance from a common war file, you could stick a simple config file in
your WEB-INF directory with some kind of instance name or ID.
 

-

The information contained in this message is confidential
proprietary property of Nelnet, Inc. and its affiliated 
companies (Nelnet) and is intended for the recipient only.
Any reproduction, forwarding, or copying without the express
permission of Nelnet is strictly prohibited. If you have
received this communication in error, please notify us
immediately by replying to this e-mail.


-
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 authentication information (remoteuser) not visible in Tomcat

2007-08-24 Thread Omar Nafees
Thanks for the response Christopher... although I had very early on, 
already tried what is suggested in the link you have referred to, i.e., 
setting tomcatAuthentication=false in the appropriate server.xml line 
(see the config listing I produced earlier in the thread).


Oh I hope its not some obscure bug in mod_jk!! :)

Thanks,
Omar



Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Omar,

Omar Nafees wrote:
  

request.getRemoteUser() returns null in my servlet.
request.getAttribute(REMOTE_USER) also returns null. I have even
checked the headers that are being sent to the AJP connector in Tomcat.



This is a FAQ. The answer is easily findable in the archives:

http://www.nabble.com/forum/ViewPost.jtp?post=3132974framed=y

- -chris

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

iD8DBQFGzxDY9CaO5/Lv0PARAi0fAKC+7Rb+k5E3fEPFGhhiXvXumpz9QwCgwgss
OPTfCFM5pLAQ0jH0i+BCkis=
=+c/H
-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]
  


Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Filip Hanik - Dev Lists

Dan Beaulieu wrote:

Well I guess this gets into the nuances of classloaders that I am completely
unfamiliar with, but I wonder why it would be any different if those few
thousand classes are now packed in a jar and made available as a library to
the webapp?
  
nothing to do with classloading, all to do with resource monitoring, 
as you set reloadable=true
but by now, you should have changed that to reloadable=false and 
control what gets monitored using the WatchedResource element in your 
context config instead


Filip


We run our standalone appserver from a jar, and loading is instantaneous,
and it has even more classes than the webapp does, from my point of view, it
should be no different.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 10:42 AM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Dan Beaulieu wrote:
  

Right, I understand the function of the reloadable attribute. What I don't
understand is how on a modern computer, registering 2000 locations in
memory/on disk to check for changes could take over a minute. Imagine just
what it is doing, it isn't even checking for changes yet, its just
registering the classes to check for changes. 
  

you have unpackWARs=false, that means that it has to unzip/extract 
2000 files in memory from your .war file, one by one


Filip
  

Not to mention, it doesn't really make sense when using an unpackable war.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 5:25 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

even then, you should set reloadable=false
the flag name is misleading, all apps are reloadable, regardless of what 
that setting is (basically autoDeploy=true - webapps are reloadable)


read up on the reloadable flag, you'll see that it actually would add 
all 2000 files to be monitored by tomcat, and could have noticeable impact


Filip

Dan Beaulieu wrote:
  


Reloadable is true, and unpack is false.

If we tell it to unpack it'll take a long time to start up, but then
subsequent start ups with out deleting the webapp dir are fast.

Agreed, reloadable shouldn't have that much of an impact.

-Original Message-
From: Len Popp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 2:43 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Is it unpacking the war during startup? Unzipping 2000 files takes a
while (even if they're small).
  

  



-
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]



applet-servlet communication, object serialization (tomcat 5.5)

2007-08-24 Thread Daniel Slamanig

hi,

I encountered a problem with tomcat 5.5. Grazing the whole web i didn't 
find any solution (some guys are having the same problem but they also 
got no useful hint up to now). The problem is as follows:
I try to build an applet-servlet communication using serialized objects. 
   In my test scenario i write a serialized standard java object (e.g. 
a String object) onto the ObjectOutputStream of the 
applet/test-application (it doesn't matters wheter to use the first or 
the latter one for test cases) and the doPost method of the servlet 
reads the object from the ObjectInputStream. That works fine. But if i 
use customized objects (which should also work fine) the same code 
produces an classnotfound exception (when i try to read and cast the 
object: TestMessage e = (TestMessage)objin.readObject();):


java.lang.ClassNotFoundException: TestMessage
	at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1359)
	at 
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1205)

at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
...

That seems strange to me, because if i instantiate an object of the same 
customized class (TestMessage) in the servlet code, the 
webappclassloader doesn't have any problems loading and handling the 
class and the code works fine!
The class is located in the web-inf/classes directory of the 
application. I've already tried to put the class (with and without the 
package structure) into the common/classes and server/classes directory, 
but the exception stays the same (I've also tried to build a jar and put 
it in the appropriate lib directories).
I've also tried to catch a Throwable object in order to get information 
on the cause. But i get a null value (the  docu says, that this will 
may be caused by an unknown error).
I've also inspected the log files intensively. But they gave me no hint. 
Until now I've spend a lot of time on searching and messing around but i 
always get this classnotfound exception.
I hope this is the right place to post this problem and i hope that 
there is anyone out there who can give me some hint on solving this 
problem.


Kindly regards,
Daniel


--
If we knew what it was we were doing, it would not be called research, 
would it?

--Albert Einstein--

-
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: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Dan Beaulieu
I'm not even concerned with the webapp being automatically reloadable. I can
reload from the manager or just bounce tomcat. Mentioning WatchedResource is
a red herring.

If I war a webapp with many class files in various packages in
WEB-INF/classes with reloadable=false and unpackwars=false it will take over
a minute to start the server. 

If I war a webapp with only my servlet class in WEB-INF/classes and place
the dependent class files in a jar and put that jar in WEB-INF/lib with
reloadable=false and unpackwars=false then it only takes a few seconds for
the server to start.

Not to mention on a less powerful windows xp machine the first scenario
starts in seconds...


-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 2:39 PM
To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Dan Beaulieu wrote:
 Well I guess this gets into the nuances of classloaders that I am
completely
 unfamiliar with, but I wonder why it would be any different if those few
 thousand classes are now packed in a jar and made available as a library
to
 the webapp?
   
nothing to do with classloading, all to do with resource monitoring, 
as you set reloadable=true
but by now, you should have changed that to reloadable=false and 
control what gets monitored using the WatchedResource element in your 
context config instead

Filip

 We run our standalone appserver from a jar, and loading is instantaneous,
 and it has even more classes than the webapp does, from my point of view,
it
 should be no different.

 -Original Message-
 From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
 Sent: Friday, August 24, 2007 10:42 AM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
 startup with unpacked WAR

 Dan Beaulieu wrote:
   
 Right, I understand the function of the reloadable attribute. What I
don't
 understand is how on a modern computer, registering 2000 locations in
 memory/on disk to check for changes could take over a minute. Imagine
just
 what it is doing, it isn't even checking for changes yet, its just
 registering the classes to check for changes. 
   
 
 you have unpackWARs=false, that means that it has to unzip/extract 
 2000 files in memory from your .war file, one by one

 Filip
   
 Not to mention, it doesn't really make sense when using an unpackable
war.

 -Original Message-
 From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 23, 2007 5:25 PM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
 startup with unpacked WAR

 even then, you should set reloadable=false
 the flag name is misleading, all apps are reloadable, regardless of what 
 that setting is (basically autoDeploy=true - webapps are reloadable)

 read up on the reloadable flag, you'll see that it actually would add 
 all 2000 files to be monitored by tomcat, and could have noticeable
impact

 Filip

 Dan Beaulieu wrote:
   
 
 Reloadable is true, and unpack is false.

 If we tell it to unpack it'll take a long time to start up, but then
 subsequent start ups with out deleting the webapp dir are fast.

 Agreed, reloadable shouldn't have that much of an impact.

 -Original Message-
 From: Len Popp [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, August 23, 2007 2:43 PM
 To: Tomcat Users List
 Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow
server
 startup with unpacked WAR

 Is it unpacking the war during startup? Unzipping 2000 files takes a
 while (even if they're small).
   
 
   


 -
 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 

Re: very slow upload over SSL

2007-08-24 Thread Filip Hanik - Dev Lists

try adding a larger read buffer
socket.appReadBufSize=34000

or even larger than that.

or apply this patch
http://svn.apache.org/viewvc?view=revrevision=569489, that makes 
adjustments for the buffer sizes automatically


Filip

Hoa Doan wrote:

Hi,

I am trying to upload a file size of 2MB to my server.  Doing it without SSL 
takes only 1 sec but doing it over SSL takes so long that the server time out.  
Longer than 10 min!
I have searched everywhere but I can't find any solution.  Please help.

Server Specs:
Window XP
Tomcat 6
   Connector:
Connector protocol=org.apache.coyote.http11.Http11NioProtocol
   port=443 minSpareThreads=5 maxSpareThreads=75
   enableLookups=true disableUploadTimeout=true 
   acceptCount=100  maxThreads=200

   scheme=https secure=true SSLEnabled=true
   keystoreFile=C:/keystore/.keystore keystorePass=changeit
   clientAuth=false sslProtocol=TLS/

Thank you,
Henry

   
-

Choose the right car based on your needs.  Check out Yahoo! Autos new Car 
Finder tool.
  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.476 / Virus Database: 269.11.8/941 - Release Date: 8/7/2007 4:06 PM
  



-
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 authentication information (remoteuser) not visible in Tomcat

2007-08-24 Thread Robert Segal
Omar I actually had this exact same problem early today although I'm
sure my environment is slightly different from your perhaps I can offer
some help.  

In my case I have LDAP authentication configured for my servlet.  I
believe this step should be the same regardless of the authentication
scheme you are using
  
First I edit CATALINA_HOME/webapps/myServelet/WEB-INF/web.xml to define
roles and constraints for what pages can be accessed...

login-config
auth-methodBASIC/auth-method
  /login-config

  security-role
role-nameGRP-myGroup /role-name
  /security-role

  security-constraint
web-resource-collection
  web-resource-namemy Authentication/web-resource-name
  url-pattern/*/url-pattern
/web-resource-collection

auth-constraint
  role-nameGRP-myGroup/role-name
/auth-constraint
  /security-constraint


The other file I change sets up all the LDAP machine details.  I've
placed it in Context.xml because there are several servlets that make
use of this authentication...

$CATALINA_HOME/conf/Context.xml

Context
Realm className   =org.apache.catalina.realm.JNDIRealm
 debug =99
 connectionURL =ldap://ldapMachine:3268;
 connectionName=CRYPTOLOGIC\myUser
 connectionPassword=myPassword  

userBase  =dc=myDomain,dc=com
 userSearch=(sAMAccountName={0})
 userSubtree   =true
 userRoleName  =memberOf
 
 roleBase   =OU=Groups,DC=myDomain,DC=com
 roleSubtree=false
 roleName   =cn
 roleSearch =(member={0})/
/Context

This has worked for me.  Hope it is of some use to you.  We also have
Apache over top of Tomcat in our environment and found it necessary to
configure authentication both in Apache and in Tomcat to get things to
work properly.

Robert Segal
Tools Developer
CryptoLogic Inc.
55 St. Clair Ave W., 3rd Floor
Toronto, Ontario
Canada  M4V 2Y7
tel.  + 1.416.545.1455 x5896
fax. + 1.416.545.1454

This message, including any attachments, is confidential and/or
privileged and contains information intended only for the person(s)
named above. Any other distribution, copying or disclosure is strictly
prohibited. If you are not the intended recipient or have received this
message in error, please notify us immediately by reply email and
permanently delete the original transmission from all of your systems
and hard drives, including any attachments, without making a copy.

-Original Message-
From: Omar Nafees [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 2:30 PM
To: Tomcat Users List
Subject: Re: Apache authentication information (remoteuser) not visible
in Tomcat

Thanks for the response Christopher... although I had very early on, 
already tried what is suggested in the link you have referred to, i.e., 
setting tomcatAuthentication=false in the appropriate server.xml line 
(see the config listing I produced earlier in the thread).

Oh I hope its not some obscure bug in mod_jk!! :)

Thanks,
Omar



Christopher Schultz wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Omar,

 Omar Nafees wrote:
   
 request.getRemoteUser() returns null in my servlet.
 request.getAttribute(REMOTE_USER) also returns null. I have even
 checked the headers that are being sent to the AJP connector in
Tomcat.
 

 This is a FAQ. The answer is easily findable in the archives:

 http://www.nabble.com/forum/ViewPost.jtp?post=3132974framed=y

 - -chris

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

 iD8DBQFGzxDY9CaO5/Lv0PARAi0fAKC+7Rb+k5E3fEPFGhhiXvXumpz9QwCgwgss
 OPTfCFM5pLAQ0jH0i+BCkis=
 =+c/H
 -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]
   


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

-
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: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Filip Hanik - Dev Lists

Dan Beaulieu wrote:

I'm not even concerned with the webapp being automatically reloadable. I can
reload from the manager or just bounce tomcat. Mentioning WatchedResource is
a red herring.
  

reloadable attribute - nothing to do with reloadable apps
autoDeploy attribute - everything to do with reloadable apps
autoDeploy uses WarchedResource to find out how/when to reload an app

reloadable attribute is development use only, should never be used for 
production

If I war a webapp with many class files in various packages in
WEB-INF/classes with reloadable=false and unpackwars=false it will take over
a minute to start the server. 


If I war a webapp with only my servlet class in WEB-INF/classes and place
the dependent class files in a jar and put that jar in WEB-INF/lib with
reloadable=false and unpackwars=false then it only takes a few seconds for
the server to start.

Not to mention on a less powerful windows xp machine the first scenario
starts in seconds...
  
oh, if that's the case, the issue all together is probably not tomcat 
related, but hardware (or JVM) related.


Filip



-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 2:39 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Dan Beaulieu wrote:
  

Well I guess this gets into the nuances of classloaders that I am


completely
  

unfamiliar with, but I wonder why it would be any different if those few
thousand classes are now packed in a jar and made available as a library


to
  

the webapp?
  

nothing to do with classloading, all to do with resource monitoring, 
as you set reloadable=true
but by now, you should have changed that to reloadable=false and 
control what gets monitored using the WatchedResource element in your 
context config instead


Filip

  

We run our standalone appserver from a jar, and loading is instantaneous,
and it has even more classes than the webapp does, from my point of view,


it
  

should be no different.

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 10:42 AM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

Dan Beaulieu wrote:
  


Right, I understand the function of the reloadable attribute. What I
  

don't
  

understand is how on a modern computer, registering 2000 locations in
memory/on disk to check for changes could take over a minute. Imagine
  

just
  

what it is doing, it isn't even checking for changes yet, its just
registering the classes to check for changes. 
  

  
you have unpackWARs=false, that means that it has to unzip/extract 
2000 files in memory from your .war file, one by one


Filip
  


Not to mention, it doesn't really make sense when using an unpackable
  

war.
  

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 5:25 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server
startup with unpacked WAR

even then, you should set reloadable=false
the flag name is misleading, all apps are reloadable, regardless of what 
that setting is (basically autoDeploy=true - webapps are reloadable)


read up on the reloadable flag, you'll see that it actually would add 
all 2000 files to be monitored by tomcat, and could have noticeable
  

impact
  

Filip

Dan Beaulieu wrote:
  

  

Reloadable is true, and unpack is false.

If we tell it to unpack it'll take a long time to start up, but then
subsequent start ups with out deleting the webapp dir are fast.

Agreed, reloadable shouldn't have that much of an impact.

-Original Message-
From: Len Popp [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 23, 2007 2:43 PM

To: Tomcat Users List
Subject: Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow


server
  

startup with unpacked WAR

Is it unpacking the war during startup? Unzipping 2000 files takes a
while (even if they're small).
  

  


-
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: 

Re: Use JMX to manage applications

2007-08-24 Thread lightbulb432

In addition to my questinos below, is mbeans-descriptors.xml a
Tomcat-specific file or part of JMX in general? I can't tell - it seems to
appear in links like the following:

http://commons.apache.org/modeler/apidocs/org/apache/commons/modeler/package-summary.html

But its DTD is under commons.apache.org - so is this specific to an Apache
JMX implementation, part of JMX, or something else?



lightbulb432 wrote:
 
 The following link describes using JMX with Tomcat. Step #4 talks about
 the mbeans-descriptors.xml file, but it seems to make no difference when
 using it. If I don't include elements in that file that I do in MBean
 interface, it still works in JConsole properly - and the descriptions
 entered don't seem to show up in JConsole either.
 
 http://oss.wxnet.org/mbeans.html
 
 Also, things like the writeable property and the type property that
 are specified in this file could easily be determined from the MBean
 interface, from return types, whether a getter has a corresponding setter,
 etc. Then what is the use of this file if updating it to keep in sync with
 the MBean interface makes no difference? Is it necessary to begin with?
 
 Thanks.
 
 
 
 
 lightbulb432 wrote:
 
 How, from a web application deployed to Tomcat, can you customize the
 behavior of your web application based on attributes specified in an
 MBean? The link http://tomcat.apache.org/tomcat-6.0-doc/monitoring.html
 talks a lot about Ant tasks, but that's not really what I'm looking to
 do.
 
 How can you get programmatic access to MBeans? And how do you deploy
 MBeans to Tomcat?
 
 I'm pretty confused here...hopefully someone can clarify. Thanks.
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Use-JMX-to-manage-applications-tf3978363.html#a12319486
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]



[OT] Session replication vs stateless

2007-08-24 Thread lightbulb432

Although the debate between session replication vs stateless can't be
definitively solved and depends on the application, I'd like to hear about
your experiences with both. How are you designing your current applications,
and what implications has the choice that you might not have expected -
would you do anything differently if you could?

I ask because I'm still unsure about whether to decrease memory usage by
increasing database usage (or bandwidth usage if sending state back to the
client) by going stateless at the application tier.

Stateless

Are there any people using stateless application tiers with transactions
that are inherently stateful, such as wizard-type screens or other business
processes or workflows? How'd that turn out? 

Did you choose to move this state to the client (through cookies) or to the
database?

Session replication

For session replication in Tomcat 6, what's the ideal replication group size
in general? Would you ever want to set it to more than 2 instances? (Because
for any more, then you'd have a lot more overhead in transferring state back
and forth to even more other instances...)

With session replication between 2 machines, are you effectively reducing
the capacity of each server, at least in terms of memory, by 50%? Hopefully
I'm looking at it the wrong way, because it not, I'm not really liking the
session replication idea if I'm decreasing hardware usage by half.

Thanks.
-- 
View this message in context: 
http://www.nabble.com/-OT--Session-replication-vs-stateless-tf4325727.html#a12319704
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]



Re: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Filip,

Filip Hanik - Dev Lists wrote:
 Mentioning WatchedResource is a red herring.

 reloadable attribute - nothing to do with reloadable apps

I disagree:

relodable (Context attribute)

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/
and /WEB-INF/lib for changes, and automatically reload the web
application if a change is detected.

 autoDeploy attribute - everything to do with reloadable apps

I disagree:

autoDeploy (Host attribute)

This flag value indicates if new web applications, dropped in to the
appBase directory while Tomcat is running, should be automatically
deployed.

Although, my configuration has autoDeploy=false and unpackWARs=true,
and my WAR file dropped into appBase ends up being auto-deployed. Strange.

 autoDeploy uses WarchedResource to find out how/when to reload an app

Huh? This sound entirely backward.

 reloadable attribute is development use only, should never be used for
 production

Hey! I agree with that!

 Not to mention on a less powerful windows xp machine the first scenario
 starts in seconds...

Dan, try to get a thread dump when your server is taking forever to
startup. Just do a CRTL-\ after a waiting a few seconds after running
startup.bat and check out what the VM is doing. Who knows... maybe it's
trying to download an XML DTD from another site over a crappy connection
or something.

- -chris

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

iD8DBQFGz0WE9CaO5/Lv0PARAo+GAJ9JkB8Gw6xQgN1N4j5pgGaev2Q2KQCfX8mt
MhxZf5/TP9c8HYea4Uz4a+0=
=wq6C
-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]



Re: [OT] Session replication vs stateless

2007-08-24 Thread Dwayne
Have you considered distributed caching for session replication?  I avoid
stateless like the plague.

There are several tools out there for this, but my favorite (because they
are open source) is Terracotta.  It clusters the JVMs.
Native clustering in Tomcat putters out, in my experience, after 3 nodes.
With Terracotta, I dropped in the code and now am clustering 5 nodes and
getting a lot higher TPS.
I think it is worth the hour it took me to implement it and I didn't have to
change my code at all, just write a short XML and drop some tags around what
I wanted to distribute.
Get it at terracotta.org.  The support docs do not say they support Tomcat 6
yet, but I have yet to hit any bugs (3 weeks in).


On 8/24/07, lightbulb432 [EMAIL PROTECTED] wrote:


 Although the debate between session replication vs stateless can't be
 definitively solved and depends on the application, I'd like to hear about
 your experiences with both. How are you designing your current
 applications,
 and what implications has the choice that you might not have expected -
 would you do anything differently if you could?

 I ask because I'm still unsure about whether to decrease memory usage by
 increasing database usage (or bandwidth usage if sending state back to the
 client) by going stateless at the application tier.

 Stateless

 Are there any people using stateless application tiers with transactions
 that are inherently stateful, such as wizard-type screens or other
 business
 processes or workflows? How'd that turn out?

 Did you choose to move this state to the client (through cookies) or to
 the
 database?

 Session replication

 For session replication in Tomcat 6, what's the ideal replication group
 size
 in general? Would you ever want to set it to more than 2 instances?
 (Because
 for any more, then you'd have a lot more overhead in transferring state
 back
 and forth to even more other instances...)

 With session replication between 2 machines, are you effectively reducing
 the capacity of each server, at least in terms of memory, by 50%?
 Hopefully
 I'm looking at it the wrong way, because it not, I'm not really liking the
 session replication idea if I'm decreasing hardware usage by half.

 Thanks.
 --
 View this message in context:
 http://www.nabble.com/-OT--Session-replication-vs-stateless-tf4325727.html#a12319704
 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]




Tomcat 6 and log4j for a web application

2007-08-24 Thread fredk2

Hi,

still reading :-)  http://tomcat.apache.org/tomcat-6.0-doc/logging.html

I have setup log4j as above, but with a little twist.
If you permission $CATALINA_HOME as read only and you want to customize the
log4j.properties then you need to install the log4j1.2.14.jar and
log4j.properties in $CATALINA_BASE/lib.
You also need to adjust the catalina.properties common.loader 

common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

The tomcat logging works well. However, I have 2 questions related to
installing log4j for a web application:

1.  why does the documentation say to add log4j1.2.x.jar to the WEB-INF/lib, 
isn't it already loaded by the common.loader at this point?

2.  is there a way to add a WEB-INF/classes/log4j.properties to log to
myapp1.log and capture all the logs related to the web application ?  Why
would'nt the following create a myapp1.log?

myapp1/WEB-INF/classes/log4j.properties -

log4j.debug=TRUE
log4j.rootLogger=DEBUG,myapp1

# test logger
log4j.logger.org.apache=DEBUG,myapp1

# Log rotation
log4j.appender.myapp1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.myapp1.File=${catalina.base}/logs/myapp1.log
log4j.appender.myapp1.DatePattern='.'-MM-dd
# Print the date in ISO 8601 format
log4j.appender.myapp1.layout=org.apache.log4j.PatternLayout
log4j.appender.myapp1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


Any hints - suggestions are appreciated,
Many Thanks - Fred
-- 
View this message in context: 
http://www.nabble.com/Tomcat-6-and-log4j-for-a-web-application-tf4325752.html#a12319790
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]



java.lang.NoClassDefFoundError

2007-08-24 Thread Dave Sailer
I have a webapp that is working but I wanted to update a servlet jar so:

jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib

No I get the exception shown below. I have MyServlet stripped down so
the only imports are:
import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;


I can't see how replacing one servlet that has few dependencies is
causing an unrelated NoClassDefFoundError.




javax.servlet.ServletException:
net/whohah/portal/exceptions/MyServletException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause 

java.lang.NoClassDefFoundError:
net/whohah/portal/exceptions/MyServletException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
java.lang.Class.getConstructor0(Class.java:2671)
java.lang.Class.newInstance0(Class.java:321)
java.lang.Class.newInstance(Class.java:303)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


-
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: Tomcat6, apache2, mod_jk, non-APR, windows 2000, slow server startup with unpacked WAR

2007-08-24 Thread Filip Hanik - Dev Lists

Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Filip,

Filip Hanik - Dev Lists wrote:
  

Mentioning WatchedResource is a red herring.
  

reloadable attribute - nothing to do with reloadable apps



I disagree:

relodable (Context attribute)

Set to true if you want Catalina to monitor classes in /WEB-INF/classes/
and /WEB-INF/lib for changes, and automatically reload the web
application if a change is detected.

  

autoDeploy attribute - everything to do with reloadable apps



I disagree:

autoDeploy (Host attribute)

This flag value indicates if new web applications, dropped in to the
appBase directory while Tomcat is running, should be automatically
deployed.
  
yes, the same attribute is used for re-deployment, which is the same as 
a reload.
a reload is a stop followed by a start, and is just a little less than 
undeploy/deploy

Although, my configuration has autoDeploy=false and unpackWARs=true,
and my WAR file dropped into appBase ends up being auto-deployed. Strange.

  

autoDeploy uses WarchedResource to find out how/when to reload an app



Huh? This sound entirely backward.
  
what's backwards about it, Its the host that managed webapp 
deployments/undeployments and reloads.
so not sure what you are confused about. It would be hard for an app to 
redeploy itself :)

Backwards or not, that's how its coded,

it's all there in the code, org/apache/catalina/startup/HostConfig.java

  

reloadable attribute is development use only, should never be used for
production



Hey! I agree with that!

  

Not to mention on a less powerful windows xp machine the first scenario
starts in seconds...
  


Dan, try to get a thread dump when your server is taking forever to
startup. Just do a CRTL-\ after a waiting a few seconds after running
startup.bat and check out what the VM is doing. Who knows... maybe it's
trying to download an XML DTD from another site over a crappy connection
or something.
  

yes, good point,

Filip

- -chris

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

iD8DBQFGz0WE9CaO5/Lv0PARAo+GAJ9JkB8Gw6xQgN1N4j5pgGaev2Q2KQCfX8mt
MhxZf5/TP9c8HYea4Uz4a+0=
=wq6C
-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: [OT] Session replication vs stateless

2007-08-24 Thread Filip Hanik - Dev Lists
I'd go the opposite direction, I will do stateless before attempting any 
kind of replication or distributed cache.
The scalability of a stateless application will outscale any replicated 
app any day, since your fail over options are so much more simplified.


Filip

Dwayne wrote:

Have you considered distributed caching for session replication?  I avoid
stateless like the plague.

There are several tools out there for this, but my favorite (because they
are open source) is Terracotta.  It clusters the JVMs.
Native clustering in Tomcat putters out, in my experience, after 3 nodes.
With Terracotta, I dropped in the code and now am clustering 5 nodes and
getting a lot higher TPS.
I think it is worth the hour it took me to implement it and I didn't have to
change my code at all, just write a short XML and drop some tags around what
I wanted to distribute.
Get it at terracotta.org.  The support docs do not say they support Tomcat 6
yet, but I have yet to hit any bugs (3 weeks in).


On 8/24/07, lightbulb432 [EMAIL PROTECTED] wrote:
  

Although the debate between session replication vs stateless can't be
definitively solved and depends on the application, I'd like to hear about
your experiences with both. How are you designing your current
applications,
and what implications has the choice that you might not have expected -
would you do anything differently if you could?

I ask because I'm still unsure about whether to decrease memory usage by
increasing database usage (or bandwidth usage if sending state back to the
client) by going stateless at the application tier.

Stateless

Are there any people using stateless application tiers with transactions
that are inherently stateful, such as wizard-type screens or other
business
processes or workflows? How'd that turn out?

Did you choose to move this state to the client (through cookies) or to
the
database?

Session replication

For session replication in Tomcat 6, what's the ideal replication group
size
in general? Would you ever want to set it to more than 2 instances?
(Because
for any more, then you'd have a lot more overhead in transferring state
back
and forth to even more other instances...)

With session replication between 2 machines, are you effectively reducing
the capacity of each server, at least in terms of memory, by 50%?
Hopefully
I'm looking at it the wrong way, because it not, I'm not really liking the
session replication idea if I'm decreasing hardware usage by half.

Thanks.
--
View this message in context:
http://www.nabble.com/-OT--Session-replication-vs-stateless-tf4325727.html#a12319704
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]





  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.484 / Virus Database: 269.12.4/969 - Release Date: 8/23/2007 4:04 PM
  



-
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 6 and log4j for a web application

2007-08-24 Thread Filip Hanik - Dev Lists

if you want to use log4j in your application only,
then forget everything you read on logging.html

all you need to do is log4j.jar in WEB-INF/lib
log4j.properties in WEB-INF/classes

the steps you are outlining, are converting tomcat from using 
java.util.logging to log4j for the container. and you don't need those 
steps if all you want is log4j for a webapp


Filip

fredk2 wrote:

Hi,

still reading :-)  http://tomcat.apache.org/tomcat-6.0-doc/logging.html

I have setup log4j as above, but with a little twist.
If you permission $CATALINA_HOME as read only and you want to customize the
log4j.properties then you need to install the log4j1.2.14.jar and
log4j.properties in $CATALINA_BASE/lib.
You also need to adjust the catalina.properties common.loader 


common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

The tomcat logging works well. However, I have 2 questions related to
installing log4j for a web application:

1.  why does the documentation say to add log4j1.2.x.jar to the WEB-INF/lib, 
isn't it already loaded by the common.loader at this point?


2.  is there a way to add a WEB-INF/classes/log4j.properties to log to
myapp1.log and capture all the logs related to the web application ?  Why
would'nt the following create a myapp1.log?

myapp1/WEB-INF/classes/log4j.properties -

log4j.debug=TRUE
log4j.rootLogger=DEBUG,myapp1

# test logger
log4j.logger.org.apache=DEBUG,myapp1

# Log rotation
log4j.appender.myapp1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.myapp1.File=${catalina.base}/logs/myapp1.log
log4j.appender.myapp1.DatePattern='.'-MM-dd
# Print the date in ISO 8601 format
log4j.appender.myapp1.layout=org.apache.log4j.PatternLayout
log4j.appender.myapp1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


Any hints - suggestions are appreciated,
Many Thanks - Fred
  



-
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: java.lang.NoClassDefFoundError

2007-08-24 Thread Filip Hanik - Dev Lists
better check your Jar to make sure it has the MyServletException.class 
file still in it.


Filip

Dave Sailer wrote:

I have a webapp that is working but I wanted to update a servlet jar so:

jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib

No I get the exception shown below. I have MyServlet stripped down so
the only imports are:
import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;


I can't see how replacing one servlet that has few dependencies is
causing an unrelated NoClassDefFoundError.




javax.servlet.ServletException:
net/whohah/portal/exceptions/MyServletException
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

root cause 


java.lang.NoClassDefFoundError:
net/whohah/portal/exceptions/MyServletException
java.lang.Class.getDeclaredConstructors0(Native Method)
java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
java.lang.Class.getConstructor0(Class.java:2671)
java.lang.Class.newInstance0(Class.java:321)
java.lang.Class.newInstance(Class.java:303)

org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)

org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


-
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: [OT] Session replication vs stateless

2007-08-24 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Lightbulb,

lightbulb432 wrote:
 How are you designing your current applications, and what
 implications has the choice that you might not have expected - would
 you do anything differently if you could?

(For the record, I am not using session replication.)

It all comes down to what is most important for your application.

If it is unacceptable to have users re-login if the server to which
their session is tied (session affinity: no replication), then session
replication is one of your only options.

If it's okay to have users re-login when they switch servers due to
failover, I'd highly recommend it since session replication is pretty
heavy in terms of network use. Why waste all that time passing session
information around?

 I ask because I'm still unsure about whether to decrease memory usage
 by increasing database usage (or bandwidth usage if sending state
 back to the client) by going stateless at the application tier.

You don't necessarily have to go stateless. Using a session is fins as
long as it's okay for users to re-login when they switch servers.

 Stateless
 
 Are there any people using stateless application tiers with
 transactions that are inherently stateful, such as wizard-type
 screens or other business processes or workflows? How'd that turn
 out?

I have some flows that are sort-of stateless (that is, I have lots of
hidden input elements on those pages). I use those for when I want the
wizard to be able to continue in the middle if the session times out
when a user is halfway through the flow. Yes, the user has to login
again, but they pick-up the flow where they left off.

 Did you choose to move this state to the client (through cookies) or
 to the database?

I don't like using the database for scratch work. First of all, it ties
up valuable database resources. Second, it pollutes your schema with
what amounts to temporary data. Lastly, you have to clean up after that
scratch data at some point so you don't fill up your database with
useless junk. I think it's easier to simply allow aborted transactions
(meaning multi-page flows) to die along with the session under which
they were running.

 With session replication between 2 machines, are you effectively
 reducing the capacity of each server, at least in terms of memory, by
 50%?

No. You're only reducing the amount of memory available for sessions
by half. You can help yourself out a lot by using objects with transient
fields so you don't transmit huge objects across the network and waste
memory on a server that might not get used. Instead, use lazy
instantiation to reconstitute those objects from the database (or
wherever) when they are needed. Only replicate what is absolutely
necessary to recover your state. (This only works well when you are also
using session affinity).

 Hopefully I'm looking at it the wrong way, because it not, I'm not
 really liking the session replication idea if I'm decreasing hardware
 usage by half.

I'd have to say that I would rarely recommend session replication just
because the memory, CPU, and network overhead doesn't outweigh the minor
(and hopefully rare) inconvenience of having to re-login when you switch
servers.

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

iD8DBQFGz0z39CaO5/Lv0PARAr9OAKCiB/sk56z7e4kBkPoqHL7QI8wv+ACeO9AA
rsWsRUE4t5JhIbB+dSyS9kg=
=Wypn
-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]



Re: Tomcat 6 and log4j for a web application

2007-08-24 Thread fredk2

I would like both one common/lib/log4j.properties for the main Tomcat
container logging and another log4j for each web apps - where you set its
log filename and rotation etc...

The tomcat logging would be of interest to an admin and the web app logs to
the developer.

Do I make sense?

Tx - Fred


Filip Hanik - Dev Lists wrote:
 
 if you want to use log4j in your application only,
 then forget everything you read on logging.html
 
 all you need to do is log4j.jar in WEB-INF/lib
 log4j.properties in WEB-INF/classes
 
 the steps you are outlining, are converting tomcat from using 
 java.util.logging to log4j for the container. and you don't need those 
 steps if all you want is log4j for a webapp
 
 Filip
 
 fredk2 wrote:
 Hi,

 still reading :-)  http://tomcat.apache.org/tomcat-6.0-doc/logging.html

 I have setup log4j as above, but with a little twist.
 If you permission $CATALINA_HOME as read only and you want to customize
 the
 log4j.properties then you need to install the log4j1.2.14.jar and
 log4j.properties in $CATALINA_BASE/lib.
 You also need to adjust the catalina.properties common.loader 

 common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

 The tomcat logging works well. However, I have 2 questions related to
 installing log4j for a web application:

 1.  why does the documentation say to add log4j1.2.x.jar to the
 WEB-INF/lib, 
 isn't it already loaded by the common.loader at this point?

 2.  is there a way to add a WEB-INF/classes/log4j.properties to log to
 myapp1.log and capture all the logs related to the web application ?  Why
 would'nt the following create a myapp1.log?

 myapp1/WEB-INF/classes/log4j.properties -

 log4j.debug=TRUE
 log4j.rootLogger=DEBUG,myapp1

 # test logger
 log4j.logger.org.apache=DEBUG,myapp1

 # Log rotation
 log4j.appender.myapp1=org.apache.log4j.DailyRollingFileAppender
 log4j.appender.myapp1.File=${catalina.base}/logs/myapp1.log
 log4j.appender.myapp1.DatePattern='.'-MM-dd
 # Print the date in ISO 8601 format
 log4j.appender.myapp1.layout=org.apache.log4j.PatternLayout
 log4j.appender.myapp1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


 Any hints - suggestions are appreciated,
 Many Thanks - Fred
   
 
 
 -
 To start a new topic, e-mail: users@tomcat.apache.org
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Tomcat-6-and-log4j-for-a-web-application-tf4325752.html#a12320351
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]



Re: Tomcat 6 and log4j for a web application

2007-08-24 Thread Filip Hanik - Dev Lists

for tomcat container logging, its easy

1. put log4j.jar in TC_HOME/lib
2. put log4j.properties in TC_HOME/lib
3. compile the extras
  ant -f extras.xml
4. replace TC_HOME/bin/tomcat-juli.jar with the one compiled from step 3
5. put extras//tomcat-juli-adapters.jar in TC_HOME/lib

and that's it, no need to mess with anything else

and for webapp logging, that was described earlier

Filip

fredk2 wrote:

I would like both one common/lib/log4j.properties for the main Tomcat
container logging and another log4j for each web apps - where you set its
log filename and rotation etc...

The tomcat logging would be of interest to an admin and the web app logs to
the developer.

Do I make sense?

Tx - Fred


Filip Hanik - Dev Lists wrote:
  

if you want to use log4j in your application only,
then forget everything you read on logging.html

all you need to do is log4j.jar in WEB-INF/lib
log4j.properties in WEB-INF/classes

the steps you are outlining, are converting tomcat from using 
java.util.logging to log4j for the container. and you don't need those 
steps if all you want is log4j for a webapp


Filip

fredk2 wrote:


Hi,

still reading :-)  http://tomcat.apache.org/tomcat-6.0-doc/logging.html

I have setup log4j as above, but with a little twist.
If you permission $CATALINA_HOME as read only and you want to customize
the
log4j.properties then you need to install the log4j1.2.14.jar and
log4j.properties in $CATALINA_BASE/lib.
You also need to adjust the catalina.properties common.loader 


common.loader=${catalina.base}/lib,${catalina.base}/lib/*.jar,${catalina.home}/lib,${catalina.home}/lib/*.jar

The tomcat logging works well. However, I have 2 questions related to
installing log4j for a web application:

1.  why does the documentation say to add log4j1.2.x.jar to the
WEB-INF/lib, 
isn't it already loaded by the common.loader at this point?


2.  is there a way to add a WEB-INF/classes/log4j.properties to log to
myapp1.log and capture all the logs related to the web application ?  Why
would'nt the following create a myapp1.log?

myapp1/WEB-INF/classes/log4j.properties -

log4j.debug=TRUE
log4j.rootLogger=DEBUG,myapp1

# test logger
log4j.logger.org.apache=DEBUG,myapp1

# Log rotation
log4j.appender.myapp1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.myapp1.File=${catalina.base}/logs/myapp1.log
log4j.appender.myapp1.DatePattern='.'-MM-dd
# Print the date in ISO 8601 format
log4j.appender.myapp1.layout=org.apache.log4j.PatternLayout
log4j.appender.myapp1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n


Any hints - suggestions are appreciated,
Many Thanks - Fred
  
  

-
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: java.lang.NoClassDefFoundError

2007-08-24 Thread Dave Sailer
it does. And if it didn't jar uf is broken, I would think.

On Fri, 2007-08-24 at 15:20 -0600, Filip Hanik - Dev Lists wrote:
 better check your Jar to make sure it has the MyServletException.class 
 file still in it.
 
 Filip
 
 Dave Sailer wrote:
  I have a webapp that is working but I wanted to update a servlet jar so:
 
  jar uf MyJar.jar net/whohah/portal/servlet/MyServlet.class
  cp MyJar.jar $CATALINA_HOME/webapps/ROOT/WEB-INF/lib
 
  No I get the exception shown below. I have MyServlet stripped down so
  the only imports are:
  import java.io.*;
 
  import javax.servlet.*;
  import javax.servlet.http.*;
 
 
  I can't see how replacing one servlet that has few dependencies is
  causing an unrelated NoClassDefFoundError.
 
 
 
 
  javax.servlet.ServletException:
  net/whohah/portal/exceptions/MyServletException
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:273)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
  root cause 
 
  java.lang.NoClassDefFoundError:
  net/whohah/portal/exceptions/MyServletException
  java.lang.Class.getDeclaredConstructors0(Native Method)
  java.lang.Class.privateGetDeclaredConstructors(Class.java:2357)
  java.lang.Class.getConstructor0(Class.java:2671)
  java.lang.Class.newInstance0(Class.java:321)
  java.lang.Class.newInstance(Class.java:303)
  
  org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:142)
  
  org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
  org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:315)
  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
  javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
 
 
  -
  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: Apache authentication information (remoteuser) not visible in Tomcat

2007-08-24 Thread Omar Nafees

Hi Robert,

Thanks for the response.

So I've come to believe that its possible to avoid using Tomcat 
authentication altogether, i.e., without specifying realms and using 
tomcat user/roles in an application's web.xml. Given my context (a 
University environment with over several hundreds of students hitting an 
apache web server and a small subset needing tomcat), I need to 
completely separate authentication from the Tomcat server. I guess this 
approach of using JNDI or even JAAS is a last resort... but I would 
really like to see what everyone else seems to have already accomplished 
- the REMOTE_USER variable being read from the first AJP header that is 
sent to tomcat.



Thanks,

Omar


Robert Segal wrote:

Omar I actually had this exact same problem early today although I'm
sure my environment is slightly different from your perhaps I can offer
some help.  


In my case I have LDAP authentication configured for my servlet.  I
believe this step should be the same regardless of the authentication
scheme you are using
  
First I edit CATALINA_HOME/webapps/myServelet/WEB-INF/web.xml to define

roles and constraints for what pages can be accessed...

login-config
auth-methodBASIC/auth-method
  /login-config

  security-role
role-nameGRP-myGroup /role-name
  /security-role

  security-constraint
web-resource-collection
  web-resource-namemy Authentication/web-resource-name
  url-pattern/*/url-pattern
/web-resource-collection

auth-constraint
  role-nameGRP-myGroup/role-name
/auth-constraint
  /security-constraint


The other file I change sets up all the LDAP machine details.  I've
placed it in Context.xml because there are several servlets that make
use of this authentication...

$CATALINA_HOME/conf/Context.xml

Context
Realm className   =org.apache.catalina.realm.JNDIRealm
 debug =99
 connectionURL =ldap://ldapMachine:3268;
 connectionName=CRYPTOLOGIC\myUser
	 connectionPassword=myPassword		  
	  	

userBase  =dc=myDomain,dc=com
 userSearch=(sAMAccountName={0})
 userSubtree   =true
 userRoleName  =memberOf
		 
		 roleBase   =OU=Groups,DC=myDomain,DC=com

 roleSubtree=false
 roleName   =cn
 roleSearch =(member={0})/
/Context

This has worked for me.  Hope it is of some use to you.  We also have
Apache over top of Tomcat in our environment and found it necessary to
configure authentication both in Apache and in Tomcat to get things to
work properly.

Robert Segal
Tools Developer
CryptoLogic Inc.
55 St. Clair Ave W., 3rd Floor
Toronto, Ontario
Canada  M4V 2Y7
tel.  + 1.416.545.1455 x5896
fax. + 1.416.545.1454

This message, including any attachments, is confidential and/or
privileged and contains information intended only for the person(s)
named above. Any other distribution, copying or disclosure is strictly
prohibited. If you are not the intended recipient or have received this
message in error, please notify us immediately by reply email and
permanently delete the original transmission from all of your systems
and hard drives, including any attachments, without making a copy.

-Original Message-
From: Omar Nafees [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 2:30 PM

To: Tomcat Users List
Subject: Re: Apache authentication information (remoteuser) not visible
in Tomcat

Thanks for the response Christopher... although I had very early on, 
already tried what is suggested in the link you have referred to, i.e., 
setting tomcatAuthentication=false in the appropriate server.xml line 
(see the config listing I produced earlier in the thread).


Oh I hope its not some obscure bug in mod_jk!! :)

Thanks,
Omar



Christopher Schultz wrote:
  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Omar,

Omar Nafees wrote:
  


request.getRemoteUser() returns null in my servlet.
request.getAttribute(REMOTE_USER) also returns null. I have even
checked the headers that are being sent to the AJP connector in
  

Tomcat.
  

  

This is a FAQ. The answer is easily findable in the archives:

http://www.nabble.com/forum/ViewPost.jtp?post=3132974framed=y

- -chris

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

iD8DBQFGzxDY9CaO5/Lv0PARAi0fAKC+7Rb+k5E3fEPFGhhiXvXumpz9QwCgwgss
OPTfCFM5pLAQ0jH0i+BCkis=
=+c/H
-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]
  




__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 

Re: Apache authentication information (remoteuser) not visible in Tomcat

2007-08-24 Thread Omar Nafees

Hi Robert,

Thanks for the response.

So I've come to believe that its possible to avoid using Tomcat 
authentication altogether, i.e., without specifying realms and using 
tomcat user/roles in an application's web.xml. Given my context (a 
University environment with over several hundreds of students hitting an 
apache web server and a small subset needing tomcat), I need to 
completely separate authentication from the Tomcat server. I guess this 
approach of using JNDI or even JAAS is a last resort... but I would 
really like to see what everyone else seems to have already accomplished 
- the REMOTE_USER variable being read from the first AJP header that is 
sent to tomcat.



Thanks,

Omar


Robert Segal wrote:

Omar I actually had this exact same problem early today although I'm
sure my environment is slightly different from your perhaps I can offer
some help.  


In my case I have LDAP authentication configured for my servlet.  I
believe this step should be the same regardless of the authentication
scheme you are using
  
First I edit CATALINA_HOME/webapps/myServelet/WEB-INF/web.xml to define

roles and constraints for what pages can be accessed...

login-config
auth-methodBASIC/auth-method
  /login-config

  security-role
role-nameGRP-myGroup /role-name
  /security-role

  security-constraint
web-resource-collection
  web-resource-namemy Authentication/web-resource-name
  url-pattern/*/url-pattern
/web-resource-collection

auth-constraint
  role-nameGRP-myGroup/role-name
/auth-constraint
  /security-constraint


The other file I change sets up all the LDAP machine details.  I've
placed it in Context.xml because there are several servlets that make
use of this authentication...

$CATALINA_HOME/conf/Context.xml

Context
Realm className   =org.apache.catalina.realm.JNDIRealm
 debug =99
 connectionURL =ldap://ldapMachine:3268;
 connectionName=CRYPTOLOGIC\myUser
	 connectionPassword=myPassword		  
	  	

userBase  =dc=myDomain,dc=com
 userSearch=(sAMAccountName={0})
 userSubtree   =true
 userRoleName  =memberOf
		 
		 roleBase   =OU=Groups,DC=myDomain,DC=com

 roleSubtree=false
 roleName   =cn
 roleSearch =(member={0})/
/Context

This has worked for me.  Hope it is of some use to you.  We also have
Apache over top of Tomcat in our environment and found it necessary to
configure authentication both in Apache and in Tomcat to get things to
work properly.

Robert Segal
Tools Developer
CryptoLogic Inc.
55 St. Clair Ave W., 3rd Floor
Toronto, Ontario
Canada  M4V 2Y7
tel.  + 1.416.545.1455 x5896
fax. + 1.416.545.1454

This message, including any attachments, is confidential and/or
privileged and contains information intended only for the person(s)
named above. Any other distribution, copying or disclosure is strictly
prohibited. If you are not the intended recipient or have received this
message in error, please notify us immediately by reply email and
permanently delete the original transmission from all of your systems
and hard drives, including any attachments, without making a copy.

-Original Message-
From: Omar Nafees [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 24, 2007 2:30 PM

To: Tomcat Users List
Subject: Re: Apache authentication information (remoteuser) not visible
in Tomcat

Thanks for the response Christopher... although I had very early on, 
already tried what is suggested in the link you have referred to, i.e., 
setting tomcatAuthentication=false in the appropriate server.xml line 
(see the config listing I produced earlier in the thread).


Oh I hope its not some obscure bug in mod_jk!! :)

Thanks,
Omar



Christopher Schultz wrote:
  

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Omar,

Omar Nafees wrote:
  


request.getRemoteUser() returns null in my servlet.
request.getAttribute(REMOTE_USER) also returns null. I have even
checked the headers that are being sent to the AJP connector in
  

Tomcat.
  

  

This is a FAQ. The answer is easily findable in the archives:

http://www.nabble.com/forum/ViewPost.jtp?post=3132974framed=y

- -chris

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

iD8DBQFGzxDY9CaO5/Lv0PARAi0fAKC+7Rb+k5E3fEPFGhhiXvXumpz9QwCgwgss
OPTfCFM5pLAQ0jH0i+BCkis=
=+c/H
-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]
  




__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email