Tomcat architecture

2008-02-25 Thread Stefano Tranquillini
Hi everybody.
Someone has the architecture of Tomcat and a brief explanation of this?
For architecture t think at some like this:
http://www.javaportal.it/images/tesi/bonzagni2/Bonzagnic_html_m14d04b4d.png
thanks

-- 
Stefano


Security and Performance Configuration

2008-02-25 Thread Pedro Stavrinides
Hi all,

I know this topic, or at least bits and pieces of it, has been covered in
various posts, but just for clarification in my mind I would like the
opinions of experienced Tomcat and Unix/Linux experts about optimizing
performance and security configuration for Tomcat.

As a starting point our configuration is currently this:
- Debian based Linux
- JSVC with Tomcat 6 running Tomcat under a less privileged account
- Apache 2.x front to Tomcat, Tomcat remains on the secure port 8080
- mod_proxy with mod_rewrite for legacy integration and reverse proxy

We use the reverse proxy to integrate our name space, it also enables us to
perform cross site authentication via HTTP headers... please feel free to
comment here, but I see this configuration as not being optimal, Our Java
web applications are performing more and more asynchronous requests so
sooner or later we will have to look at running comet services. From what I
have read in other posts Running Apache in front would be a liability in
this case.

From a security standpoint I don't see it as ideal either... two web servers
make for two targets, but nevertheless many people believe that Tomcat is
more secure behind Apache (I don't share this opinion), please share your
thoughts.

Thanks,
Peter


Why is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
Hi!
Why is session unbound called after cluster failover?
Two more questions:
-- In a scenario with two nodes, if I shutdown one, the other is instantly
ready to receive and respond to requests, or it is necessary to wait a
while?
In a procuction scenario we cannot wait, because requests are frequently.
-- Is there any recommended configuration (basically If one tomcat crashes I
want that the other responds immediatly to the requests)?
Thanks a lot
A

-
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: java memory question -Xmx2048m

2008-02-25 Thread David Delbecq

En l'instant précis du 25/02/08 13:51, Dave s'exprimait en ces termes:

Our Linux(FC) machine has 8G physical memory and 12G swap size.  I am using JDK 
1.5.   I tried to set the Java option -Xmx to set max heap size for best 
performance,   the allowed max heap size is 2048M .  Does that mean that the 
JVM can not use all the physical memory (8G) ?  Thanks.
  Dave

   
-

Never miss a thing.   Make Yahoo your homepage.
  
The maximum memory the JVM can use depends on the maximum size of 
continuous memory segment the OS you run on allows you to reserve.
On 32 bits linux, it's about 2G (that is 4G minus memory area reserved 
for kernel, minus memory area used by libraries minus other thingies jvm 
might use). To get more you will need a 64bits JVM + a 64 bits OS. Note 
it's a limitation of hardware architecture and OS more than a limitation 
of JVM.


PS: if you plan to swap-out 12G of datas, i hope your disks are fast :)


--
http://www.devlog.be (a belgian developer's logs)



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



multiple webapps on single tomcat?

2008-02-25 Thread Abid Hussain

Hi everybody,

I am planning to set up a couple (2-5) of webapps. I've encountered some 
problems in the past when running multiple webapps on a single tomcat, 
cause they somehow interfered with each other (frankly, I never 
unterstood why).


My question is:
Is there a best practice for running several webapps on a single 
tomcat instance in terms of not interfering with each other? Or is it 
principally better to run every webapp in it's own tomcat instance?


Would be thankful for any advices.

Regards,

Abid

--

Abid Hussain
Mail: [EMAIL PROTECTED]
Web: http://www.abid76.de

-
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: java memory question -Xmx2048m

2008-02-25 Thread Roland Brassous (SILOGIC)

Hi everyOne

From adobe Faq
On 32-bit processor machines, the largest contiguous memory address 
space the operating system can allocate to a process is 1.8GB. Because 
of this, the maximum heap size can only be set up to 1.8GB. On 64-bit 
processor machines, the 1.8 GB limit does not apply, as 64-bit processor 
machines have a larger memory address space.


regards
Roland



Dave a écrit :

Our Linux(FC) machine has 8G physical memory and 12G swap size.  I am using JDK 
1.5.   I tried to set the Java option -Xmx to set max heap size for best 
performance,   the allowed max heap size is 2048M .  Does that mean that the 
JVM can not use all the physical memory (8G) ?  Thanks.
  Dave

   
-

Never miss a thing.   Make Yahoo your homepage.
  



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



configuration of deployer in cluster

2008-02-25 Thread Taner Diler

Hi all,

I want to deploy war file in vertical cluster.  I'm confused a little 
bit with configuration.

I have three clustered tomcats -labeled as  (A,B,C)- in same machine.

I have put the

   Deployer
className=org.apache.catalina.cluster.deploy.FarmWarDeployer
   
watchDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/watch
   
deployDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/deploy
   
tempDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/temp

   watchEnabled=true/


configuration to only one (A) member in the cluster. This member  (A) 
can realize any change in the watchdir and copy the war file to

deployDir.
...
Feb 25, 2008 10:15:37 AM org.apache.catalina.cluster.deploy.WarWatcher check
INFO: check cluster wars at 
/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/watch
Feb 25, 2008 10:15:37 AM 
org.apache.catalina.cluster.deploy.FarmWarDeployer fileModified
INFO: Installing webapp[/clustering_test-0.0.1] from 
/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/deploy/clustering_test-0.0.1.war
Feb 25, 2008 10:15:37 AM 
org.apache.catalina.cluster.deploy.FarmWarDeployer remove

INFO: Cluster wide remove of web app /clustering_test-0.0.1
...

But when I list deployed web application in manager module (A member), I 
can't see the webapp[/clustering_test-0.0.1].


What should I do to see web application as deployed in all members?

1. Should I copy Deployer .../ definition to all member in the cluster 
and define separate deployDir for each member?
2. Should I define context file -includes docbase that point to war file 
in deployDir -  in tomcat5.5/conf/Catalina/localhost ?

3. Should I define context.xml file in META-INF in war file?

Thank You

Taner Diler

-
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: java memory question -Xmx2048m

2008-02-25 Thread Mikolaj Rydzewski

Dave wrote:

Our Linux(FC) machine has 8G physical memory and 12G swap size.

Happy swapping ;-)

--
Mikolaj Rydzewski [EMAIL PROTECTED]



smime.p7s
Description: S/MIME Cryptographic Signature


Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias,

MK wrote:
| Christopher Schultz chris at christopherschultz.net writes:
|
| How did you set the [Java] property?
|
| I am running my web app inside an Eclipse WTP server container
project. So I set
| the property as a JVM argument in the Server project's Run dialog. I
set it
| like this:
|
| -Djava.protocol.handler.pkgs=my.protocol
|
| ...given that the Handler class is in package my.protocol.notes.
|
| am I missing something here?

That should be alright. You can always verify by checking the value
itself during runtime (say, during the startup of your webapp). I would
recommend doing this just to make sure.

| Actually I don't even call URL.openConnection, because I don't need it
at all.
| It's really just that the java.net.URL constructor requires that there
exists an
| object which implements this behavior just in case someone should try
to open a
| connection.

Ah, I see.

| My situation really is just that there is an API some methods of which
take URL
| objects instead of plain URL strings in order to link to documents
from a web
| page (intranet pages). Since notes:// links will open in the Lotus
Notes client,
| which everyone uses in this company, it should be fine to pass
notes:// links if
| they are wellformed. There are no calls to openConnection.

Well, that's good -- at least you don't have to implement your own
protocol or anything like that.

| Throwing a MalformedUrl in the constructor if no connection handler is
found for
| the given protocol is simply a bad design decision IMHO (besides, what
does
| connection handling have to do with well-formed URLs). These things
should really
| be postponed to the time where someone actually tries to open a
connection from
| that URL.

I completely agree with you.

| But since I can neither change that API I use nor the JVM
| implementation, I have to find another way to work around that problem :-)

Where are you putting the implementation of the protocol handler? From
the bug you mentioned in your original post, it looks like putting it
into your webapp just isn't going to work. Instead, you'll have to
install it into a ClassLoader that is higher-up in the chain. According
to the bug comments, your implementation must be in the system classpath
(that is, not loaded through any of the ClassLoaders that Tomcat creates).

Which version of TC are you running?

In TC 6, you should be able to use tomcat/lib.

For TC 5.5, try tomcat/common/lib and then tomcat/common/endorsed.
As a last resort, you could put your JAR file into the JRE's endorsed
directory. Make sure you only have this library living in one place at a
time, or other weird things might start happening.

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

iEYEARECAAYFAkfC0NAACgkQ9CaO5/Lv0PD6QwCgpdOO7S49z6e/Ab4Bn10zJ2Bh
HhEAmwb98Eyku/JXyhb0OTZkVOWWh8UB
=Uygl
-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: Why is session unbound called after cluster failover?

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| Why is session unbound called after cluster failover?

What value is being unbound?

| Two more questions: -- In a scenario with two nodes, if I shutdown
| one, the other is instantly ready to receive and respond to requests,
| or it is necessary to wait a while?

It depends on how you set up your cluster. If you have distributed
sessions, then any other node can pick up right where the other left
off. If not, the user might have to log-in again in order for you to get
the session set up properly.

| In a production scenario we cannot wait, because requests are
| frequently. -- Is there any recommended configuration (basically If
| one tomcat crashes I want that the other responds immediately to the
| requests)?

If you want complete, immediate failover, you need to use distributed
sessions, have all nodes participate in the cluster, and have a way to
route traffic to the TC instances (using a lb appliance, httpd + mod_jk,
or some other mechanism).

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

iEYEARECAAYFAkfC0hoACgkQ9CaO5/Lv0PBKgwCgmkYSZdZkYkH6hDVYbEjIUB1T
ANoAoIhmSgIOZrZeWzVmsNKoJgFCESwt
=QcE1
-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: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias,

Christopher Schultz wrote:
| From the bug you mentioned in your original post, it looks like
| putting it into your webapp just isn't going to work. Instead, you'll
| have to install it into a ClassLoader that is higher-up in the chain.
| According to the bug comments, your implementation must be in the
| system classpath (that is, not loaded through any of the ClassLoaders
| that Tomcat creates).

Hmm... I just re-read this comment in the bug:

| The given workaround will not work in a servlet container such as
| tomcat which already sets the URLStreamHandlerFactory on
| java.net.URL. This handler can only be registered once in the VM
| (which is pretty silly btw.).

If this is true, then you're going to have to hack the Tomcat source to
get this to work. Maybe Tomcat's stream handler can be written to re-use
the system protocol handler if it doesn't find a handler it likes for
your URL.

Also, this /was/ 2002-03, so perhaps things in Tomcat have changed since
then. Try the system classpath (or endorsed directory) and we'll see
what happens.

- -chris

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

iEYEARECAAYFAkfC058ACgkQ9CaO5/Lv0PD1dACeIwDCIIAcKeOyjNcbQZEk4W8S
3BsAn1H/BSlsevOAmZTP8Yq+StdjS9+U
=jAcY
-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: Custom URL handlers in Tomcat web app

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Matthias,

MK wrote:
| Actually I don't even call URL.openConnection, because I don't need it
at all.
| It's really just that the java.net.URL constructor requires that there
exists an
| object which implements this behavior just in case someone should try
to open a
| connection.

As I'm reading more in the API, I can see that the URL class has a
constructor that takes a URLStreamHandler. Could you utilize this
constructor instead?

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

iEYEARECAAYFAkfC1N0ACgkQ9CaO5/Lv0PBs0QCeMZPNLumZzRLHn58GTv2aecA0
ulsAni4z1/0Z4EyFHlo3BxGzNWfK7cHu
=c2QK
-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: Is there a Connection Pool/Data Source Monitor Tool

2008-02-25 Thread Dan Armbrust
To answer my own question, it looks like jfreechart.

http://sourceforge.net/projects/jfreechart


On Mon, Feb 25, 2008 at 8:50 AM, Dan Armbrust
[EMAIL PROTECTED] wrote:
 Does anyone happen to know what package Lamda Probe uses to create its
  graphs?  They look really nice.

  I would search their forum, but their search feature throwing out of
  memory errors.  You would think they could use Lamda Probe to monitor
  for that or something :)

  Thanks,

  Dan


-
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: multiple webapps on single tomcat?

2008-02-25 Thread Hassan Schroeder
On Mon, Feb 25, 2008 at 5:46 AM, Abid Hussain [EMAIL PROTECTED] wrote:

  My question is:
  Is there a best practice for running several webapps on a single
  tomcat instance ...

Tomcat is made for this. Install your webapps per the documentation
(and Servlet Spec) and they won't interfere with each other.

-- 
Hassan Schroeder  [EMAIL PROTECTED]

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



Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

A couple of issues:

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


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


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


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


Thanks,

--adam

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



Re: multiple webapps on single tomcat?

2008-02-25 Thread Roland Brassous (SILOGIC)

Hi,

in order to start Bests practises, i think about these rules...

Libraries
- Be care of [Tomcat directory]\shared\classes or [Tomcat 
directory]\shared\lib contents
- Be care of [Tomcat directory]\common\classes, [Tomcat 
directory]\common\classes\endorsed and [Tomcat 
directory]\common\classes\lib contents

I think about conflict

Context definition
- Each context are defined in a separate configuration file ( [Tomcat 
directory]\conf\Catalina\localhost\


perhaps is a good start...




Hassan Schroeder a écrit :

On Mon, Feb 25, 2008 at 5:46 AM, Abid Hussain [EMAIL PROTECTED] wrote:

  

 My question is:
 Is there a best practice for running several webapps on a single
 tomcat instance ...



Tomcat is made for this. Install your webapps per the documentation
(and Servlet Spec) and they won't interfere with each other.

  



-
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 is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
Hi!

Well, our class USER implements HttpSessionBindingListener,
Serializable and when failover happens valueUnbound is executed(public
void valueUnbound(HttpSessionBindingEvent event)) - valueUnbound is a
method of class USER.

Could you help.
Thanks

On 2/25/08, Christopher Schultz [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Andrew,

 Andrew Hole wrote:
 | Why is session unbound called after cluster failover?

 What value is being unbound?

 | Two more questions: -- In a scenario with two nodes, if I shutdown
 | one, the other is instantly ready to receive and respond to requests,
 | or it is necessary to wait a while?

 It depends on how you set up your cluster. If you have distributed
 sessions, then any other node can pick up right where the other left
 off. If not, the user might have to log-in again in order for you to get
 the session set up properly.

 | In a production scenario we cannot wait, because requests are
 | frequently. -- Is there any recommended configuration (basically If
 | one tomcat crashes I want that the other responds immediately to the
 | requests)?

 If you want complete, immediate failover, you need to use distributed
 sessions, have all nodes participate in the cluster, and have a way to
 route traffic to the TC instances (using a lb appliance, httpd + mod_jk,
 or some other mechanism).

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

 iEYEARECAAYFAkfC0hoACgkQ9CaO5/Lv0PBKgwCgmkYSZdZkYkH6hDVYbEjIUB1T
 ANoAoIhmSgIOZrZeWzVmsNKoJgFCESwt
 =QcE1
 -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]



help decipher log entry

2008-02-25 Thread Paul Simon
Hi,

I have a tomcat server running a lone java application on vms. The problem is 
that it shuts down occasionally for seemingly no reason. Could somebody help 
shed some light on the following log snippet - it's the entry right before the 
shutdown happens. I'm really a novice when it comes to java web programming and 
I'm trying to wrap my head around all this. Thanks for any help, Paul

snip
StandardServer.await: accept: java.io.InterruptedIOException: Accept timed out
java.io.InterruptedIOException: Accept timed out
at java.net.PlainSocketImpl.socketAccept(Native Method)
at java.net.PlainSocketImpl.accept(PlainSocketImpl.java, Compiled Code)
at java.net.ServerSocket.implAccept(ServerSocket.java, Compiled Code)
at java.net.ServerSocket.accept(ServerSocket.java, Compiled Code)
at org.apache.catalina.core.StandardServer.await(StandardServer.java, 
Compiled Code)
at org.apache.catalina.startup.Catalina.start(Catalina.java, Compiled 
Code)
at org.apache.catalina.startup.Catalina.execute(Catalina.java, Compiled 
Code)
at org.apache.catalina.startup.Catalina.process(Catalina.java, Compiled 
Code)
at java.lang.reflect.Method.invoke(Native Method)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java, Compiled 
Code)
Tomcat Logicals and Classpaths are cleared
  APACHE$WWW   job terminated at 11-FEB-2008 15:55:48.63
 
  Accounting information:
  Buffered I/O count:   39413360  Peak working set size:  62048
  Direct I/O count:  1516596  Peak virtual size: 370784
  Page faults: 13182  Mounted volumes:0
  Charged CPU time:0 02:33:42.39  Elapsed time:  23 03:33:32.56
SY
/snip



-
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 is session unbound called after cluster failover?

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| Well, our class USER implements HttpSessionBindingListener,
| Serializable and when failover happens valueUnbound is executed(public
| void valueUnbound(HttpSessionBindingEvent event)) - valueUnbound is a
| method of class USER.

Is this happening on the new server or the old server?

Maybe your application is replacing the USER in the session with another
copy or something like that.

You can always generate a stack trace to find out where the call is
coming from:

System.err.println(User saw valueUnbound event!);
new Throwable().printStackTrace();

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

iEYEARECAAYFAkfC6VsACgkQ9CaO5/Lv0PDwjgCghiPQXcAA9AGGSKkeJ5WuzoRQ
HYkAn1SjgLifqMpxKyZmZ1+GWp74PTTY
=hNUj
-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: java memory question -Xmx2048m

2008-02-25 Thread Dave
I installed Linux FC6 64-bit on the machine DELL 2590(I think it is INTEL type 
CPU). But JVM 64-bit is only available for AMD and SPARC.  Is the SUN not 
support INTEL?
   
  Thanks, Dave

David Delbecq [EMAIL PROTECTED] wrote:
  En l'instant précis du 25/02/08 13:51, Dave s'exprimait en ces termes:
 Our Linux(FC) machine has 8G physical memory and 12G swap size. I am using 
 JDK 1.5. I tried to set the Java option -Xmx to set max heap size for best 
 performance, the allowed max heap size is 2048M . Does that mean that the JVM 
 can not use all the physical memory (8G) ? Thanks.
 Dave

 
 -
 Never miss a thing. Make Yahoo your homepage.
 
The maximum memory the JVM can use depends on the maximum size of 
continuous memory segment the OS you run on allows you to reserve.
On 32 bits linux, it's about 2G (that is 4G minus memory area reserved 
for kernel, minus memory area used by libraries minus other thingies jvm 
might use). To get more you will need a 64bits JVM + a 64 bits OS. Note 
it's a limitation of hardware architecture and OS more than a limitation 
of JVM.

PS: if you plan to swap-out 12G of datas, i hope your disks are fast :)


-- 
http://www.devlog.be (a belgian developer's logs)



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



   
-
Never miss a thing.   Make Yahoo your homepage.

how to package common lib and ear file

2008-02-25 Thread Dave
I have an ear application with entity,business and web modules.
  application ...
  module
  ejbfoo.par/ejb
/module
  module
  ejbbar.ejb3/ejb
/module
  module
web
web-uribaz.war/web-uri
context-root//context-root
/web
/module
  /application

  The .par, .ejb3 and war files use classes in common.jar.  I put the 
common.jar under JBOSS/server/default/lib.
   
  In the common.jar,  
   
  String className = System.getProperty(FooClassName);
Class.forName(className).newInstance();
   
  trying to instantiate the class package.Foo that is defined in web module 
inside the ear file,  throws a exception:
   
   java.lang.ClassNotFoundException: No ClassLoaders found for: package.Foo
   
  the class package.Foo is application specific and  can not be put into 
common.jar that is a common library. However the common lib needs to 
instantiate the application specific class.
   
  How to solve this issue?   is classloader the answer? 
  
Thanks for any help.
Dave


   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Session expiration and AJAX issues

2008-02-25 Thread Paul Simon
Hi,

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

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

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

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

 it puts the onus on the browser to inform the server that the 
 user's session needs to be expired.

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

-
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: configuration of deployer in cluster

2008-02-25 Thread Filip Hanik - Dev Lists

you do need to define the deployer on each instance,
however in 5.5 there was an unfortunate change, and I believe that 
deployDir has to point to your webapps directory


Filip

Taner Diler wrote:

Hi all,

I want to deploy war file in vertical cluster.  I'm confused a little 
bit with configuration.

I have three clustered tomcats -labeled as  (A,B,C)- in same machine.

I have put the

   Deployer
className=org.apache.catalina.cluster.deploy.FarmWarDeployer
   
watchDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/watch
   
deployDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/deploy
   
tempDir=/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/temp

   watchEnabled=true/


configuration to only one (A) member in the cluster. This member  (A) 
can realize any change in the watchdir and copy the war file to

deployDir.
...
Feb 25, 2008 10:15:37 AM org.apache.catalina.cluster.deploy.WarWatcher 
check
INFO: check cluster wars at 
/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/watch
Feb 25, 2008 10:15:37 AM 
org.apache.catalina.cluster.deploy.FarmWarDeployer fileModified
INFO: Installing webapp[/clustering_test-0.0.1] from 
/home/tdiler/Documents/Tomcat_Clustring_Calisma/deploy/deploy/clustering_test-0.0.1.war 

Feb 25, 2008 10:15:37 AM 
org.apache.catalina.cluster.deploy.FarmWarDeployer remove

INFO: Cluster wide remove of web app /clustering_test-0.0.1
...

But when I list deployed web application in manager module (A member), 
I can't see the webapp[/clustering_test-0.0.1].


What should I do to see web application as deployed in all members?

1. Should I copy Deployer .../ definition to all member in the 
cluster and define separate deployDir for each member?
2. Should I define context file -includes docbase that point to war 
file in deployDir -  in tomcat5.5/conf/Catalina/localhost ?

3. Should I define context.xml file in META-INF in war file?

Thank You

Taner Diler

-
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: Incorrect cookie value in tomcat5.5.26

2008-02-25 Thread Sushil Vegad
Hello,

cookie.setVersion(1) remembers the cookie only for the browser session. A
new browser does not have access to the cookie

We did cookie.setMaxAge(Integer.MAX_VALUE) but that doesn't help.

Any thoughts please?

Thanks,
Sushil Vegad
Technical Lead, Scheduling Project
Serebrum Corporation - translating strategy into results
Work: 609.777.3563
Cell: 732.216.4908  
Email: [EMAIL PROTECTED]
Conference Dial-in: 1-218-486-1300, Bridge: 427526
 

-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 11, 2008 11:54 AM
To: Tomcat Users List
Subject: Re: Incorrect cookie value in tomcat5.5.26

not broken, corrected. the java doc says


  setValue

public void *setValue*(String
http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html newValue)

Assigns a new value to a cookie after the cookie is created. If you
use a binary value, you may want to use BASE64 encoding.

With Version 0 cookies, values should not contain white space,
brackets, parentheses, equals signs, commas, double quotes, slashes,
question marks, at signs, colons, and semicolons. Empty values may
not behave the same way on all browsers.

*Parameters:*
|newValue| - a |String| specifying the new value


to fix this, all you need to do is

cookie.setVersion(1);

Filip

Konstantin Kolinko wrote:
 I guess the cause is the same as for tomcat 6.0.16.
 See messages entitles Cookies are broken in 6.0.16?.

 http://www.nabble.com/Cookies-are-broken-in-6.0.16--to15369118.html

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



   


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





-
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: multiple webapps on single tomcat?

2008-02-25 Thread Abid Hussain
Thanks for help. So am I right saying that no conflicts between webapps 
can occur when

1. using tomcat 5.x...
- all wepapps only use their WEB-INF/lib as directory for libraries and
- none of the webapps uses libraries from $CATALINA_HOME/common/lib 
resp. $CATALINA_HOME/shared/lib

2. using tomcat 6...
- none of the webapps uses libraries from $CATALINA_HOME/lib?

Both points are meant except the usage of standard libraries like 
servlet-api, jsp-api etc., which are naturally needed by all webapps.


Regards,

Abid

Roland Brassous (SILOGIC) schrieb:

Hi,

in order to start Bests practises, i think about these rules...

Libraries
- Be care of [Tomcat directory]\shared\classes or [Tomcat 
directory]\shared\lib contents
- Be care of [Tomcat directory]\common\classes, [Tomcat 
directory]\common\classes\endorsed and [Tomcat 
directory]\common\classes\lib contents

I think about conflict

Context definition
- Each context are defined in a separate configuration file ( [Tomcat 
directory]\conf\Catalina\localhost\


perhaps is a good start...




Hassan Schroeder a écrit :
On Mon, Feb 25, 2008 at 5:46 AM, Abid Hussain [EMAIL PROTECTED] 
wrote:


 

 My question is:
 Is there a best practice for running several webapps on a single
 tomcat instance ...



Tomcat is made for this. Install your webapps per the documentation
(and Servlet Spec) and they won't interfere with each other.

  



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




--

Abid Hussain
Mail: [EMAIL PROTECTED]
Web: http://www.abid76.de

-
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: java memory question -Xmx2048m

2008-02-25 Thread Alan Chaney
For some reason Linux always calls 64 bit OSes 'AMD' - in fact, the sun 
64 bit AMD version works fine on modern 64 bit Intel CPUs. The confusion 
comes because there was an older 64 bit design from Intel called the 
'Itanium' which was intended for servers and had a completely different 
instruction set. The Xeon family and the E64 family are all compatible 
with the 'AMD' 64 bit JVM



You say DELL 2590 - do you mean DELL 2950? The 2950 is takes Intel Xeon 
processors which will work with the so-called 'AMD' JVM.


Hope that helps

Regards

Alan Chaney


Dave wrote:

I installed Linux FC6 64-bit on the machine DELL 2590(I think it is INTEL type 
CPU). But JVM 64-bit is only available for AMD and SPARC.  Is the SUN not 
support INTEL?
   
  Thanks, Dave


David Delbecq [EMAIL PROTECTED] wrote:
  En l'instant précis du 25/02/08 13:51, Dave s'exprimait en ces termes:

Our Linux(FC) machine has 8G physical memory and 12G swap size. I am using JDK 
1.5. I tried to set the Java option -Xmx to set max heap size for best 
performance, the allowed max heap size is 2048M . Does that mean that the JVM 
can not use all the physical memory (8G) ? Thanks.
Dave


-
Never miss a thing. Make Yahoo your homepage.

The maximum memory the JVM can use depends on the maximum size of 
continuous memory segment the OS you run on allows you to reserve.
On 32 bits linux, it's about 2G (that is 4G minus memory area reserved 
for kernel, minus memory area used by libraries minus other thingies jvm 
might use). To get more you will need a 64bits JVM + a 64 bits OS. Note 
it's a limitation of hardware architecture and OS more than a limitation 
of JVM.


PS: if you plan to swap-out 12G of datas, i hope your disks are fast :)




-
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 is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
It happens on both. Valueunbound is executed on old server when tomcat
is stopped, and is executed on new server when I execute logout (or if
I shutdown tomcat). We only want that new server executes
valueunbound.

Could you help?

Thanks a lot
A

On 2/25/08, Christopher Schultz [EMAIL PROTECTED] wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Andrew,

 Andrew Hole wrote:
 | Well, our class USER implements HttpSessionBindingListener,
 | Serializable and when failover happens valueUnbound is executed(public
 | void valueUnbound(HttpSessionBindingEvent event)) - valueUnbound is a
 | method of class USER.

 Is this happening on the new server or the old server?

 Maybe your application is replacing the USER in the session with another
 copy or something like that.

 You can always generate a stack trace to find out where the call is
 coming from:

 System.err.println(User saw valueUnbound event!);
 new Throwable().printStackTrace();

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

 iEYEARECAAYFAkfC6VsACgkQ9CaO5/Lv0PDwjgCghiPQXcAA9AGGSKkeJ5WuzoRQ
 HYkAn1SjgLifqMpxKyZmZ1+GWp74PTTY
 =hNUj
 -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: Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

Paul-

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

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

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

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


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

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


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


--adam

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



Re: Apache2 adn/or Tomcat6?

2008-02-25 Thread Mark H. Wood
On Fri, Feb 22, 2008 at 12:57:22PM -0800, Alan Chaney wrote:
 Or as I mentioned in a recent email, you can run something like jsvc and 
 set the user to 'tomcat' which allows you to bind to the port and then
 changes the user.

Okay, either I wasn't paying attention the last time I looked at jsvc,
or the documentation has improved quite a bit.  I've tried it before
and it wouldn't do what I wanted.  Time to try again.  Thanks.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgpdmhe8rTLkl.pgp
Description: PGP signature


Re: Why is session unbound called after cluster failover?

2008-02-25 Thread Filip Hanik - Dev Lists


the stack trace idea is a good idea, and you can post it here

Filip


Christopher Schultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| Well, our class USER implements HttpSessionBindingListener,
| Serializable and when failover happens valueUnbound is executed(public
| void valueUnbound(HttpSessionBindingEvent event)) - valueUnbound is a
| method of class USER.

Is this happening on the new server or the old server?

Maybe your application is replacing the USER in the session with another
copy or something like that.

You can always generate a stack trace to find out where the call is
coming from:

System.err.println(User saw valueUnbound event!);
new Throwable().printStackTrace();

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

iEYEARECAAYFAkfC6VsACgkQ9CaO5/Lv0PDwjgCghiPQXcAA9AGGSKkeJ5WuzoRQ
HYkAn1SjgLifqMpxKyZmZ1+GWp74PTTY
=hNUj
-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]



Realms and Remote Address

2008-02-25 Thread Kerrin Hardy
I'm trying to create a Realm that authenticates a user and logs the IP address 
they attempted from, but I am having trouble finding how I get the IP address 
of the request (the Remote IP Address).
 
I know I could get it if I had the Socket object, but I don't see how I get 
that from the Realm.
 
The function I need to access it from with in is the following function:
public Principal authenticate(String username, String password)
 
I'm sure the answer is simple, but I just can't find it.
 
Thanks for your help in advance,
 
Kerrin


Re: cachingAllowed=false kills tomcat-5.5 (works on tomcat-6)

2008-02-25 Thread Mick Semb Wever
 My application has in META-INF/context.xml: 
 Context cachingAllowed=false /
 
 
 This works just beautifully in tomcat-6 but in tomcat-5.5 the
 application warfile fails to unpack.
 Not a single related log line is written in any of tomcat's logfiles!
 
 Any idea what's up with tomcat-5.5?
 Any idea how to get some more debug out of tomcat?

to myself RTFM: http://tomcat.apache.org/tomcat-5.5-doc/logging.html :-P

With catalina.out running full DEBUG (boy there's alot to read!) i
still see nothing explaining why ROOT.war isn't unpacked.

There is:
 org.apache.catalina.startup.HostConfig - Deploying configuration descriptor 
 ROOT.xml

and then a lot of /normal/ logging debug up until the next archive is
unpacked:
 org.apache.catalina.startup.HostConfig - Deploying web application archive 
 svd.electron.test.sesam.se.war

The catalina.out content between these two points can be found
http://wever.org/root-context-catalina-strippedblanklines.txt.bz2

~mck

-- 
A mind that has been stretched will never return to it's original
dimension. Albert Einstein
| Homepage - www.wever.org | Sesam Search Engine - www.sesam.no |



-
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: Configuring Tomcat for multiple users

2008-02-25 Thread Mark H. Wood
Note that the user web application mechanism only recognizes one
webapp per user.

If you need more than that, you might write up a little gadget (to be
run setuid) which collects and vets enough information to construct a
context descriptor file and then deposits it in
$CATALINA_HOME/config/Catalina/$HOST/$CONTEXTNAME.xml on the user's
behalf.

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgpvEJOFTk10Q.pgp
Description: PGP signature


Re: how to package common lib and ear file

2008-02-25 Thread David Delbecq
Classes shared between webapps go in shared/ folder. server/ folder is 
for server specific (invisible to webapps) classes.


PS: that information is for tomcat, since you seem to use jboss, you 
better ask jboss mailing list, as jboss might use different folders


Dave a écrit :

I have an ear application with entity,business and web modules.
  application ...
  module
  ejbfoo.par/ejb
/module
  module
  ejbbar.ejb3/ejb
/module
  module
web
web-uribaz.war/web-uri
context-root//context-root
/web
/module
  /application

  The .par, .ejb3 and war files use classes in common.jar.  I put the common.jar 
under JBOSS/server/default/lib.
   
  In the common.jar,  
   
  String className = System.getProperty(FooClassName);

Class.forName(className).newInstance();
   
  trying to instantiate the class package.Foo that is defined in web module inside the ear file,  throws a exception:
   
   java.lang.ClassNotFoundException: No ClassLoaders found for: package.Foo
   
  the class package.Foo is application specific and  can not be put into common.jar that is a common library. However the common lib needs to instantiate the application specific class.
   
  How to solve this issue?   is classloader the answer? 
  
Thanks for any help.

Dave


   
-

Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.
  



-
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: Security and Performance Configuration

2008-02-25 Thread Mark H. Wood
Well, IF you are sure you want to use Apache HTTPD to frontend Tomcat,
there's no reason for Tomcat to run an HTTP connector at all.  Just
use the AJP connector, and only allow it to listen to your frontend
service(s), or firewall it away from the Big Bad Internet.  (Or both.)

-- 
Mark H. Wood, Lead System Programmer   [EMAIL PROTECTED]
Typically when a software vendor says that a product is intuitive he
means the exact opposite.



pgp1TCnSsBXIK.pgp
Description: PGP signature


Re: Why is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
Stack trace of old server:
java.lang.Exception
at mni.core.sessions.User.valueUnbound(User.java:95)
at
org.apache.catalina.cluster.session.DeltaSession.removeAttributeInternal(DeltaSession.java:1589)
at
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:776)
at
org.apache.catalina.cluster.session.DeltaManager.stop(DeltaManager.java:1194)
at
org.apache.catalina.core.StandardContext.stop(StandardContext.java:4345)
at
org.apache.catalina.core.ContainerBase.removeChild(ContainerBase.java:892)
at
org.apache.catalina.startup.HostConfig.undeployApps(HostConfig.java:1164)
at
org.apache.catalina.startup.HostConfig.stop(HostConfig.java:1135)
at
org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:312)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1054)
at
org.apache.catalina.core.ContainerBase.stop(ContainerBase.java:1066)
at
org.apache.catalina.core.StandardEngine.stop(StandardEngine.java:447)
at
org.apache.catalina.core.StandardService.stop(StandardService.java:512)
at
org.apache.catalina.core.StandardServer.stop(StandardServer.java:743)
at org.apache.catalina.startup.Catalina.stop(Catalina.java:601)
at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:294)
at
org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:432)

And after logout on new server:
java.lang.Exception
at mni.core.sessions.User.valueUnbound(User.java:95)
at 
org.apache.catalina.cluster.session.DeltaSession.removeAttributeInternal(DeltaSession.java:1603)
at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:786)
at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:697)
at 
org.apache.catalina.cluster.session.DeltaSession.expire(DeltaSession.java:685)
at 
org.apache.catalina.cluster.session.DeltaSession.invalidate(DeltaSession.java:1080)
at 
org.apache.catalina.cluster.session.DeltaSessionFacade.invalidate(DeltaSessionFacade.java:151)
at mni.businesscore.service.sessions.LogOut.DoIt(LogOut.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
flashgateway.adapter.java.JavaAdapter.invokeFunction(JavaAdapter.java:55)
at flashgateway.filter.AdapterFilter.invoke(AdapterFilter.java:117)
at 
flashgateway.filter.MessageSecurityFilter.invoke(MessageSecurityFilter.java:144)
at 
flashgateway.filter.ServiceNameFilter.invoke(ServiceNameFilter.java:101)
at flashgateway.filter.EnvelopeFilter.invoke(EnvelopeFilter.java:102)
at flashgateway.filter.SessionFilter.invoke(SessionFilter.java:28)
at flashgateway.filter.LicenseFilter.invoke(LicenseFilter.java:57)
at flashgateway.filter.ErrorFilter.invoke(ErrorFilter.java:39)
at flashgateway.filter.LogFilter.invoke(LogFilter.java:46)
at 
flashgateway.filter.BatchProcessFilter.invoke(BatchProcessFilter.java:63)
at 
flashgateway.filter.PacketSecurityFilter.invoke(PacketSecurityFilter.java:79)
at flashgateway.filter.DebugFilter.invoke(DebugFilter.java:38)
at 
flashgateway.filter.SerializationFilter.invoke(SerializationFilter.java:89)
at flashgateway.Gateway.invoke(Gateway.java:217)
at 
flashgateway.controller.GatewayServlet.service(GatewayServlet.java:69)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at mni.core.servlets.RequestFilter.processRequest(RequestFilter.java:40)
at 
mni.core.servlets.RequestContextFilter.doFilter(RequestContextFilter.java:76)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
at 

Re: NIO connector in Tomcat 6.0.14

2008-02-25 Thread Stephen More
On Thu, Oct 25, 2007 at 12:19 PM, Filip Hanik - Dev Lists devm wrote:
 browser don't work the way you might it expect to, firefox for example,
  will not display anything until the entire request is complete. so the
  chat example is no good that way.
  write a client application for your comet, to test how it works

Does anyone have java code to test that the chat comet example is
working correctly ?

-Thanks
Steve More

-
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: Help getting MySQL connected to Tomcat

2008-02-25 Thread Lessie Z. Mitch
Yes, David, you are correct.

After some reading, I realized that configuration was recommended by my
application's vendor and is indeed erroneous. Thank you for the
clarification  explanation.

~LZM~


-Original Message-
From: David Smith [mailto:[EMAIL PROTECTED] 
Sent: Sunday, February 24, 2008 5:10 AM
To: Tomcat Users List
Subject: Re: Help getting MySQL connected to Tomcat

 java.net.ConnectException: Connection refused: connect


Some distributions of mysql configure it by default to use named pipes 
w/o a port listening at 3306.  It's mainly for security reasons, but can 
be a real PITA when your application requires a TCP/IP port.  Check the 
parameters MySQL was started with against the list available at 
http://dev.mysql.com/doc/refman/5.0/en/server-options.html  The netstat 
command should also be of help in showing whether mysql is listening on 
a TCP/IP port or not.  Individual systems vary, but to help you get 
started this works on my Mandriva system: netstat -tl.  Once you have 
that fixed and restart mysql, tomcat should be able to connect. 

BTW don't use the autoReconnect=true url option as suggested by another 
poster.  It only tells the driver to attempt to reestablish the 
connection if it fails for some reason, but not until you've 
successfully gotten a connection from the pool, tried it and then have 
received an error.  Your better off configuring your Resource / 
element w/ a validatonQuery attribute like validationQuery=select 1.  
With that the pool will test the connection just before your code 
receives a connection, insuring it's always good.

--David

[EMAIL PROTECTED] wrote:
 Hello,

 I'm trying to get Tomcat and MySQL to connect. I have the following
installations:

 Tomcat V5.5.26
 MySQL V5.0
 mysql connector 5.1.5 from the mysql site (copied the jar to
tomcat\common\lib

 I've tried following the directions from the tomcat dist and from the
mysql dist but I always get can't connect exceptions when I start tomcat.

 In mysql I've created a user=javauser with password=javadude and I created
a database called javatest with one table and some data in the table.
 I can connect to the database from the console using C: mysql -u
javauser -p and I can then connect to the javatest DB and select * from the
table works fine.

 Then I added the following to in the tomcat/conf/context.xml file

 Context path=/db-servlet docBase=db-servlet debug=5
reloadable=true crossContext=true

Resource name=jdbc/TestDB auth=Container
type=javax.sql.DataSource

maxActive=100 maxIdle=30 maxWait=1

username=javauser password=javadude
driverClassName=com.mysql.jdbc.Driver

url=jdbc:mysql://localhost:3306/javatest/

 /Context



 And I stop tomcat, and when I restart tomcat I get the following in the
catalina log:



 ...

 INFO: Stopping Coyote HTTP/1.1 on http-8080

 Feb 23, 2008 8:31:19 AM org.apache.catalina.core.AprLifecycleListener
lifecycleEvent

 INFO: Failed shutdown of Apache Portable Runtime

 Feb 23, 2008 8:37:40 AM org.apache.catalina.startup.Catalina stopServer

 SEVERE: Catalina.stop: 

 java.net.ConnectException: Connection refused: connect

   at java.net.PlainSocketImpl.socketConnect(Native Method)

   at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)

   at
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)

   at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)

   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)

   at java.net.Socket.connect(Socket.java:520)

   at java.net.Socket.connect(Socket.java:470)

   at java.net.Socket.init(Socket.java:367)

   at java.net.Socket.init(Socket.java:180)

   at
org.apache.catalina.startup.Catalina.stopServer(Catalina.java:395)

   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

   at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

   at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

   at java.lang.reflect.Method.invoke(Method.java:585)

   at
org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:344)

   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:435)





 So why the connection refused?



 Any help is appreciated.



 Thanks,

 Kevin





   


-
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.516 / Virus Database: 269.21.1/1297 - Release Date: 2/25/2008
9:22 AM
 

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


-
To 

Re: Session expiration and AJAX issues

2008-02-25 Thread Adam Gordon

Martin-

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


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


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


--adam

Martin Gainty wrote:

Hi Adam-

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

HTH
M-

- Original Message -
From: Adam Gordon [EMAIL PROTECTED]
To: Tomcat Users List users@tomcat.apache.org
Sent: Monday, February 25, 2008 11:04 AM
Subject: Session expiration and AJAX issues


  

A couple of issues:

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

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

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

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

Thanks,

--adam

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





  


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



Re: Session expiration and AJAX issues

2008-02-25 Thread Bob Hall

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

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

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

-Bob


  

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


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



Re: Realms and Remote Address

2008-02-25 Thread Mark Thomas

Kerrin Hardy wrote:

I'm trying to create a Realm that authenticates a user and logs the IP address 
they attempted from, but I am having trouble finding how I get the IP address 
of the request (the Remote IP Address).
 
I know I could get it if I had the Socket object, but I don't see how I get that from the Realm.
 
The function I need to access it from with in is the following function:

public Principal authenticate(String username, String password)
 
I'm sure the answer is simple, but I just can't find it.


Depending on what you are trying to do, you might be off with a filter to 
generate your logs.


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: Why is session unbound called after cluster failover?

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| It happens on both. Valueunbound is executed on old server when
| tomcat is stopped, and is executed on new server when I execute
| logout (or if I shutdown tomcat).

That behavior seems entirely consistent with what should happen -- and
has nothing to do with clustering or anything like that.

| We only want that new server executes valueunbound.
|
| Could you help?

I think you need to manage your events in a way that takes into account
the fact that valueUnbound will can be called by other members in the
cluster.

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

iEYEARECAAYFAkfDFr8ACgkQ9CaO5/Lv0PCGqgCgmpf4OeJQe484bd/BQ0Q5GNX4
TxAAoKzasXr4H7ICeJB78c2K3uzpPrCh
=DLZ3
-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: Session expiration and AJAX issues

2008-02-25 Thread Jason Pyeron
 

 -Original Message-
 From: Adam Gordon [mailto:[EMAIL PROTECTED] 
 Sent: Monday, February 25, 2008 13:11
 To: Tomcat Users List
 Subject: Re: Session expiration and AJAX issues
 
 Martin-
 
 We are using Struts, however, version 1.2.9.  But, after 
 looking at the 
 link, I'm not sure this will help as it doesn't really address the 
 problem.  Storing the date/time a user logs in on the session is 
 probably useful, but our problem is that we want to 
 forcefully log the 
 user out if there's no human present at the computer and the 
 AJAX tasks 
 keep a user's session active indefinitely, whether or not 
 they mean it to.





Can url patterns be excluded from session prolonging magic?





 
 Additionally, assuming we didn't have the AJAX tasks, we'd 
 have to check 
 the logged in time from the session on every request and 
 that's just not 
 realistic when you have hundreds of Struts actions, even with 
 a unique 
 parent Action class.  That said, I'm beginning to suspect 
 that this may 
 be the only way to go, i.e., have  base Action for Struts actions and 
 base action for AJAX actions.  My only issue with this is 
 that then the 
 onus is on the developer to use the right Action and if they don't, a 
 session could inadvertently be left open which is a security risk.
 
 Alternatively, we could simply force the logout on the user after 12 
 hours period...which would kind of suck for the user if they 
 were in the 
 middle of something and so I can almost guarantee that our product 
 management team wouldn't go for it since it's not really creating a 
 positive user experience.
 
 --adam
 
 Martin Gainty wrote:
  Hi Adam-
 
  You can try this with Struts..
  http://struts.apache.org/2.x/docs/simplelogin-with-session.html
  insert the starting-date-time intio Session variable
  and then in the logoutAction.execute method do some quick 
 math on the
  time-delta to determine if you want to quiesce the session
 
  HTH
  M-
 
  - Original Message -
  From: Adam Gordon [EMAIL PROTECTED]
  To: Tomcat Users List users@tomcat.apache.org
  Sent: Monday, February 25, 2008 11:04 AM
  Subject: Session expiration and AJAX issues
 
 

  A couple of issues:
 
  We've set our session expiration to 12 hours (I know it's long) and
  we're seeing behavior where certain browsers (namely IE) apparently
  can't count that high (we set the meta Refresh header but the page
  doesn't reload after the allotted time, session expiration 
 time + 20
  minutes).
 
  Since this issue was discovered, we've added background 
 AJAX timers on
  some of our web pages that refresh (authenticated) 
 content.  While this
  happily works, unfortunately, if the user chooses to 
 remain on one of
  these pages, and then goes on vacation, the session stays 
 active because
  the AJAX calls keep the session alive.
 
  Our first attempt at a solution was to have a JavaScript 
 counter that,
  after every 20 minutes, incremented a counter and if that 
 counter ever
  got to 37, we knew that the user hadn't changed web pages 
 and we could
  log them out (window.location = logout URL.  The problem 
 is that this
  doesn't appear to work either and additionally, it relies 
 on JavaScript
  bypassing Tomcat's built-in features.  User's cannot log 
 in w/o having
  JavaScript enabled, so it's not a matter of a user 
 potentially disabling
  it, rather it puts the onus on the browser to inform the 
 server that the
  user's session needs to be expired.
 
  Does anyone have experience in this area and if so, how 
 have you solved
  this problem?  I know Google uses AJAX with their Gmail 
 webapp, but they
  don't seem to care about not expiring the user's session.  Any help
  would be appreciated.
 
  Thanks,
 
  --adam
 
  
 -
  To start a new topic, e-mail: users@tomcat.apache.org
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 
  
 

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



-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
-   -
- Jason Pyeron  PD Inc. http://www.pdinc.us -
- Principal Consultant  10 West 24th Street #100-
- +1 (443) 269-1555 x333Baltimore, Maryland 21218   -
-   -
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

This message is for the designated recipient only and may contain
privileged, proprietary, or otherwise private information. If you
have received it in error, purge the message from your system and
notify the sender immediately.  Any other use of the email by you
is prohibited. 



Apache/Tomcat - mod_jk issues

2008-02-25 Thread Lessie Z. Mitch
Greetings list.

 

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

 

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

 

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

 

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

 


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


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

SEVERE: BAD packet signature 18245

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

SEVERE: Error, processing connection

java.lang.IndexOutOfBoundsException

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

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

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

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

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

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

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

 

 

 

 

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

 

Server:

RHE 4

Apache 2.0.52

Tomcat 5.5.23

mod_jk 1.2.21 

 

/etc/httpd/conf/httpd.conf

~~ other configurations

Include conf.d/*.conf

~~ other configurations

VirtualHost xxx.xxx.xxx.xxx

ServerName mydomain.com

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

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

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

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

JkMount /*.jsp ajp13

JkMount /servlet/* ajp13

/VirtualHost

~~ other virtual hosts follow, mimic same format

 

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

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

JkWorkersFile /etc/httpd/conf/workers.properties

JkShmFile /var/log/httpd/mod_jk.shm

JkLogFile /var/log/httpd/mod_jk.log

JkLogLevelinfo

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

 

/etc/httpd/conf/workers.properties

worker.list=tomcat

worker.tomcat.host=localhost

worker.tomcat.port=8009

worker.tomcat.type=ajp13

 

tomcat_home/conf/server.xml

~~ other configurations, 

~~ http  ssl are both removed

Connector port=8009 

   enableLookups=false 

   redirectPort=8443 

   protocol=AJP/1.3 /

~~ other configurations

Host 

name=mydomain.com

appBase=someotherdirectory/mydomain.com/webapps

unpackWARs=true 

autoDeploy=true

/Host

~~ other hosts to follow, mimic same format

 

 

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

 

 

~LZM~


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


Class and Object sharing across domain and its sub-domains

2008-02-25 Thread Kristin Coles
I use Apache Tomcat (5.5.9) to host the website (xyz.com) along with a
couple of sub-domains (photos.xyz.com and documents.xyz.com). You can find
the relevant portion of server.xml file below.

Hosting the websites in this way has lead to two main headaches.
1. I cannot share my Java code between xyz.com, photos.xyz.com and
documents.xyz.com:
For example, if I have written a simple Java Bean Class and its deployed in
Tomcat/webapps/xyz/WEB-INF/classes, the Class is not available to
photos.xyz.com and documents.xyz.com. The only way to make it available to
all three domains is deploying the Java Bean class in Tomcat/shared/lib or
Tomcat/common/lib directories.

2. Problems with session sharing across the domain (xyz.com) and its
sub-domains:
For example, when a user performs a search on xyz.com, I store the search
results in a Java Bean Object in the session. Lets say the user clicks on
one of the search results and ends up on a page at documents.xyz.com. Here I
won't have access to the Search Results Java Bean object, which I would love
to have.


These two problems should be pretty common, right? I am wondering how should
I structure my application(s) to take care of the above two. Please advise!

Thank you,
Kristin

/* server.xml */
Host name=xyz.com appBase=webapps
Context path= docbase=xyz
/Context
/Host

Host name=photos.xyz.com appBase=webapps
Context path= docbase=photos
/Context
/Host

Host name=documents.xyz.com appBase=webapps
Context path= docbase=documents
/Context
/Host


Re: Session expiration and AJAX issues

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Adam,

What you need is to make a request without touching the session.
Tomcat cannot do this by itself; you're going to have to either hack
Tomcat to add a no-touch-session parameter to the session manager
(which wouldn't be a bad TC enhancement request, actually), or pass your
session information in a different way through your AJAX calls (say,
using mysessionid as a request parameter, and be sure that the
JSESSIONID cookie is /not/ sent - which might be quite difficult).

The second option is rife with complexity, because then you need to have
your server-side AJAX stuff take the session id and look it up in a
self-managed cache of sessions (see HttpSessionListener), etc., etc., etc.

Here's another option that might not be /quite/ as nasty, but it's still
a pretty bad hack:

1. Invent a new request parameter called noTouchSession and add
~   noTouchSession=true to all of your AJAX calls.

2. Write a Filter that looks something like this:

public void doFilter(ServletRequest req, ServletResponse resp,
FilterChain chain)
{
~HttpServletRequest hReq = (HttpServletRequest)req;

~HttpSession session = hReq.getSession(false);
~if(null != session)
~{
~Date expirationDate =
~ (Date)session.getAttribute(expirationDate);

~if(expirationDate.before(new Date())
~{
~// probably want to log this event
~session.invalidate();
~session=null;
~}
~else
~{

~if(true.equalsIgnoreCase(hReq.getParameter(noTouchSession)))
~{
~// Do nothing; don't update the session timestamp
~}
~else
~{
~session.setAttribute(expirationDate,
~   new Date(System.currentTimeMillis() +
~session.getMaxInactiveInterval() / 1000));
~}

~}
~}

~chain.doFilter(req, resp);
}

What this will do is essentially simulate session timeouts using an
attribute /you/ store in the session instead of relying on the
container. The container will still do all the real work of session
management, which is nice.

Since your AJAX requests will add the magic parameter that doesn't touch
the session timeout, your session will eventually time out (using this
mechanism, not that of the container).

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

iEYEARECAAYFAkfDJY0ACgkQ9CaO5/Lv0PB/7gCdFap7ZW3RZNxrlewwBmtNtwpH
Yr0AoKdYyaGjZkWzUtORawePA+xOFTlX
=uSL3
-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]



Open Source Process

2008-02-25 Thread Uzma Khawaja
Hi,
 I am a student and doing a research on open source processes. I would be 
thankful if some one can answer few simple questions to help me in my research.

1. If someone wants to work on a feature or bug, is he/she required to get 
permission before working? Is he/she REQUIRED to join the community?

2. What tools do you use to manage the project (to track the progress, 
assigning tasks, manage the features and bugs, maintaining patches etc).

Regards,
Uzma Hameed
MS(SE) 3/4,
International Islamic University, Islamabad
   
-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.  Try it now.

Re: Why is session unbound called after cluster failover?

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| I think you need to manage your events in a way that takes into account
| the fact that valueUnbound will can be called by other members in the
| cluster.
| It is not a easy task, rigth?
| Could you be more specific in the way of developing it?

Hmm... I hadn't seen your stack trace before writing my own post.

Does it appear that the TC that is going down is propagating the
expire event to the sessions on other servers? Is that why the new
TC is also calling valudUnbound?

I'm interested in finding out exactly what is happening before I suggest
a solution.

- -chris

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

iEYEARECAAYFAkfDJ94ACgkQ9CaO5/Lv0PCTYQCgijoEPPCCPrPhITX3gvYVn70G
6PsAnRJzSE1WVsXUAaJ87VdgHVmIZTyz
=Wl0Z
-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 architecture

2008-02-25 Thread Johnny Kewl


---
HARBOR: http://coolharbor.100free.com/index.htm
The most powerful application server on earth.
The only real POJO Application Server.
Making the Java dream come true.
---
- Original Message - 
From: Stefano Tranquillini [EMAIL PROTECTED]

To: users@tomcat.apache.org
Sent: Monday, February 25, 2008 10:03 AM
Subject: Tomcat architecture



Hi everybody.
Someone has the architecture of Tomcat and a brief explanation of this?
For architecture t think at some like this:
http://www.javaportal.it/images/tesi/bonzagni2/Bonzagnic_html_m14d04b4d.png
thanks


Stefano, I love this question... I thought the same thing as well, how does 
Tomcat and the whole EJB thing fit?


I have a feeling this reply is going to spew out a few more responses...ha 
ha


In that diagram, call the Web Container TOMCAT.
Take the Beans out of the Ejb container, put them inside the Tomcat 
Container and call them Request or Session Beans.

Call the remaining clients Web Browsers
Throw the EJB container out of the Diagram.
Connect JNDI and RDMS to Tomcat

... thats your diagram...

Is that really that different to EJB, no! because typically what these 
EJB server diagrams never show is that TOMCAT is inside them.


Once I realised that, it was a big click for me.

EJB is many ways is a refinement of Request or Session Beans... now called 
biz logic with a whole bunch of extra tools, and an RMI connection that also

allows applications to talk to the container.

That translates to Tomcat = Web solutions
EJB = external application solutions
Roughly ;)

Hope that helps you see the connection.
Now I leave it up to others to explain when and why you may use one and not 
the other, and why some solutions can lead to suicide... ha ha 



-
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: Realms and Remote Address

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Kerrin,

Kerrin Hardy wrote:
| I'm trying to create a Realm that authenticates a user and logs the
| IP address they attempted from, but I am having trouble finding how I
| get the IP address of the request (the Remote IP Address).

This is not possible using Tomcat's existing container-managed
authentication implementation.

If you want something a little more flexible, you can look at
SecurityFilter (http://securityfilter.sourceforge.net).

Or, you can do as Mark suggests and use a Filter to log successful login
attempts. Unfortunately, you will be unable to log unsuccessful attempts
because IIRC Tomcat intercepts those requests before they even get to
your app's code (including Filters).

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

iEYEARECAAYFAkfDKJMACgkQ9CaO5/Lv0PCZ5QCeLh3CBpzsbMtFp3QgnJnYRn+U
JYMAn3ddJFedUxowiacJqQdDyrjbBdrF
=LwLN
-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: Why is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
I think you need to manage your events in a way that takes into account
the fact that valueUnbound will can be called by other members in the
cluster.
It is not a easy task, rigth?
Could you be more specific in the way of developing it?

Thanks

On Mon, Feb 25, 2008 at 7:27 PM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Andrew,

 Andrew Hole wrote:
 | It happens on both. Valueunbound is executed on old server when
 | tomcat is stopped, and is executed on new server when I execute
 | logout (or if I shutdown tomcat).

 That behavior seems entirely consistent with what should happen -- and
 has nothing to do with clustering or anything like that.

 | We only want that new server executes valueunbound.
 |
 | Could you help?

 I think you need to manage your events in a way that takes into account
 the fact that valueUnbound will can be called by other members in the
 cluster.

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

 iEYEARECAAYFAkfDFr8ACgkQ9CaO5/Lv0PCGqgCgmpf4OeJQe484bd/BQ0Q5GNX4
 TxAAoKzasXr4H7ICeJB78c2K3uzpPrCh
 =DLZ3
 -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: Why is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
Well, valueunbound is executed on both TC.
we are doing session replication, lets say we have a 5 (for example) node
cluster. When a user logs on, his/her session will be replicated on 5
tomcats. When he/she logs out, you only want track that the user has logged
out once, not 5 times (our logout tracking is associated to valueunbound).
Actually, valueunbound is executed on all tomcats.

Let me know if you need more information.



On Mon, Feb 25, 2008 at 8:41 PM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Andrew,

 Andrew Hole wrote:
 | I think you need to manage your events in a way that takes into account
 | the fact that valueUnbound will can be called by other members in the
 | cluster.
 | It is not a easy task, rigth?
 | Could you be more specific in the way of developing it?

 Hmm... I hadn't seen your stack trace before writing my own post.

 Does it appear that the TC that is going down is propagating the
 expire event to the sessions on other servers? Is that why the new
 TC is also calling valudUnbound?

 I'm interested in finding out exactly what is happening before I suggest
 a solution.

 - -chris

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

 iEYEARECAAYFAkfDJ94ACgkQ9CaO5/Lv0PCTYQCgijoEPPCCPrPhITX3gvYVn70G
 6PsAnRJzSE1WVsXUAaJ87VdgHVmIZTyz
 =Wl0Z
 -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: Why is session unbound called after cluster failover?

2008-02-25 Thread Rainer Jung
Not sure if I followed this thread closely enough. It looks like 
sometimes you are talking about node shutdown (your example stack), and 
sometimes about user logout (your last message).


Concerning user logout (resp. session expiration/invalidation): the 
attribute notifyListenersOnReplication of a cluster manager 
(DeltaManager) should help.


See

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

and

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

for configuration example.

Regards,

Rainer

Andrew Hole schrieb:

Well, valueunbound is executed on both TC.
we are doing session replication, lets say we have a 5 (for example) node
cluster. When a user logs on, his/her session will be replicated on 5
tomcats. When he/she logs out, you only want track that the user has logged
out once, not 5 times (our logout tracking is associated to valueunbound).
Actually, valueunbound is executed on all tomcats.

Let me know if you need more information.



On Mon, Feb 25, 2008 at 8:41 PM, Christopher Schultz 
[EMAIL PROTECTED] wrote:

Andrew,

Andrew Hole wrote:
| I think you need to manage your events in a way that takes into account
| the fact that valueUnbound will can be called by other members in the
| cluster.
| It is not a easy task, rigth?
| Could you be more specific in the way of developing it?

Hmm... I hadn't seen your stack trace before writing my own post.

Does it appear that the TC that is going down is propagating the
expire event to the sessions on other servers? Is that why the new
TC is also calling valudUnbound?

I'm interested in finding out exactly what is happening before I suggest
a solution.

-chris



-
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 is session unbound called after cluster failover?

2008-02-25 Thread Christopher Schultz

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Andrew,

Andrew Hole wrote:
| Well, valueUnbound is executed on both TC.

You mentioned that. The valueUnbound is being propagated from the TC
instance shutting down across the cluster, right? I can't seem to get a
straight answer to that question.

| we are doing session replication, lets say we have a 5 (for example) node
| cluster. When a user logs on, his/her session will be replicated on 5
| tomcats. When he/she logs out, you only want track that the user has
logged
| out once, not 5 times (our logout tracking is associated to valueunbound).
| Actually, valueunbound is executed on all tomcats.

Again, this seems consistent to me.

The servlet specification suggests (S 7.7.2):


Application Developers writing distributed applications should be aware
that since the container may run in more than one Java virtual machine,
the developer cannot depend on static variables for storing an
application state. They should store such states using an enterprise
bean or a database.


Perhaps you could have your User object (in its valueUnbound method)
mark the session as already having processed this event.

Of course, bringing down one container in a cluster will have the effect
of logging everyone out at once, even if they are on other servers as well.

Having never run Tomcat under a clustered configuration, I can't say as
I have too many suggestions for you... I usually store a user's state in
a database instead of relying on the HttpSession for that kind of
management. (And we don't attempt to log 'logout' events, which it looks
like you might be attempting to do).

I'm not sure how to tell the difference between a session going away due
to an HttpSession.invalidate call versus some other mechanism (such as
the expire method that you are encountering during shutdown).

- -chris

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

iEYEARECAAYFAkfDMuQACgkQ9CaO5/Lv0PCABACgkRZIFUnCyh+53MbJy4rVLwUG
7c8An0A5DcUfxGDu6+ZFZCCKpy4P+ikh
=PZqx
-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 plans for per-webapp session replication

2008-02-25 Thread Andrew R Feller
Are there any plans to have Tomcat handle session replication on a
per-webapp basis?

 

We currently have several servers configured for session replication
because of a single application.  Not only do we not want session values
from other applications on the machines to be replicated as it is
unnecessary, we wanted a way to store that configuration with a webapp's
META-INF.

 

 

Andrew R Feller, Analyst

University Information Systems

200 Fred Frey Building

Louisiana State University http://www.lsu.edu/ 

Baton Rouge, LA, 70803

(225) 578-3737 (Office)

(225) 578-6400 (Fax)

 



Re: Open Source Process

2008-02-25 Thread Andrei Tchijov


On Feb 25, 2008, at 15:35 , Uzma Khawaja wrote:


Hi,
I am a student and doing a research on open source processes. I  
would be thankful if some one can answer few simple questions to  
help me in my research.


1. If someone wants to work on a feature or bug, is he/she required  
to get permission before working? Is he/she REQUIRED to join the  
community?


Depend. Any one can submit bug/feature to the project.  Some of these  
submissions will end-up in the source code.  To be able actually check- 
in your changes you need to be one of commiters.  You need to be  
well known in the community to get to be a commiter.





2. What tools do you use to manage the project (to track the  
progress, assigning tasks, manage the features and bugs, maintaining  
patches etc).


Different open source projects are using different tools. Usually you  
can see what tool used by visiting project home page (interesting ...  
I have looked at tomcat home page and have not found any references to  
tool used by the project. I am positive that at some point in the past  
they used to have some. ). Some of popular tools are Maven (http://maven.apache.org/)/Bugzilla(http://www.bugzilla.org/)/Trac 
 (http://trac.edgewall.org/)  Do not forget about web sites like  
Sourceforge (http://sourceforge.net/) and Google Code (http://code.google.com/ 
) which provide all-in-one support for open source projects.





Regards,
Uzma Hameed
MS(SE) 3/4,
International Islamic University, Islamabad

-
Be a better friend, newshound, and know-it-all with Yahoo! Mobile.   
Try it now.



-
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 is session unbound called after cluster failover?

2008-02-25 Thread Rainer Jung

Christopher Schultz schrieb:

Of course, bringing down one container in a cluster will have the effect
of logging everyone out at once, even if they are on other servers as well.


No, unless you set expireSessionsOnShutdown which is false by default, 
shutdown of a node should not expire the sessions on the other nodes 
(i.e. should not send expiration messages to the other nodes).


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: Tomcat plans for per-webapp session replication

2008-02-25 Thread Rainer Jung
Not sure what you mean by this: session replication is local to webapps. 
After configuring the cluster element in server.xml, you need to 
activate replication for each webapp with a distributable element in 
web.xml and only session changes for those webapps with distributable 
set get replicated. On the receiving end the replication messages are 
automatically dispatched to the same webapp.


Maybe I din't understand your question?

Regards,

Rainer

Andrew R Feller schrieb:

Are there any plans to have Tomcat handle session replication on a
per-webapp basis?

 


We currently have several servers configured for session replication
because of a single application.  Not only do we not want session values
from other applications on the machines to be replicated as it is
unnecessary, we wanted a way to store that configuration with a webapp's
META-INF.

 

 


Andrew R Feller, Analyst

University Information Systems

200 Fred Frey Building

Louisiana State University http://www.lsu.edu/ 


Baton Rouge, LA, 70803

(225) 578-3737 (Office)

(225) 578-6400 (Fax)

 



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



Re: Session expiration and AJAX issues

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


Bob Hall wrote:

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

  

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

or not they mean it to.




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

-Bob


  

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



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

  


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



Re: Open Source Process

2008-02-25 Thread Mark Thomas

Uzma Khawaja wrote:

Hi,
1. If someone wants to work on a feature or bug, is he/she required to get 
permission before working? Is he/she REQUIRED to join the community?
No permission required. By very virtue of downloading the software and 
working on the bug they have joined the community. It would help if they 
joined the dev and users list but isn't essential.



2. What tools do you use to manage the project (to

track the progress
text files in svn, bugzilla

assigning tasks
Tasks aren't assigned. People work on what they want to

manage the features and bugs
text files in svn (features), bugzilla (a few features, mainly bugs)

maintaining patches etc
Not sure what you mean by this. We don't maintain patches - we do a new 
release. We use Apache Ant to build.


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: Class and Object sharing across domain and its sub-domains

2008-02-25 Thread david delbecq
Since your 3 webapps need to share classes code, object instances and 
session information, i don't see why you want to make 3 webapps instead 
of just one. So my advise would be to make a single webapp.

Kristin Coles a écrit :

I use Apache Tomcat (5.5.9) to host the website (xyz.com) along with a
couple of sub-domains (photos.xyz.com and documents.xyz.com). You can find
the relevant portion of server.xml file below.

Hosting the websites in this way has lead to two main headaches.
1. I cannot share my Java code between xyz.com, photos.xyz.com and
documents.xyz.com:
For example, if I have written a simple Java Bean Class and its deployed in
Tomcat/webapps/xyz/WEB-INF/classes, the Class is not available to
photos.xyz.com and documents.xyz.com. The only way to make it available to
all three domains is deploying the Java Bean class in Tomcat/shared/lib or
Tomcat/common/lib directories.

2. Problems with session sharing across the domain (xyz.com) and its
sub-domains:
For example, when a user performs a search on xyz.com, I store the search
results in a Java Bean Object in the session. Lets say the user clicks on
one of the search results and ends up on a page at documents.xyz.com. Here I
won't have access to the Search Results Java Bean object, which I would love
to have.


These two problems should be pretty common, right? I am wondering how should
I structure my application(s) to take care of the above two. Please advise!

Thank you,
Kristin

/* server.xml */
Host name=xyz.com appBase=webapps
Context path= docbase=xyz
/Context
/Host

Host name=photos.xyz.com appBase=webapps
Context path= docbase=photos
/Context
/Host

Host name=documents.xyz.com appBase=webapps
Context path= docbase=documents
/Context
/Host

  



-
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 plans for per-webapp session replication

2008-02-25 Thread Filip Hanik - Dev Lists

this has been done since the beginning of session replication.
if your webapp has distributable/ in web.xml sessions will be replicated.
if the element is missing, session data will not be replicated even if 
the server is configured for clustering


Filip


Andrew R Feller wrote:

Are there any plans to have Tomcat handle session replication on a
per-webapp basis?

 


We currently have several servers configured for session replication
because of a single application.  Not only do we not want session values
from other applications on the machines to be replicated as it is
unnecessary, we wanted a way to store that configuration with a webapp's
META-INF.

 

 


Andrew R Feller, Analyst

University Information Systems

200 Fred Frey Building

Louisiana State University http://www.lsu.edu/ 


Baton Rouge, LA, 70803

(225) 578-3737 (Office)

(225) 578-6400 (Fax)

 



  



No virus found in this incoming message.
Checked by AVG Free Edition. 
Version: 7.5.516 / Virus Database: 269.21.0/1296 - Release Date: 2/24/2008 12:19 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: Class and Object sharing across domain and its sub-domains

2008-02-25 Thread Kristin Coles
Thanks for the reply, David. Are you saying that I need to get rid of the
sub-domains? i.e. I should use xyz.com/photos rather than photos.xyz.com?
Can you please elaborate?

Thanks,
Kristin


On Mon, Feb 25, 2008 at 4:04 PM, david delbecq [EMAIL PROTECTED] wrote:

 Since your 3 webapps need to share classes code, object instances and
 session information, i don't see why you want to make 3 webapps instead
 of just one. So my advise would be to make a single webapp.
 Kristin Coles a écrit :
  I use Apache Tomcat (5.5.9) to host the website (xyz.com) along with a
  couple of sub-domains (photos.xyz.com and documents.xyz.com). You can
 find
  the relevant portion of server.xml file below.
 
  Hosting the websites in this way has lead to two main headaches.
  1. I cannot share my Java code between xyz.com, photos.xyz.com and
  documents.xyz.com:
  For example, if I have written a simple Java Bean Class and its deployed
 in
  Tomcat/webapps/xyz/WEB-INF/classes, the Class is not available to
  photos.xyz.com and documents.xyz.com. The only way to make it available
 to
  all three domains is deploying the Java Bean class in Tomcat/shared/lib
 or
  Tomcat/common/lib directories.
 
  2. Problems with session sharing across the domain (xyz.com) and its
  sub-domains:
  For example, when a user performs a search on xyz.com, I store the
 search
  results in a Java Bean Object in the session. Lets say the user clicks
 on
  one of the search results and ends up on a page at documents.xyz.com.
 Here I
  won't have access to the Search Results Java Bean object, which I would
 love
  to have.
 
 
  These two problems should be pretty common, right? I am wondering how
 should
  I structure my application(s) to take care of the above two. Please
 advise!
 
  Thank you,
  Kristin
 
  /* server.xml */
  Host name=xyz.com appBase=webapps
  Context path= docbase=xyz
  /Context
  /Host
 
  Host name=photos.xyz.com appBase=webapps
  Context path= docbase=photos
  /Context
  /Host
 
  Host name=documents.xyz.com appBase=webapps
  Context path= docbase=documents
  /Context
  /Host
 
 


 -
 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 is session unbound called after cluster failover?

2008-02-25 Thread Andrew Hole
 The valueUnbound is NOT being propagated from the TC instance shutting
down across the cluster. The valueunbound is executed when I do the shutdown
of an TC instance  (session logout tracking was done - database record
inserted). After that I still work with this session on the active node ...
(however, on database i already have a logout session record). What we want
is that the valueunbound not be
executed while there is an active node in the cluster.

Thanks a lot


On Mon, Feb 25, 2008 at 9:41 PM, Rainer Jung [EMAIL PROTECTED]
wrote:

 Christopher Schultz schrieb:
  Of course, bringing down one container in a cluster will have the effect
  of logging everyone out at once, even if they are on other servers as
 well.

 No, unless you set expireSessionsOnShutdown which is false by default,
 shutdown of a node should not expire the sessions on the other nodes
 (i.e. should not send expiration messages to the other nodes).

 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: Incorrect cookie value in tomcat5.5.26

2008-02-25 Thread Filip Hanik - Dev Lists

what is your scenario,

the following code worked for me, even though the browser doesn't send 
up cookie version


%
 javax.servlet.http.Cookie[] cs = request.getCookies();
 String value = null;
 for (Cookie co : cs) {
   if (test.equals(co.getName())) value = co.getValue();

 }

 javax.servlet.http.Cookie c = new 
javax.servlet.http.Cookie(test,someemail=somedomain.com);

 c.setVersion(1);
 c.setMaxAge(100);
 response.addCookie(c);

%
done!br/
%=value%



Sushil Vegad wrote:

Hello,

cookie.setVersion(1) remembers the cookie only for the browser session. A
new browser does not have access to the cookie

We did cookie.setMaxAge(Integer.MAX_VALUE) but that doesn't help.

Any thoughts please?

Thanks,
Sushil Vegad
Technical Lead, Scheduling Project
Serebrum Corporation - translating strategy into results
Work: 609.777.3563
Cell: 732.216.4908  
Email: [EMAIL PROTECTED]

Conference Dial-in: 1-218-486-1300, Bridge: 427526
 


-Original Message-
From: Filip Hanik - Dev Lists [mailto:[EMAIL PROTECTED] 
Sent: Monday, February 11, 2008 11:54 AM

To: Tomcat Users List
Subject: Re: Incorrect cookie value in tomcat5.5.26

not broken, corrected. the java doc says


  setValue

public void *setValue*(String
http://java.sun.com/j2se/1.5/docs/api/java/lang/String.html newValue)

Assigns a new value to a cookie after the cookie is created. If you
use a binary value, you may want to use BASE64 encoding.

With Version 0 cookies, values should not contain white space,
brackets, parentheses, equals signs, commas, double quotes, slashes,
question marks, at signs, colons, and semicolons. Empty values may
not behave the same way on all browsers.

*Parameters:*
|newValue| - a |String| specifying the new value


to fix this, all you need to do is

cookie.setVersion(1);

Filip

Konstantin Kolinko wrote:
  

I guess the cause is the same as for tomcat 6.0.16.
See messages entitles Cookies are broken in 6.0.16?.

http://www.nabble.com/Cookies-are-broken-in-6.0.16--to15369118.html

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



  




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





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



NIO connector under heavy load drops incoming requests?

2008-02-25 Thread Emile Litvak
Hello everyone,

 

We have a high load environment where we are running tomcat 5.5.15
successfully. We are interesting in reducing the system CPU load and
switching to Tomcat 6 with NIO, but so far have run into a few issues.
After trying out the patch Filip recommended

(http://svn.apache.org/viewvc?view=revrevision=618420) we did get
further (our CPUs were not pegged any more and exceptions went away),
but it appears that about 2/3rds of the requests are being dropped. I
was going to file a bug, but I thought I'd post it first to see if
anyone has any ideas.

 

We have many tomcat servers running 5.5.15. I took one of the machines,
and put 6.0.16 on it, patched it. Each server gets around 3K requests a
minute during the time window when I saw doing my experiments. Using
6.0.16 regular HTTP connections, I do get around 3K requests per minute
that we process. With NIO, we only see around 1.2K per minute. Here are
the two connector configurations.

 

Regular config

Connector port=8000

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 

   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 

   maxHttpHeaderSize=8192 /

 

NIO config

Connector port=8000
protocol=org.apache.coyote.http11.Http11NioProtocol
acceptorThreadCount=4

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 

   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 

   maxHttpHeaderSize=8192 /

 

I tried to tune various NIO parameters and had no luck. I can only
assume that acceptors turn away some requests for some reason without
passing them down to the worker threads. Or that I have mis-configured
something.

 

Here are some interesting threads

 

A worker thread

http-8000-exec-20
52   TIMED_WAITING  2000

.omited

javax.servlet.http.HttpServlet.service(690)


javax.servlet.http.HttpServlet.service(803)


org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(290)


org.apache.catalina.core.ApplicationFilterChain.doFilter(206)


org.apache.catalina.core.StandardWrapperValve.invoke(233)


org.apache.catalina.core.StandardContextValve.invoke(175)


org.apache.catalina.authenticator.AuthenticatorBase.invoke(433)


org.apache.catalina.core.StandardHostValve.invoke(128)


org.apache.catalina.valves.ErrorReportValve.invoke(102)


org.apache.catalina.valves.AccessLogValve.invoke(568)


org.apache.catalina.core.StandardEngineValve.invoke(109)


org.apache.catalina.connector.CoyoteAdapter.service(286)


org.apache.coyote.http11.Http11NioProcessor.process(879)


org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.proce
ss(719)


org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(2080)


java.util.concurrent.ThreadPoolExecutor$Worker.runTask(885)


java.util.concurrent.ThreadPoolExecutor$Worker.run(907)


java.lang.Thread.run(619)


 

Idle worker thread

http-8000-exec-1
21   TIMED_WAITING  5000
[EMAIL PROTECTED]
aa65fe  -1   41-1   17   -1

sun.misc.Unsafe.park(-2)


java.util.concurrent.locks.LockSupport.parkNanos(198)


java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.aw
aitNanos(1963)


java.util.concurrent.LinkedBlockingQueue.poll(395)


java.util.concurrent.ThreadPoolExecutor.getTask(944)


java.util.concurrent.ThreadPoolExecutor$Worker.run(906)


java.lang.Thread.run(619)


 

NIO endpoint


http-8000-ClientPoller
20   RUNNABLE   37000
-1   285   -1   8-1

sun.nio.ch.EPollArrayWrapper.epollWait(-2)


sun.nio.ch.EPollArrayWrapper.poll(215)


sun.nio.ch.EPollSelectorImpl.doSelect(65)


sun.nio.ch.SelectorImpl.lockAndDoSelect(69)


sun.nio.ch.SelectorImpl.select(80)


org.apache.tomcat.util.net.NioEndpoint$Poller.run(1473)


java.lang.Thread.run(619)


 

My 4 acceptors


http-8000-Acceptor-3
19   BLOCKED5000[EMAIL PROTECTED]
16   71-1   0-1

sun.nio.ch.ServerSocketChannelImpl.accept(129)


org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(1198)


java.lang.Thread.run(619)


 


http-8000-Acceptor-2
18   BLOCKED3000[EMAIL PROTECTED]
16   48-1   0-1

sun.nio.ch.ServerSocketChannelImpl.accept(129)


org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(1198)


java.lang.Thread.run(619)


 


http-8000-Acceptor-1
17   BLOCKED4000[EMAIL PROTECTED]
16   51-1   

Re: NIO connector under heavy load drops incoming requests?

2008-02-25 Thread Alan Chaney
Actually I've seen something like this. I'm under a lot of pressure to 
get something out so I haven't investigated it further, but what seemed

to be happening is that if the client slowed down the NIO connector was
throwing a SocketTimeout. I tried messing about with the timeout 
settings but couldn't get the problem to go away, so I just switched 
back to the blocking I/O for the moment which works OK. This is 6.0.16.


My usage is quite different - I am delivering a small number of some 
very large files and the requests per minute is limited by the available 
network bandwidth. Its on my list to characterize the problem more fully.


Regards

Alan


Emile Litvak wrote:

Hello everyone,

 


We have a high load environment where we are running tomcat 5.5.15
successfully. We are interesting in reducing the system CPU load and
switching to Tomcat 6 with NIO, but so far have run into a few issues.
After trying out the patch Filip recommended

(http://svn.apache.org/viewvc?view=revrevision=618420) we did get
further (our CPUs were not pegged any more and exceptions went away),
but it appears that about 2/3rds of the requests are being dropped. I
was going to file a bug, but I thought I'd post it first to see if
anyone has any ideas.

 


We have many tomcat servers running 5.5.15. I took one of the machines,
and put 6.0.16 on it, patched it. Each server gets around 3K requests a
minute during the time window when I saw doing my experiments. Using
6.0.16 regular HTTP connections, I do get around 3K requests per minute
that we process. With NIO, we only see around 1.2K per minute. Here are
the two connector configurations.

 


Regular config

Connector port=8000

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 


   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 


   maxHttpHeaderSize=8192 /

 


NIO config

Connector port=8000
protocol=org.apache.coyote.http11.Http11NioProtocol
acceptorThreadCount=4

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 


   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 


   maxHttpHeaderSize=8192 /

 


I tried to tune various NIO parameters and had no luck. I can only
assume that acceptors turn away some requests for some reason without
passing them down to the worker threads. Or that I have mis-configured
something.

 


Here are some interesting threads

 


A worker thread

http-8000-exec-20
52   TIMED_WAITING  2000


.omited

javax.servlet.http.HttpServlet.service(690)


javax.servlet.http.HttpServlet.service(803)


org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(290)


org.apache.catalina.core.ApplicationFilterChain.doFilter(206)


org.apache.catalina.core.StandardWrapperValve.invoke(233)


org.apache.catalina.core.StandardContextValve.invoke(175)


org.apache.catalina.authenticator.AuthenticatorBase.invoke(433)


org.apache.catalina.core.StandardHostValve.invoke(128)


org.apache.catalina.valves.ErrorReportValve.invoke(102)


org.apache.catalina.valves.AccessLogValve.invoke(568)


org.apache.catalina.core.StandardEngineValve.invoke(109)


org.apache.catalina.connector.CoyoteAdapter.service(286)


org.apache.coyote.http11.Http11NioProcessor.process(879)


org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.proce
ss(719)


org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(2080)


java.util.concurrent.ThreadPoolExecutor$Worker.runTask(885)


java.util.concurrent.ThreadPoolExecutor$Worker.run(907)


java.lang.Thread.run(619)


 


Idle worker thread

http-8000-exec-1
21   TIMED_WAITING  5000
[EMAIL PROTECTED]
aa65fe  -1   41-1   17   -1

sun.misc.Unsafe.park(-2)


java.util.concurrent.locks.LockSupport.parkNanos(198)


java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.aw
aitNanos(1963)


java.util.concurrent.LinkedBlockingQueue.poll(395)


java.util.concurrent.ThreadPoolExecutor.getTask(944)


java.util.concurrent.ThreadPoolExecutor$Worker.run(906)


java.lang.Thread.run(619)


 


NIO endpoint


http-8000-ClientPoller
20   RUNNABLE   37000
-1   285   -1   8-1

sun.nio.ch.EPollArrayWrapper.epollWait(-2)


sun.nio.ch.EPollArrayWrapper.poll(215)


sun.nio.ch.EPollSelectorImpl.doSelect(65)


sun.nio.ch.SelectorImpl.lockAndDoSelect(69)


sun.nio.ch.SelectorImpl.select(80)



Re: NIO connector under heavy load drops incoming requests?

2008-02-25 Thread Filip Hanik - Dev Lists

you don't need four (4) acceptor threads, turn that to one (1)
also, you omited the most interesting stack trace :)

Filip

Emile Litvak wrote:

Hello everyone,

 


We have a high load environment where we are running tomcat 5.5.15
successfully. We are interesting in reducing the system CPU load and
switching to Tomcat 6 with NIO, but so far have run into a few issues.
After trying out the patch Filip recommended

(http://svn.apache.org/viewvc?view=revrevision=618420) we did get
further (our CPUs were not pegged any more and exceptions went away),
but it appears that about 2/3rds of the requests are being dropped. I
was going to file a bug, but I thought I'd post it first to see if
anyone has any ideas.

 


We have many tomcat servers running 5.5.15. I took one of the machines,
and put 6.0.16 on it, patched it. Each server gets around 3K requests a
minute during the time window when I saw doing my experiments. Using
6.0.16 regular HTTP connections, I do get around 3K requests per minute
that we process. With NIO, we only see around 1.2K per minute. Here are
the two connector configurations.

 


Regular config

Connector port=8000

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 


   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 


   maxHttpHeaderSize=8192 /

 


NIO config

Connector port=8000
protocol=org.apache.coyote.http11.Http11NioProtocol
acceptorThreadCount=4

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on 

   compressionMinSize=2048 

   noCompressionUserAgents=gozilla, traviata 


   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true 


   maxHttpHeaderSize=8192 /

 


I tried to tune various NIO parameters and had no luck. I can only
assume that acceptors turn away some requests for some reason without
passing them down to the worker threads. Or that I have mis-configured
something.

 


Here are some interesting threads

 


A worker thread

http-8000-exec-20
52   TIMED_WAITING  2000


.omited

javax.servlet.http.HttpServlet.service(690)


javax.servlet.http.HttpServlet.service(803)


org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(290)


org.apache.catalina.core.ApplicationFilterChain.doFilter(206)


org.apache.catalina.core.StandardWrapperValve.invoke(233)


org.apache.catalina.core.StandardContextValve.invoke(175)


org.apache.catalina.authenticator.AuthenticatorBase.invoke(433)


org.apache.catalina.core.StandardHostValve.invoke(128)


org.apache.catalina.valves.ErrorReportValve.invoke(102)


org.apache.catalina.valves.AccessLogValve.invoke(568)


org.apache.catalina.core.StandardEngineValve.invoke(109)


org.apache.catalina.connector.CoyoteAdapter.service(286)


org.apache.coyote.http11.Http11NioProcessor.process(879)


org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.proce
ss(719)


org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(2080)


java.util.concurrent.ThreadPoolExecutor$Worker.runTask(885)


java.util.concurrent.ThreadPoolExecutor$Worker.run(907)


java.lang.Thread.run(619)


 


Idle worker thread

http-8000-exec-1
21   TIMED_WAITING  5000
[EMAIL PROTECTED]
aa65fe  -1   41-1   17   -1

sun.misc.Unsafe.park(-2)


java.util.concurrent.locks.LockSupport.parkNanos(198)


java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.aw
aitNanos(1963)


java.util.concurrent.LinkedBlockingQueue.poll(395)


java.util.concurrent.ThreadPoolExecutor.getTask(944)


java.util.concurrent.ThreadPoolExecutor$Worker.run(906)


java.lang.Thread.run(619)


 


NIO endpoint


http-8000-ClientPoller
20   RUNNABLE   37000
-1   285   -1   8-1

sun.nio.ch.EPollArrayWrapper.epollWait(-2)


sun.nio.ch.EPollArrayWrapper.poll(215)


sun.nio.ch.EPollSelectorImpl.doSelect(65)


sun.nio.ch.SelectorImpl.lockAndDoSelect(69)


sun.nio.ch.SelectorImpl.select(80)


org.apache.tomcat.util.net.NioEndpoint$Poller.run(1473)


java.lang.Thread.run(619)


 


My 4 acceptors


http-8000-Acceptor-3
19   BLOCKED5000[EMAIL PROTECTED]
16   71-1   0-1

sun.nio.ch.ServerSocketChannelImpl.accept(129)


org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(1198)


java.lang.Thread.run(619)


 



http-8000-Acceptor-2
18   BLOCKED3000[EMAIL PROTECTED]
16   48-1   0-1

sun.nio.ch.ServerSocketChannelImpl.accept(129)



Re: NIO connector under heavy load drops incoming requests?

2008-02-25 Thread Filip Hanik - Dev Lists

Alan Chaney wrote:
Actually I've seen something like this. I'm under a lot of pressure to 
get something out so I haven't investigated it further, but what seemed

to be happening is that if the client slowed down the NIO connector was
throwing a SocketTimeout. I tried messing about with the timeout 
settings but couldn't get the problem to go away, so I just switched 
back to the blocking I/O for the moment which works OK. This is 6.0.16.


My usage is quite different - I am delivering a small number of some 
very large files and the requests per minute is limited by the 
available network bandwidth. Its on my list to characterize the 
problem more fully.

that case doesn't call for NIO, in that case you want blocking IO

Filip


Regards

Alan


Emile Litvak wrote:

Hello everyone,

 


We have a high load environment where we are running tomcat 5.5.15
successfully. We are interesting in reducing the system CPU load and
switching to Tomcat 6 with NIO, but so far have run into a few issues.
After trying out the patch Filip recommended

(http://svn.apache.org/viewvc?view=revrevision=618420) we did get
further (our CPUs were not pegged any more and exceptions went away),
but it appears that about 2/3rds of the requests are being dropped. I
was going to file a bug, but I thought I'd post it first to see if
anyone has any ideas.

 


We have many tomcat servers running 5.5.15. I took one of the machines,
and put 6.0.16 on it, patched it. Each server gets around 3K requests a
minute during the time window when I saw doing my experiments. Using
6.0.16 regular HTTP connections, I do get around 3K requests per minute
that we process. With NIO, we only see around 1.2K per minute. Here are
the two connector configurations.

 


Regular config

Connector port=8000

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on
   compressionMinSize=2048
   noCompressionUserAgents=gozilla, traviata
   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true
   maxHttpHeaderSize=8192 /

 


NIO config

Connector port=8000
protocol=org.apache.coyote.http11.Http11NioProtocol
acceptorThreadCount=4

   maxThreads=500 minSpareThreads=25
maxSpareThreads=75

   enableLookups=false redirectPort=443
acceptCount=100

   compression=on
   compressionMinSize=2048
   noCompressionUserAgents=gozilla, traviata
   compressableMimeType=text/html,text/xml

   connectionTimeout=0 disableUploadTimeout=true
   maxHttpHeaderSize=8192 /

 


I tried to tune various NIO parameters and had no luck. I can only
assume that acceptors turn away some requests for some reason without
passing them down to the worker threads. Or that I have mis-configured
something.

 


Here are some interesting threads

 


A worker thread

http-8000-exec-20
52   TIMED_WAITING  2000   
.omited


javax.servlet.http.HttpServlet.service(690)


javax.servlet.http.HttpServlet.service(803)


org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(290)


org.apache.catalina.core.ApplicationFilterChain.doFilter(206)


org.apache.catalina.core.StandardWrapperValve.invoke(233)


org.apache.catalina.core.StandardContextValve.invoke(175)


org.apache.catalina.authenticator.AuthenticatorBase.invoke(433)


org.apache.catalina.core.StandardHostValve.invoke(128)


org.apache.catalina.valves.ErrorReportValve.invoke(102)


org.apache.catalina.valves.AccessLogValve.invoke(568)


org.apache.catalina.core.StandardEngineValve.invoke(109)


org.apache.catalina.connector.CoyoteAdapter.service(286)


org.apache.coyote.http11.Http11NioProcessor.process(879)


org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.proce
ss(719)


org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(2080)


java.util.concurrent.ThreadPoolExecutor$Worker.runTask(885)


java.util.concurrent.ThreadPoolExecutor$Worker.run(907)


java.lang.Thread.run(619)


 


Idle worker thread

http-8000-exec-1
21   TIMED_WAITING  5000
[EMAIL PROTECTED]
aa65fe  -1   41-1   17   -1

sun.misc.Unsafe.park(-2)


java.util.concurrent.locks.LockSupport.parkNanos(198)


java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.aw
aitNanos(1963)


java.util.concurrent.LinkedBlockingQueue.poll(395)


java.util.concurrent.ThreadPoolExecutor.getTask(944)


java.util.concurrent.ThreadPoolExecutor$Worker.run(906)


java.lang.Thread.run(619)


 


NIO endpoint


http-8000-ClientPoller
20   RUNNABLE   37000
-1   285   -1   8-1

sun.nio.ch.EPollArrayWrapper.epollWait(-2)


sun.nio.ch.EPollArrayWrapper.poll(215)


sun.nio.ch.EPollSelectorImpl.doSelect(65)


sun.nio.ch.SelectorImpl.lockAndDoSelect(69)



Re: Custom URL handlers in Tomcat web app

2008-02-25 Thread MK
Christopher, thanks a lot for your replies.

Christopher Schultz chris at christopherschultz.net writes:

 MK wrote:
 | Actually I don't even call URL.openConnection, because I don't need it
 at all.
 | It's really just that the java.net.URL constructor requires that there
 exists an
 | object which implements this behavior just in case someone should try
 to open a
 | connection.
 
 As I'm reading more in the API, I can see that the URL class has a
 constructor that takes a URLStreamHandler. Could you utilize this
 constructor instead?

that's a good idea actually (although it would require me to parse the incoming
URL strings on my own; a job which is otherwise done by the URL ctor itself, but
oh well). However, unfortunately this still does not help, because it merely
moves the problem further down the implementation of that (somewhat obscure) API
I am using. The problem is that with this constructor, creating a URL object on
my side succeeds, but passing it to that API will still result in a MalformedUrl
somewhere down their implementation, maybe because they pack/unpack the wrapped
URL string to create other URL objects from it, dunno. Dang! I though I almost
had it :-)

as for the checking whether the JVM argument for my protocol package is properly
set, I already had done that and I can assure you it is properly set. Tomcat
really seems not to honor this value properly before registering its
URLStreamHandlerFactory.

I am using Tomcat 5.5 by the way.

I will try rolling a jar from my protocol handler and put it in the places you
suggested. Maybe that'll work, I'll report back.

Regards,
Matt


-
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: Custom URL handlers in Tomcat web app

2008-02-25 Thread MK
MK kaeppler.matthias at nts.ricoh.co.jp writes:
 [...]
 I am using Tomcat 5.5 by the way.
 
 I will try rolling a jar from my protocol handler and put it in the places you
 suggested. Maybe that'll work, I'll report back.

actually I just realized that this is not gonna help if Tomcat does not honor
the java.protocol.handler.pkgs setting, because even if Tomcat can load the JAR
and knows where to look for it, it would still need to read this setting to load
the Handler class upon URL construction (because this happens through Tomcat's
URLStreamHandlerFactory), no?

Anywho, I just tried common/lib, common/endorsed and a custom location I added
manually to the classpath (which would make it available to the system
classloader right?). Didn't work.

Any ideas left that do not include the words Tomcat sources and modify? :D
I still can't quite believe how a trivial operation such as constructing a
java.net.URL from a wellformed (!) URL can cause so much trouble in a Servlet
based environment. I must be missing something.

Regards,
Matt


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



Re: Session expiration and AJAX issues

2008-02-25 Thread mgainty
Jason-

the url patterns depends on the servlet mapping you've defined..

You're going to need some algorithm which defines infinity
Your current mechanism binds the current Servlet to the ajax control (div?)
Acquire the initial date/time ..store it somewhere..hopeully in session
when the servlet finally reaches delta greater than *some predefined
infinite value* send back result which will cause
either the innerhtml to have the requisite logout.jsp or path to logout.jsp
return some predefined ActionResult which will *map* to your logout.jsp

M-
- Original Message -
Wrom: FVWRKJVZCMHVIBGDADRZFSQHYUCDDJBLV
To: 'Tomcat Users List' users@tomcat.apache.org
Sent: Monday, February 25, 2008 2:29 PM
Subject: RE: Session expiration and AJAX issues




  -Original Message-
  Wrom: LMHAALPTCXLYRWTQTIPWIGYOKSTTZRCLBDXRQBGJSNBOHM
  Sent: Monday, February 25, 2008 13:11
  To: Tomcat Users List
  Subject: Re: Session expiration and AJAX issues
 
  Martin-
 
  We are using Struts, however, version 1.2.9.  But, after
  looking at the
  link, I'm not sure this will help as it doesn't really address the
  problem.  Storing the date/time a user logs in on the session is
  probably useful, but our problem is that we want to
  forcefully log the
  user out if there's no human present at the computer and the
  AJAX tasks
  keep a user's session active indefinitely, whether or not
  they mean it to.





 Can url patterns be excluded from session prolonging magic?





 
  Additionally, assuming we didn't have the AJAX tasks, we'd
  have to check
  the logged in time from the session on every request and
  that's just not
  realistic when you have hundreds of Struts actions, even with
  a unique
  parent Action class.  That said, I'm beginning to suspect
  that this may
  be the only way to go, i.e., have  base Action for Struts actions and
  base action for AJAX actions.  My only issue with this is
  that then the
  onus is on the developer to use the right Action and if they don't, a
  session could inadvertently be left open which is a security risk.
 
  Alternatively, we could simply force the logout on the user after 12
  hours period...which would kind of suck for the user if they
  were in the
  middle of something and so I can almost guarantee that our product
  management team wouldn't go for it since it's not really creating a
  positive user experience.
 
  --adam
 
  Martin Gainty wrote:
   Hi Adam-
  
   You can try this with Struts..
   http://struts.apache.org/2.x/docs/simplelogin-with-session.html
   insert the starting-date-time intio Session variable
   and then in the logoutAction.execute method do some quick
  math on the
   time-delta to determine if you want to quiesce the session
  
   HTH
   M-
  
   - Original Message -
   Wrom: KHJYFMYXOEAIJJPHSCRTNHGSWZIDREXCAXZOWCONE
   To: Tomcat Users List users@tomcat.apache.org
   Sent: Monday, February 25, 2008 11:04 AM
   Subject: Session expiration and AJAX issues
  
  
  
   A couple of issues:
  
   We've set our session expiration to 12 hours (I know it's long) and
   we're seeing behavior where certain browsers (namely IE) apparently
   can't count that high (we set the meta Refresh header but the page
   doesn't reload after the allotted time, session expiration
  time + 20
   minutes).
  
   Since this issue was discovered, we've added background
  AJAX timers on
   some of our web pages that refresh (authenticated)
  content.  While this
   happily works, unfortunately, if the user chooses to
  remain on one of
   these pages, and then goes on vacation, the session stays
  active because
   the AJAX calls keep the session alive.
  
   Our first attempt at a solution was to have a JavaScript
  counter that,
   after every 20 minutes, incremented a counter and if that
  counter ever
   got to 37, we knew that the user hadn't changed web pages
  and we could
   log them out (window.location = logout URL.  The problem
  is that this
   doesn't appear to work either and additionally, it relies
  on JavaScript
   bypassing Tomcat's built-in features.  User's cannot log
  in w/o having
   JavaScript enabled, so it's not a matter of a user
  potentially disabling
   it, rather it puts the onus on the browser to inform the
  server that the
   user's session needs to be expired.
  
   Does anyone have experience in this area and if so, how
  have you solved
   this problem?  I know Google uses AJAX with their Gmail
  webapp, but they
   don't seem to care about not expiring the user's session.  Any help
   would be appreciated.
  
   Thanks,
  
   --adam
  
  
  -
   To start a new topic, e-mail: users@tomcat.apache.org
   To unsubscribe, e-mail: [EMAIL PROTECTED]
   For additional commands, e-mail: [EMAIL PROTECTED]
  
  
  
  
  
 
  -
  To start a new topic, e-mail: users@tomcat.apache.org
  To 

Re: Session expiration and AJAX issues

2008-02-25 Thread Bob Hall

--- 2:09PM Mon 25 Feb 2008 Adam Gordon
[EMAIL PROTECTED] wrote:

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

The server could track the requests and provide an
updated delay time for the timer task if the browser
isn't reliable.

-Bob


  

Looking for last minute shopping deals?  
Find them fast with Yahoo! Search.  
http://tools.search.yahoo.com/newsearch/category.php?category=shopping

-
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: sessionID moves to other PC

2008-02-25 Thread Yuval Perlov

Make sure cookies are enabled. If they are:

There are two options (1) that it is indeed the same session and that  
there is a huge Tomcat bug (2) that these are two separate sessions  
but that you are somehow mixing the data - local bug.


To determine which is it, you could do a toString() on the session  
and print it to the page. If the strings differ, tomcat is doing fine  
and you should check where you mix the variables.


Yuval Perlov
http://www.r-u-on.com/


On Feb 26, 2008, at 5:58 AM, Sascha Monteiro wrote:

Hi,
I am struggeling with securing my pages where private data needs to  
be read from a table.

I am using JSP in Tomcat5.5.23 btw. (which is hosted at eatj.com)

If I login on my page with 2 different userID's, from 2 different  
computers (but sharing a Internet connection..!!!)
I will suddenly see data from the other userID, which is pretty  
sensitive (financial information)


When a user logs in, I am setting the userID and the table to use with
session.setAttribute(usernamers.getString(1));
session.setAttribute(tablenamers.getString(3));

then when I need to query the database, I use
session.getAttribute(tablename);

I have put %=session.getId()% in the head,
and I see the ID appearing, but suddenly changes when navigating  
between pages...  :-(


I hope this makes sense and that someone can help me...
I only found an old bug re duplicateID's, but that was in 2005...

cheers
Sascha



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