Re: Tomcat 9.0.16 Packaging Change (Extras)

2020-03-04 Thread Stephen Hames
Hi Mark,

-Dcom.sun.management.jmxremote.registry.ssl=false solved the problem.

Thanks for that.

Regards,
Stephen

On Wed, 4 Mar 2020 at 18:09, Mark Thomas  wrote:

> On 04/03/2020 06:45, Stephen Hames wrote:
> > Hi Mark,
> >
> > Apologies for the very late reply here.  I had to set the upgrade aside
> > temporarily...
> >
> > Steps to reproduce:
> >
> > server.xml snippet
> >
> >  > className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener"
> > rmiRegistryPortPlatform="10001"
> > rmiServerPortPlatform="10002"
> > />
> >
> > java options:
> > -Dcom.sun.management.jmxremote.ssl=false
> > -Dcom.sun.management.jmxremote.authenticate=true
> > -Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
> > -Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access
> >
> > When I try to connect with valid credentials using Jconsole, the error
> > observed is: non-JRMP server at remote endpoint
> >
> > If I add catalina-jmx-remote.jar from tomcat 9.0.14 to
> $CATALINA_BASE/lib,
> > and restart, I am able to connect without issue.
>
> The refactoring in 9.0.16 introduced an additional configuration
> requirement:
>
> -Dcom.sun.management.jmxremote.registry.ssl=false
>
> I'll get that added to the documentation.
>
> It is worth noting that with current JVMs there is no need for the
> JmxRemoteLifecycleListener at all. All of the configuration options it
> provides are now available via system properties. Details at:
>
>
> https://tomcat.apache.org/tomcat-9.0-doc/monitoring.html#Enabling_JMX_Remote
>
> Mark
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 


This message may
contain confidential and privileged information. If it 
has been sent to you in
error, please reply to advise the sender of the 
error and then immediately
delete this message.


Re: Problem with tomcat connector in IIS using tomcat 9.0.31

2020-03-04 Thread Stephen Hames
Hi Matthias,

I suspect your issue is: address="::"You probably want
address="0.0.0.0" or the ipv4 IP address that your tomcat instance is
listening on.   :: allows any on IPv6, but for IPv4 I suspect that tomcat
would still be listening only on 127.0.0.1

Regards,
Stephen


On Wed, 4 Mar 2020 at 15:20, Matthias Fechner  wrote:

> Dear all,
>
> as tomcat version 9.0.31 has some security fixes included I tried to do
> an upgrade.
> On the IIS tomcat connector version 1.2.46 is installed.
>
> As secret I use a 32 character long alpha numeric string, I name it here
> token.
> In the workers.properties I tried to define it on the load balancer
> line:
> worker.loadbalancer.secret=token
>
> And/or on each node:
> worker.node1.secret=token
> ...
> worker.node2.secret=token
>
> For the tomcat configuration I defined in server.xml the following AJP
> connector:
>   address="::"
> port="8009"
> tomcatAuthentication="false"
> enableLookups="false"
> secret="token"
> redirectPort="8443" />
>
> But it does not work. It seems that tomcat does not answer here.
> If I downgrade to tomcat 9.0.29 it works without any problems.
>
> I started then wireshark and had a look into the traffic coming from the
> IIS.
>  From IIS is see a AJP13 connection with the following content in "Apache
> JServ Protocol v1.3" part in wireshark:
> ...
> Sec-Fetch-User: ?1
> token
> INTERNAL\user
> Negotiate
> ...
>
> as the token is here included the secret configuration is maybe correct.
> The token is here equal to the token define on IIS-tomcat-connector and
> the tomcat server.xml AJP definition.
> Tomcat is sending back a "0:RSP:SEND HEADERS:403 403"
>
> The IIS is doing authentication is is then just sending the user to
> tomcat.
>
> Regarding the documentation everything seems to be configured correctly,
> but it does not work.
> Could anyone help me here, please?
>
> --
> Thanks a lot
> Matthias
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
_
Stephen Hames, Systems Architect & Release Manager
Singapore | +65 6403 5900
CloudPay <https://www.cloudpay.net/>
-- 
_
Stephen Hames, Systems Architect & Release Manager
Singapore | +65 6403 5900
CloudPay <https://www.cloudpay.net/>

-- 


This message may
contain confidential and privileged information. If it 
has been sent to you in
error, please reply to advise the sender of the 
error and then immediately
delete this message.


Re: Tomcat 9.0.16 Packaging Change (Extras)

2020-03-03 Thread Stephen Hames
Hi Mark,

Apologies for the very late reply here.  I had to set the upgrade aside
temporarily...

Steps to reproduce:

server.xml snippet



java options:
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=true
-Dcom.sun.management.jmxremote.password.file=../conf/jmxremote.password
-Dcom.sun.management.jmxremote.access.file=../conf/jmxremote.access

When I try to connect with valid credentials using Jconsole, the error
observed is: non-JRMP server at remote endpoint

If I add catalina-jmx-remote.jar from tomcat 9.0.14 to $CATALINA_BASE/lib,
and restart, I am able to connect without issue.

Worth noting: I am using 9.0.31.

Thanks.

Regards,

Stephen

On Tue, 10 Sep 2019 at 18:36, Mark Thomas  wrote:

> On 10/09/2019 09:41, Stephen Hames wrote:
> > Hi All,
> >
> > After Tomcat 9.0.14, the packaging available for download seems to have
> > changed in that the bin/extras directory has been removed.
> >
> > I am finding a bit of confusion on this.   We use catalina-jmx-remote.jar
> > and previously this was included in the extras directory.
> >
> > I saw an entry in the change log about merging the extras back into core.
> > But am unclear on expected the expected bahaviour now.
> >
> > Is this meant to be that it is no longer necessary to add these jars, or
> > that we need to source them via alternative means?
>
> It should be unnecessary to add the JARs as the classes should be in
> catalina.jar.
>
> > Using tomcat 9.0.22, if I add the catalina-jmx-remote.jar from 9.0.14, it
> > seems to work as normal, but if I don't add the jar, it does not.
>
> Can you share the steps you are following and the test you are using so
> we can see if we can reproduce this. I've checked the build and the
> classes are present in catalina.jar
>
> Thanks,
>
> Mark
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>

-- 
_
Stephen Hames, Systems Architect & Release Manager
Singapore | +65 6403 5900
CloudPay <https://www.cloudpay.net/>

-- 


This message may
contain confidential and privileged information. If it 
has been sent to you in
error, please reply to advise the sender of the 
error and then immediately
delete this message.


Tomcat 9.0.16 Packaging Change (Extras)

2019-09-10 Thread Stephen Hames
Hi All,

After Tomcat 9.0.14, the packaging available for download seems to have
changed in that the bin/extras directory has been removed.

I am finding a bit of confusion on this.   We use catalina-jmx-remote.jar
and previously this was included in the extras directory.

I saw an entry in the change log about merging the extras back into core.
But am unclear on expected the expected bahaviour now.

Is this meant to be that it is no longer necessary to add these jars, or
that we need to source them via alternative means?

Using tomcat 9.0.22, if I add the catalina-jmx-remote.jar from 9.0.14, it
seems to work as normal, but if I don't add the jar, it does not.

Thanks.
Regards,

Stephen

-- 


This message may
contain confidential and privileged information. If it 
has been sent to you in
error, please reply to advise the sender of the 
error and then immediately
delete this message.


Re: URL decoding

2017-04-28 Thread Stephen Crawford

On 4/27/2017 4:52 PM, Christopher Schultz wrote:

When I take your browser-encoded query string from above and send it
to Tomcat, I don't get any errors or anything.

Are you sure this isn't a problem with the application?


Hi Chris,

That happens to me too, in the sense that usually Tomcat throws an error 
or Geoserver throws an error, but in this case nothing happens except 
for the 400 BAD REQUEST.  Nothing in logs of Tomcat or Geoserver.  I 
have not yet tried changing the logging level.


Thanks,
Steve

--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: URL decoding

2017-04-27 Thread Stephen Crawford

On 4/27/2017 2:27 PM, Mark Thomas wrote:

On 27/04/17 17:23, Stephen Crawford wrote:

Hello All,

We are running Tomcat 8.5.13 on Linux, mostly as a container for
Geoserver.  We have a few apps (in Flash!) that have been running fine
untouched for at least six years but stopped working a few weeks ago. I
believe the issue appeared before we upgraded from Tomcat 6.0.24,
probably after a security patch.  For that and other reasons we
upgraded, but the problem persists.

I believe the problem is that a "loose" URL encoding that was previously
being allowed to go through is now being stopped and returning a code
400 Bad Request.  I narrowed down the culprit to this portion of the xml
filter at the end of the url string:



which the browser encodes as:
%3CPropertyIsLike%20wildCard=%22*%22%20escape=%22\%22%20singleChar=%22?%22%3E


Note that the "*", "\" and "?" remain not encoded.  If I replace
(encode) these the request is sent on through.

My question: can I configure Tomcat to return to the the previous
behavior of allowing this request?  I cannot change the Flash apps


I assume that that string is part of the query string. If it was part of
the path I'd be amazed if it ever worked. (I'd expect the '?' to be
treated as the start of the query string.)

The root cause of the tightening of the restrictions was CVE-2016-6816.

Looking at the code, the '*' and the '?' should be OK. It is the '\'
that is problematic.

(Note: If the specification for the query string was enforced, '?' would
be problematic as well.)

8.5.x and earlier allow the restrictions for some invalid characters to
be lifted. '\' is not among them.

Generally '\' is problematic because it will be treated as a path
separator on some platforms but not on others. That has led to security
vulnerabilities in the past when attackers put \..\ in the URL to bypass
security restrictions. I'm a little surprised Tomcat allowed it before
CVE-2016-6816 was fixed but digging into the code we have a check for
that in the path (which confirms my suspicion the string in question is
in the query string).

To get to your question, it is not currently possible to configure
Tomcat to allow this.

Possible options are:

1. Find a way to fix the flash app.

2. Convince the Tomcat developers to validate the path and query string
segments separately and be (optionally) more lenient with the query string.

3. Use a reverse proxy in front of Tomcat and encode the query string
properly before passing it to Tomcat.


1. is the 'right' solution. After all the client is not specification
compliant.

2. is unlikely. More sophisticated validation will have a performance
impact and the trend has been for Tomcat to be more stringent with
respect to spec compliance, not less.

3. is likely the simplest. Until the proxies implement more stringent
rules for much the same reason as Tomcat did (CVE-2016-6816).

I suspect this isn.t what you wanted to hear. Sorry.

Mark


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Thanks for such a thorough answer; not what I wanted to hear but mostly 
expected.  Seven years was a pretty good run. Now to see if the client 
has the $$ for the HTML5 version



--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



URL decoding

2017-04-27 Thread Stephen Crawford

Hello All,

We are running Tomcat 8.5.13 on Linux, mostly as a container for 
Geoserver.  We have a few apps (in Flash!) that have been running fine 
untouched for at least six years but stopped working a few weeks ago. I 
believe the issue appeared before we upgraded from Tomcat 6.0.24, 
probably after a security patch.  For that and other reasons we 
upgraded, but the problem persists.


I believe the problem is that a "loose" URL encoding that was previously 
being allowed to go through is now being stopped and returning a code 
400 Bad Request.  I narrowed down the culprit to this portion of the xml 
filter at the end of the url string:




which the browser encodes as:
%3CPropertyIsLike%20wildCard=%22*%22%20escape=%22\%22%20singleChar=%22?%22%3E

Note that the "*", "\" and "?" remain not encoded.  If I replace 
(encode) these the request is sent on through.


My question: can I configure Tomcat to return to the the previous 
behavior of allowing this request?  I cannot change the Flash apps


Thanks,
Steve


--
Stephen Crawford
Center for Environmental Informatics
The Pennsylvania State University
src...@psu.edu


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: tomcat 7.0.40 - http sessions not expiring

2016-06-04 Thread Stephen Bhadran
Hi Chris,
Thanks for the help. I don't see any OOME around this time.

Before restarting I collected the heap and thread dumps. Looking at one of
the thread dumps, I see the ContainerBackgroundProcessor (below). So looks
like that thread didn't die entirely, may be it just stopped working ?

*"ContainerBackgroundProcessor[StandardEngine[Catalina]]" daemon prio=10
tid=0x7fd000a5d800 nid=0x9be5 waiting on condition [0x7fcfc4955000]*
*   java.lang.Thread.State: TIMED_WAITING (sleeping)*
* at java.lang.Thread.sleep(Native Method)*
* at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1508)*
* at java.lang.Thread.run(Thread.java:745)*

*   Locked ownable synchronizers:*
* - None*

- I have attached a screenshot of the StandardManager runtime attributes
from the heapdump. Is there anything anyone can see wrong here?
- Is there anything else I can look for in the heapdump and threaddump?


[image: Inline image 1]



thanks,
Stephen





On Fri, Jun 3, 2016 at 5:57 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
>
> Stephen,
>
> On 6/3/16 8:47 PM, Stephen Bhadran wrote:
> > *Linux version:*  2.6.32-279.5.2.el6.x86_64 (
> > mockbu...@c6b10.bsys.dev.centos.org) (gcc version 4.4.6 20120305
> > (Red Hat 4.4.6-4) (GCC) ) *Java Version:  *1.7.0_55 *Tomcat
> > Version: *7.0.40 *Session Timeout: *30 minutes
> >
> > Hi, Two of our servers reached max heap and we had to restart to
> > resolve the issue.
> >
> > In troubleshooting, we noticed Http Sessions had stopped expiring
> > 05/12th and reached 25K over a period of 11 days. I noticed the
> > same behavior in both servers, the session expiration seem to have
> > stopped on both of them around the same time. I'm saying this
> > because from looking at the monitoring graphs (NewRelic) I notice
> > the http sessions starting to climb on both servers around the same
> > time frame.
> >
> > I am thinking, the issue could be two folds: #1 - The session
> > expiration stopped working -OR #2 - The sessions themselves were
> > created with TTLs way into the future
> >
> > I suspected #1. I looked that tomcat 7.0.40 source code, extracted
> > all session/manager error messages and searched for them in the
> > logs and didn't find any hits. I was hoping to find something about
> > "Session expiration stopped working", but didn't find any.
> >
> > Can you please advise how to troubleshoot this issue? I'd very
> > much appreciate the help.
>
> Were there any errors around the 12th? I've found that in rare cases,
> the server hits an OOME while the BackgroundProcessor thread is
> running, which kills the BackgroundProcessor.
>
> Guess which thread is responsible for triggering the session-cleaner?
>
> If the BackgroundProcessor died, it should have dumped an error to a
> log file. As I said, it's pretty rare, but it does happen and then
> it's only a matter of time before your sessions bust your heap.
>
> You can manually-trigger the session-cleaner via JMX of you absolutely
> have to, but I'd personally prefer to bounce a Tomcat instance in that
> case.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
>
> iQIcBAEBCAAGBQJXUid5AAoJEBzwKT+lPKRYJfYQAKA2ditjB7B2vLbm0po83Tr0
> YD2EjqLBrF4O/3Wu6enIDRAQEIGgXmTr2bgPlMvu+6aoDopiCSKltRxWQFlTMyIP
> 8ura/0YlS5sX3yGPPKN5nrZnOz2dvrgPncHLNVfuM9BEm+8QZPeKNZVDhMH53m1v
> 4YcLCM5IjswAS4FrVeG9A0gcZplBd53WUuypnRYQMUcS1sACdItoZ3TLAwb/WBg/
> T9yoyftEXJVtP6lovkaWka3yw3v382P6HmSV6/TtCWjogB/tBdCsEPmGEQ0j7k8y
> 9dLmmTBawDdckaxiGf1M1M/5R+f7XqU4e02Dnhk9v4umysmu5EH+VQFO4kfi5qX+
> DvaoS13lluyN1LGMyuwHkYFHXxlgZhR/XAW9Cn/0D/NDCQks6lHG9Sby+T/kvLSO
> YNSBV78SX9wsJ/fH9MxrcTarxyUYsxnHdNkcarkmcrQIkhda/vBXQobXpYVL9poR
> HmxNGNOujCTojqPJzlpgAaUVUq6pEUcN3u1vkCqXNQGVo983PHz2JhfEBGYihKBk
> icbuFxfIy2Dv6KwuPPMV9Y7nVRNVBrVEpieZuAc7Sj9/U3kUgPUznUSbRFUCnGd1
> YI/kq9rn/qj/aqhaJdMF0Ci4+ieJMorKNUE1PWOjbnya8XoyBxXfPd5iV6n7elEw
> V6qNyO6n46isrAiVEu5c
> =MyIX
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


tomcat 7.0.40 - http sessions not expiring

2016-06-03 Thread Stephen Bhadran
*Linux version:*  2.6.32-279.5.2.el6.x86_64 (
mockbu...@c6b10.bsys.dev.centos.org) (gcc version 4.4.6 20120305 (Red Hat
4.4.6-4) (GCC) )
*Java Version:  *1.7.0_55
*Tomcat Version: *7.0.40
*Session Timeout: *30 minutes

Hi,
Two of our servers reached max heap and we had to restart to resolve the
issue.

In troubleshooting, we noticed Http Sessions had stopped expiring 05/12th
and reached 25K over a period of 11 days. I noticed the same behavior in
both servers, the session expiration seem to have stopped on both of them
around the same time. I'm saying this because from looking at the
monitoring graphs (NewRelic) I notice the http sessions starting to climb
on both servers around the same time frame.

I am thinking, the issue could be two folds:
#1 - The session expiration stopped working -OR
#2 - The sessions themselves were created with TTLs way into the future

I suspected #1. I looked that tomcat 7.0.40 source code, extracted all
session/manager error messages and searched for them in the logs and didn't
find any hits. I was hoping to find something about "Session expiration
stopped working", but didn't find any.

Can you please advise how to troubleshoot this issue? I'd very much
appreciate the help.

thanks,
Stephen


Re: Does Tomcat support clustering for automatic fail over?

2015-11-05 Thread Stephen Booth


On 04/11/2015 00:56, javier_esp...@hna.honda.com wrote:
> I would like to setup a couple of servers for automatic fail-over.  In case
> one fails the other can take over.  Does Tomcat support that kind of setup?
> If so, can you direct me to where I can find some documentation about it?

As others have commented fail-over is usually handled by the
load-balancer but that still leaves the problem of the load-balancer as
a single point of failure.

One trick is to use CARP
https://en.wikipedia.org/wiki/Common_Address_Redundancy_Protocol
to fail over between servers. In the freely available linux
implementations this is not a substitute for a load balancer because
only one server is active at a time. Strictly speaking this is
redundancy of hosts not processes carp won't help you if the tomcat
process dies but the node stays up.

The actual configuration we use is to have redundant apache servers with
an ip address that fails over via CARP and then use apache as a load
balancer to access the tomcat nodes.
We don't really have the level of traffic to need a load-balancer but
putting in fail-over at every level of the software stack reduces
exposure to losing a process it also makes it easier to do work on the
tomcat processes while keeping the service live.

        Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Making fail-over work with PermGen errors

2015-11-05 Thread Stephen Booth


On 04/11/2015 19:59, Christopher Schultz wrote:
> Memory-related errors are always problematic.
> 
> Do you have any instrumentation/monitoring to check the liveness of your
> Tomcat nodes? Can it detect the OOME condition? If so, you should be
> able to notify the load-balancer that something had gone wrong. I'm
> unsure of how to do it with mod_proxy_ajp, but mod_jk can be
> re-configured externally e.g. by calling curl with a specially-crafted
> URL[1].

Yes I think thats the route we are going to go down. Actually
re-analysing the problem I think the load balancer might have
successfully failed over but because the dead node was not noticed it
hung around in a blocked state until the node was needed.

    Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Making fail-over work with PermGen errors

2015-11-03 Thread Stephen Booth
Does anyone have any advice about how to make fail-over work more
cleanly with PermGen errors (other than the obvious one of not letting
PermGen errors occur)

I'm using apache ModProxy to connect to tomcat over ajp with additional
hot-spare servers confgured for fail-over but if I mess up and let the
jvm run out of PermGen space then tomcat seems to stay alive enough to
prevent fail-over but not enough to actually serve any content.


Stephen

-- 
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat occasionally duplicating responses

2015-05-18 Thread Stephen Dawkins
On Mon, May 18, 2015 at 12:30 PM, Mark Thomas ma...@apache.org wrote:
 Thanks. That rules out some possibilities for application error.

 When you get two threads writing to the response, if would be useful to
 know which of the following those threads are:
 - the Tomcat thread that handled the original request
 - the application thread that wrote the response
 - the Tomcat thread that the application dispatched to once the async
   processing completed

Here's what I've found:

PID
15302 initial request received, initial application processing and
request sent to a remote server asynchornously
15305 received response from remote server, more application processing
15305 HTTP response sent
15302 additional HTTP response sent, eventually fails with Broken Pipe

 Mark


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat occasionally duplicating responses

2015-05-18 Thread Stephen Dawkins
On Mon, May 18, 2015 at 2:24 PM, Mark Thomas ma...@apache.org wrote:
 On 18/05/2015 13:40, Stephen Dawkins wrote:
 On Mon, May 18, 2015 at 12:30 PM, Mark Thomas ma...@apache.org wrote:

 Bingo.

 I think I have found the problem (well, a problem anyway). It looks like
 there is a bug in javamelody.

 Once a request/response has been put into async mode, control passes to
 the async processing. i.e. from that point onwards the container should
 not be writing to the response until the application returns control to
 the container via a dispatch.

 If you look at the this line of code [1], javamelody is flushing the
 response. There needs to be an if (!request.isAsyncStarted()) {...}
 around that code.

I'll try adding this code and see if that resolves the issue.

 Also, looking at the various Response wrapper classes, none of them use
 syncs / or volatile. Since control is passing between threads there is
 the possibility of stale values being observed in the new thread. In my
 experience actually seeing a stale value is pretty rare but it could happen.

I can look into these once I can actually enable javamelody without
breaking anything.

Thanks for you help in this matter.

Regards
Stephen

 HTH,

 Mark

 [1]
 https://code.google.com/p/javamelody/source/browse/trunk/javamelody-core/src/main/java/net/bull/javamelody/MonitoringFilter.java#199


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat occasionally duplicating responses

2015-05-18 Thread Stephen Dawkins
Hi

I have an application that uses embedded Tomcat (8.0.22) to serve SOAP
services. I've recently attempted to add javamelody[1] to the app to gather
some stats, however I've run into an issue where occasionally the response
is incorrect, mostly it just duplicates response, although sometimes it's
not a valid HTTP response. I can only seem to reproduce this on a Linux box
(which is running Fedora 19), my Windows machine doesn't appear to have the
same issue.

I've confirmed that the application code is only sending the response once,
and the error only occurs when using the javamelody servlet filter.
However, investigating the filter didn't reveal anything obvious that would
cause the problem (it just collects the amount of bytes sent). It does
override the flushBuffer method in the class it uses to wrap the
HttpServletResponse, but I get the same error even when I don't explicitly
call that method from the application code.

The client I'm using to test with just uses Apache CXF to send one request
at a time to the server. Interestingly I couldn't seem to reproduce it when
I increased the amount of threads that the client was using, however it's
not the most reliable error to reproduce with just a single thread.

I've tried setting breakpoints in various places in the application,
javamelody and Tomcat, but I couldn't get any useful information out of it
(since I'm having to debug remotely, the conditional breakpoints are slow
enough to make reproducing it extremely difficult), and I'm not entirely
certain where the issue is. The only information I've managed to glean is
from using strace to capture the syscalls:

pid   timestamp   syscall
32189 16:19:34.330576 write(118, HTTP/1.1 200 OK\r\nServer:
Apache-Coyote/1.1..., 149) = 149
32189 16:19:34.331728 write(118, 51e\r\n, 5) = 5
32189 16:19:34.332788 write(118, ?xml version=\1.0\
encoding=\UTF-8\..., 1310) = 1310
32189 16:19:34.335779 write(118, \r\n, 2) = 2
32216 16:19:34.336863 write(118, 51e\r\n, 5) = 5
32216 16:19:34.337734 write(118, ?xml version=\1.0\
encoding=\UTF-8\..., 1310) = 1310
32216 16:19:34.344520 write(118, \r\n, 2) = 2
32200 16:19:34.346986 write(118, 0\r\n\r\n, 5) = 5

The pid column is the most interesting. This shows that there are 2
separate threads sending the same response to the client, which doesn't
seem right. Occasionally, I get a slightly different error in the client
(the above response just produces an XML parse error):

32201 16:17:29.592419 write(161, HTTP/1.1 200 OK\r\nServer:
Apache-Coyote/1.1..., 149) = 149
32201 16:17:29.593717 write(161, 51e\r\n, 5) = 5
32201 16:17:29.594848 write(161, ?xml version=\1.0\
encoding=\UTF-8\..., 1310) = 1310
32235 16:17:29.597871 write(161, 51e\r\n, 5) = 5
32235 16:17:29.603263 write(161, ?xml version=\1.0\
encoding=\UTF-8\..., 1310) = 1310
32235 16:17:29.603977 write(161, \r\n, 2) = 2
32201 16:17:29.605333 write(161, \r\n, 2) = 2
32216 16:17:29.608646 write(161, 0\r\n\r\n, 5) = -1 EPIPE (Broken pipe)

This produces the following error:

java.io.IOException: missing CR
at
sun.net.www.http.ChunkedInputStream.processRaw(ChunkedInputStream.java:405)
at
sun.net.www.http.ChunkedInputStream.readAheadBlocking(ChunkedInputStream.java:572)
...

Again, 2 separate threads, but this time interleaved in a way that's
invalid.

While I'm happy enough to fix any issue in javamelody if that is what is
causing it, I'm very concerned that it's uncovered a latent issue in Tomcat.

Does anyone have any suggestions as to where the issue could be?

[1] https://code.google.com/p/javamelody/

Thanks  Regards
Stephen


Re: Tomcat occasionally duplicating responses

2015-05-18 Thread Stephen Dawkins
On Mon, May 18, 2015 at 11:22 AM, Mark Thomas ma...@apache.org wrote:
 On 18/05/2015 10:31, Stephen Dawkins wrote:

 Tomcat will call flushBuffer() internally.

 Tomcat does re-use Request/Response objects so if a reference is
 accidentally retained to one of them you can see this issue.

 Try using:
 org.apache.catalina.connector.RECYCLE_FACADES=true

 (not the best named attribute but true will cause a new facade to be
 created for every request/response).

I will test with that property set.

 Are those both Java threads from the same JVM?
Yes, they're both from the same JVM.


 Can you correlate seeing multiple threads with the error occurring?

Most of the time, a response is written by just one thread.
Occasionally the last 0\r\n\r\n is written by a different thread to
the one that writes the bulk of the response.


 Unlikely but possible to be a Tomcat issue with the information we have
 so far.

 Does anyone have any suggestions as to where the issue could be?

 Are you using any Servlet 3.0 async features?

Yes, I have async enabled for the filter and the servlet that
processes the request, and the application will likely use a different
thread to response than processes the request.

 Mark


 [1] https://code.google.com/p/javamelody/

 Thanks  Regards
 Stephen



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat occasionally duplicating responses

2015-05-18 Thread Stephen Dawkins
On Mon, May 18, 2015 at 12:00 PM, Mark Thomas ma...@apache.org wrote:
 On 18/05/2015 11:50, Stephen Dawkins wrote:
 On Mon, May 18, 2015 at 11:22 AM, Mark Thomas ma...@apache.org wrote:
 On 18/05/2015 10:31, Stephen Dawkins wrote:
 Does anyone have any suggestions as to where the issue could be?

 Are you using any Servlet 3.0 async features?

 Yes, I have async enabled for the filter and the servlet that
 processes the request, and the application will likely use a different
 thread to response than processes the request.

 OK. Is Javamelody async aware? In particular I am wondering if it
 correctly handles the case where Servlet.service() returns after
 startAsync() but the app hasn't written any of / all of the response yet.

 If javamelody is wrapping the response it is going to need to handle the
 async case correctly.

The documentation does say to add the relevant option to the web.xml
if you require async-support.

https://code.google.com/p/javamelody/wiki/UserGuide#2._web.xml_file

Also, I've tested with the
org.apache.catalina.connector.RECYCLE_FACADES=true option set, and the
error still occurs.

Regards
Stephen

 Mark



 Mark


 [1] https://code.google.com/p/javamelody/

 Thanks  Regards
 Stephen



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org



 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Question on Http11AprProcessor Error parsing HTTP request header error messages

2015-03-05 Thread Owens, Stephen (ITD)
  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8 
--=
2015-03-05 13:41:20,768 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8  
 authType=null
2015-03-05 13:41:20,768 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8
contentType=text/html;charset=UTF-8
2015-03-05 13:41:20,769 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8 
remoteUser=null
2015-03-05 13:41:20,769 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8  
   status=200
2015-03-05 13:41:20,769 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8 END TIME 
 =05-Mar-2015 13:41:20
2015-03-05 13:41:20,769 [http-apr-50881-exec-8] INFO  
org.apache.catalina.filters.RequestDumperFilter- http-apr-50881-exec-8 
===
2015-03-05 13:41:20,781 [http-apr-50881-exec-8] DEBUG 
org.apache.coyote.http11.Http11AprProtocol- Socket: 
[org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@1ce9af7:41253648], 
Status in: [OPEN_READ], State out: [OPEN]
2015-03-05 13:41:20,977 [http-apr-50881-exec-6] DEBUG 
org.apache.coyote.http11.Http11AprProcessor- Error parsing HTTP request header
java.io.EOFException: Unexpected EOF read on the socket
at 
org.apache.coyote.http11.InternalAprInputBuffer.parseRequestLine(InternalAprInputBuffer.java:141)
at 
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1000)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
at 
org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:285)
at 
org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:2376)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
2015-03-05 13:41:20,977 [http-apr-50881-exec-6] DEBUG 
org.apache.coyote.http11.Http11AprProtocol- Socket: 
[org.apache.tomcat.util.net.AprEndpoint$AprSocketWrapper@3ef766eb:37493472], 
Status in: [OPEN_READ], State out: [CLOSED]

Are the DEBUG org.apache.coyote.http11.Http11AprProcessor- Error parsing HTTP 
request header signs of a problem or just messages popping up because the log4j 
level is DEBUG?

Thanks,

Stephen R. Owens
Senior Software Engineer
Massachusetts Office of Information Technology
Commonwealth of Massachusetts
One Ashburton Place, Room 1601
Boston, MA 02108
Tel:   617-626-4513
Email: stephen.ow...@state.ma.usmailto:stephen.ow...@state.ma.us



Tomcat 8, Log4j, setting environment variables in setenv.sh

2015-02-25 Thread Owens, Stephen (ITD)
Hello,

For tomcat 8 using log4j and apache commons logging, what would be the correct 
values to specify in setenv.sh for:
LOGGING_MANAGER
LOGGING_CONFIG

For a tomcat-7.0.26 installation, the values in setenv.sh were:
export LOGGING_CONFIG=-Dlog4j.configuration=log4j.properties
export 
LOGGING_MANAGER=-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

Are those the correct values for Tomcat 8 as well?

Thanks,

Stephen R. Owens
Email: stephen.ow...@state.ma.usmailto:stephen.ow...@state.ma.us



Re: Session Config = Tracking Mode not working

2014-11-18 Thread Stephen McCants
Hello Konstantin Kolinko,

I fixed my dumb web.xml schema declaration.  Thanks for pointing that out.

I also added the COOKIE tracking mode to the example servlet and it worked 
there (the URL encoded link did not contain the JSESSIONID).

So, next I turned on logEffectiveWebXml=true and verified that the effective 
web.xml for both of my wars contains:

  session-config
session-timeout30/session-timeout
cookie-config
/cookie-config
tracking-modeCOOKIE/tracking-mode
  /session-config

But the first time I hit the web app, I'm still getting JSESSIONID in the URL.  

Then I turned on Strict Compliance to wring out any other errors in my web.xml 
that might be causing the problem.   It found some problems in the Tag
Library tld files and fixed those, but that had no effect on JSESSIONID in the 
URL.  I have no further errors in Catalina log or any other logs files.

At this point, I'm not sure what else I should try to debug the problem.

Any suggestions would be appreciated.

Sincerely,
Stephen McCants

On Tue, 18 Nov 2014 03:17:27 +0300
Konstantin Kolinko knst.koli...@gmail.com wrote:

 2014-11-18 2:49 GMT+03:00 Stephen McCants stephen.mcca...@hcs.us.com:
  Hello,
 
  I'm trying to remove the JSESSIONID from my URL the first time someone hits 
  my Tomcat Web App, but I've not been able to get it working for some
  reason that eludes me.  This is under Tomcat 7.0.37 and Tomcat 7.0.56.
 
  First thing I tried was to add session-config/tracking mode to my web.xml, 
  resulting in:
 
  ?xml version=1.0 encoding=ISO-8859-1?
  !DOCTYPE web-app PUBLIC
 -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN
 http://java.sun.com/dtd/web-app_2_3.dtd;
  web-app xmlns=http://java.sun.com/xml/ns/javaee;
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
  xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
  version=3.0
 
 You are declaring both 2.3 DTD and 3.0 schema.
 Choose one.
 
 There exists a system property that turns on strict servlet
 compliance mode. If you use it, it enables validation of your web.xml
 and will catch silly errors like this one.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Specification
 
  session-config
  tracking-modeCOOKIE/tracking-mode
  /session-config
 
 If I add the above three lines to the web.xml of examples webapp, it
 works for me.
 
 http://localhost:8080/examples/servlets/servlet/SessionExample
 On the first visit to that example page look at URL encoded link at
 the bottom of the page, whether it contains jsessionid in it or not.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



--
Stephen McCants
Senior Software Engineer
Healthcare Control Systems, Inc.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: isELIgnored default is wrong

2014-11-18 Thread Stephen McCants
Hello Konstantin Kolinko,

Thank you for the useful debugging tips.  By setting the server in Strict 
Compliance, I found some problems with our TLD declarations.  After fixing
that, isELIgnored has the default of true, as expected.

Thanks again!

Sincerely,
Stephen McCants

On Sat, 8 Nov 2014 17:08:46 +0300
Konstantin Kolinko knst.koli...@gmail.com wrote:

  I worked around the problem by adding the following to the JSP
  files:
 
  %@ page isELIgnored=false %
 
  However, I'd like to understand where the configuration error is
  occurring as from my perspective nothing changed except OS and
  Tomcat version.  My own efforts have turned up nothing helpful or
  illuminating.
 
  Where should I be looking in the configurations for a difference?
  What differences would come into play?
 
  What is your tag library declaration in your JSP file? That's probably
  the most important thing, here. Are you supplying your own version of
  JSTL, EL, etc. along with your web application?
 
 
 +1. There have been several user reports when Apache Maven packed
 conflicting API implementation jars into a war file. I do not remember
 it resulting in such symptoms, but things were going awry for those
 affected.
 
 I would suggest trying the following:
 
 1) Add logEffectiveWebXml=true to your Context and see how that
 web.xml is actually interpreted by Tomcat (considering all web
 fragments and annotations)
 http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
 
 2) Run in strict servlet compliance mode. That will enable
 validation of your web.xml against schema.
 
 http://tomcat.apache.org/tomcat-7.0-doc/config/systemprops.html#Specification
 
 3) Are there any errors, warnings in the log files?
 
 
 If that does not help, then maybe
 a) inspect the java code generated for your JSPs
 
 b) run with a debugger
 https://wiki.apache.org/tomcat/FAQ/Developing#Debugging
 
 c) try with 7.0.42 on Windows, and then with intermediate versions up
 to 7.0.56 to see when the problem appeared.
 
 d) test with 7.0.57 (a release candidate is currently in the voting
 process on dev@)
 
 e) simplify your web application until you have a reproducible test
 case that you can show others
 
 The examples webapp has EL on its pages and those are certainly working.
 
 f) update you web.xml to version 3.0 and configure it to avoid
 annotation scanning
 https://wiki.apache.org/tomcat/HowTo/FasterStartUp
 
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



--
Stephen McCants
Senior Software Engineer
Healthcare Control Systems, Inc.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session Config = Tracking Mode not working

2014-11-18 Thread Stephen McCants
Spent sometime in the debugger and it is Shiro that is appending the JSESSIONID 
on a redirect if the session cookie hasn't been set yet.

So, now I'm off to figure out how to turn it off in Shiro.

Thanks again for your help!

Sincerely,
Stephen McCants

On Wed, 19 Nov 2014 01:51:53 +0300
Konstantin Kolinko knst.koli...@gmail.com wrote:

 2014-11-19 0:53 GMT+03:00 Konstantin Kolinko knst.koli...@gmail.com:
  2014-11-19 0:21 GMT+03:00 Stephen McCants stephen.mcca...@hcs.us.com:
  Hello Konstantin Kolinko,
 
  I fixed my dumb web.xml schema declaration.  Thanks for pointing that out.
 
  I also added the COOKIE tracking mode to the example servlet and it worked 
  there (the URL encoded link did not contain the JSESSIONID).
 
  So, next I turned on logEffectiveWebXml=true and verified that the 
  effective web.xml for both of my wars contains:
 
session-config
  session-timeout30/session-timeout
  cookie-config
  /cookie-config
  tracking-modeCOOKIE/tracking-mode
/session-config
 
  But the first time I hit the web app, I'm still getting JSESSIONID in the 
  URL.
 
  Then I turned on Strict Compliance to wring out any other errors in my 
  web.xml that might be causing the problem.   It found some problems in
  the Tag Library tld files and fixed those, but that had no effect on 
  JSESSIONID in the URL.  I have no further errors in Catalina log or any
  other logs files.
 
  At this point, I'm not sure what else I should try to debug the problem.
 
  Any suggestions would be appreciated.
 
 
  a) Run with a debugger
  https://wiki.apache.org/tomcat/FAQ/Developing#Debugging
 
  Possible points:
  org.apache.catalina.connector.Response.encodeURL()
  org.apache.catalina.connector.Response.encodeRedirectURL()
  org.apache.catalina.connector.CoyoteAdapter.service()
 
 Also:
 org.apache.catalina.session.StandardSession.getId().
 
 It is the actual Id that is being printed as jsessionid there. It
 shall be read using that method. If debugging is hard,  adding some
 logging with some stacktraces and recompiling can help.
 
 
  b) Simplify your web application
  until it becomes a simple example that can be reproduced by someone else.
 
  c)
  But the first time I hit the web app
 
  Is that first time response actually served by your web app, or by
  some other (e.g. ROOT)?
 
  Best regards,
  Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 



--
Stephen McCants
Senior Software Engineer
Healthcare Control Systems, Inc.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Session Config = Tracking Mode not working

2014-11-17 Thread Stephen McCants
Hello,

I'm trying to remove the JSESSIONID from my URL the first time someone hits my 
Tomcat Web App, but I've not been able to get it working for some
reason that eludes me.  This is under Tomcat 7.0.37 and Tomcat 7.0.56.

First thing I tried was to add session-config/tracking mode to my web.xml, 
resulting in:

?xml version=1.0 encoding=ISO-8859-1?  
!DOCTYPE web-app PUBLIC  
   -//Sun Microsystems, Inc.//DTD Web Application 2.3//EN  
   http://java.sun.com/dtd/web-app_2_3.dtd;  
web-app xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd;
version=3.0  

session-config
tracking-modeCOOKIE/tracking-mode
/session-config



However, that didn't seem to have any effect, so next I setting it in the 
default /conf/web.xml:

session-config
session-timeout30/session-timeout
!-- Disable writing the session cookie on the URL --
tracking-modeCOOKIE/tracking-mode
/session-config

This to had no effect.  I also found no error messages in the logs and didn't 
turn up anything helpful on Google, so I'm at a loss as to why this
isn't working.

On our production server, we are using mod_rewrite and Apache to strip it out 
of the URL, so the user never sees it, but I'm needing to do some
testing on a local system and would rather not have the complication of Apache 
present.  Some of the software running tests is getting confused by
the JSESSIONID on the URL the first time it hits our login page, so it doesn't 
recognize the login page.

Thoughts as to where I might have gone wrong?

Thanks in advance.

Sincerely,
Stephen


--
Stephen McCants
Senior Software Engineer
Healthcare Control Systems, Inc.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: isELIgnored default is wrong

2014-11-17 Thread Stephen McCants
Hello Christopher Schultz, 

Sorry for the delayed reply.

 On 11/7/14 2:51 PM, Stephen McCants wrote:
  I'm seeing a strange problem where isELIgnored has the wrong
  default value for a new Tomcat install of 5.0.56.
 
 That version number is certainly wrong.
 Highest 5.0 version is 5.0.30
 Highest 5.5 version is 5.5.36
 
 Hopefully, you meant Tomcat 7.0.56 which is the most current release
 of Tomcat 7.0.

Sorry, typo.  7.0.56 is correct.

 
  I'm moving a Web Application on Windows 7 to Windows 2008 and that 
  caused the EL expressions to stop being evaluated on the new
  install..
  
  Problem is only seen on Windows Server 2008 with Tomcat 7.0.56,
  while it works correctly on Tomcat 7.0.37 (Windows 7) and 7.0.42
  (Linux).  The web application is the same on all three servers.
  
  Our web.xml file specifies:
  
  web-app xmlns=http://java.sun.com/xml/ns/javaee; 
  xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
  xsi:schemaLocation=http://java.sun.com/xml/ns/javaee 
  http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5
  
  So, I believe the correct behavior with 2.5 is that EL expressions 
  should be evaluated.
 
 Note that the various EGs have made it clear that in many cases, your
 descriptor's version number is irrelevant: the server will provide the
 behavior of the most-recent version of the spec that the server
 supports. (The Servlet EG and I differ on whether this is appropriate.)

Interesting and good to know.

 
  I worked around the problem by adding the following to the JSP
  files:
  
  %@ page isELIgnored=false %
  
  However, I'd like to understand where the configuration error is 
  occurring as from my perspective nothing changed except OS and
  Tomcat version.  My own efforts have turned up nothing helpful or 
  illuminating.
  
  Where should I be looking in the configurations for a difference?
  What differences would come into play?
 
 What is your tag library declaration in your JSP file? That's probably
 the most important thing, here. 

Here is the top of the header.jsp file that is included by most (all?) of our 
JSP pages:

!-- Header shared by a number of pages --
%@ page import=com.hcs.webtl.servlet.ScheduleBase %
%@ page import=com.hcs.webtl.util.CookieUtil %
%@ page import=com.hcs.webtl.util.WTLUtilities %
%@ page import=com.hcs.webtl.shiro.util.WebTimelineShiroUtilities %
%@ page import=com.hcs.webtl.filter.LegacyFilter %
%@ page import=com.hcs.data.dao.util.SiteAndFacility %
%@ page import=com.hcs.data.dao.util.DAOUtils %
%@ page import=com.hcs.data.dao.beans.Hostmap %
%@ page import=com.hcs.util.OAUtilities %
%@ page import=java.util.List %
%@ page isELIgnored=false % %-- This fixes misbehaving versions of Tomcat 
that like to turn of EL (Expression Evaluation) --%
%--%@ taglib prefix=shiro uri=/WEB-INF/lib/shiro-web-1.2.2.jar %--%
%@ taglib prefix=shiro uri=http://shiro.apache.org/tags; %
%--%@ taglib prefix=shiro 
uri=/WEB-INF/lib/shiro-web-1.2.2.jar/META-INF/shiro.tld %--%
%@ taglib prefix=sfp uri=/WEB-INF/SiteFacilityPermission.tld%
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn %

Obviously, I've already added the isELIgnored option to work around the problem 
for the time being.  A sample page that includes this starts with:

%@ taglib prefix=shiro uri=http://shiro.apache.org/tags; %
%@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c %
%@ taglib uri=http://java.sun.com/jsp/jstl/functions; prefix=fn %
%@ page import=com.hcs.data.dao.beans.Hostmap %
%@ page import=com.hcs.data.dao.util.DAOUtils %
!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html
c:set  var=j_username value=${param.j_username} /
shiro:user
meta http-equiv=refresh content=0;URL='/redirect' /
/shiro:user
shiro:guest
head
titleLogin/title
script src=lib/jquery-1.7.2.min.js/script !-- Need JQuery to 
let us manipulate some text. --
link rel=stylesheet type=text/css href=style/header.css/
meta name=viewport id=iphone-viewport content=width=380 
/
/head
body
%@ include file=header.jsp %
.

I'm assuming including taglib tags inside the body is fine, since that is JSP 
vs. HTML.

 Are you supplying your own version of
 JSTL, EL, etc. along with your web application?

In the tomcat/lib directory, we've linked in (common to our Web Applications):

encorder-1.1.jar
jcl-over-slf4j-1.7.5.jar
jstl-1.2.jar
jul-to-slf4j-1.7.5.jar
log4j-over-slf4j-1.7.5.jar
logback-access-1.0.13.jar
logback-classic-1.0.13.jar
logback-core-1.0.13.jar
mail.jar
mysql-connector-java-5.1.21-bin.jar

Inside our Web App WEB-INF/lib we provide so of our own libraries and:

tomcat-jdbc.jar
tomcat-juli.jar
shiro-*-1.2.2.jar
org.json.jar
org.restlet.*.jar
commons-beanutils-1.8.3.jar
commons-collections-3.1.jar

I don't believe we've introduced any conflicts, but I could

isELIgnored default is wrong

2014-11-07 Thread Stephen McCants
Hello All,

I'm seeing a strange problem where isELIgnored has the wrong default
value for a new Tomcat install of 5.0.56.

I'm moving a Web Application on Windows 7 to Windows 2008 and that
caused the EL expressions to stop being evaluated on the new install..  

Problem is only seen on Windows Server 2008 with Tomcat 7.0.56, while it
works correctly on Tomcat 7.0.37 (Windows 7) and 7.0.42 (Linux).  The
web application is the same on all three servers.  

Our web.xml file specifies:

web-app
xmlns=http://java.sun.com/xml/ns/javaee;
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
xsi:schemaLocation=http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd; version=2.5 

So, I believe the correct behavior with 2.5 is that EL expressions
should be evaluated.

I worked around the problem by adding the following to
the JSP files:

%@ page isELIgnored=false %

However, I'd like to understand where the configuration error is
occurring as from my perspective nothing changed except OS and Tomcat
version.  My own efforts have turned up nothing helpful or
illuminating.  

Where should I be looking in the configurations for a difference?  What
differences would come into play?

BTW, other people apparently have run into this problem:

See answer and comments on
http://stackoverflow.com/questions/793983/jsp-el-expression-is-not-evaluated .

Thanks in advance.

Sincerely,
Stephen McCants


Stephen McCants
Senior Software Engineer
Healthcare Control Systems, Inc.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: So You Want High Performance ( cont )

2013-10-25 Thread Stephen More
On Fri, Oct 25, 2013 at 5:14 AM, Felix Schumacher
felix.schumac...@internetallee.de wrote:
 On Do, 2013-10-24 at 11:29 -0400, Stephen More wrote:
 I came across this paper by Peter Lin (
 http://tomcat.apache.org/articles/performance.pdf ). In a simple xml
 addressbook war he summarizes how different variables affect the speed
 of the application. In one test he compares:
 Sun X1 400mhz Ultra Sparc IIe - 5 requests/sec
 AMD 2ghz XP - 25 request/sec
 It appears that both used Tomcat 4.1.19 and Sun Jdk1.4.1_01

 In an attempt to see what todays numbers look like I rebuilt the war (
 svn co https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
 deployed in my environment
 Core i7-3720 QM @ 2.60 GHz
 SSD disk
 java version 1.7.0_45
 apache-tomcat-7.0.42

 package the war - mvn package
 execute jmeter - mvn verify

 Jmeter shows my Throughput of 2.2 requests/sec ! With all the advances
 over the years ( or overhead ) are we just slowing down or are one of
 our results flawed ? ( I am running in VirtualBox - I think this would
 slow some things down - but not this much. )

 Are others seeing similar results ?
 I get almost the same throughput, but I don't believe it is tomcats
 fault (well not directly).

 If you look at the stacktraces while doing the jmeter test, you will see
 very often a stack trace like this:

 http-nio-8080-exec-8 daemon prio=10 tid=0x7fb83400b800 nid=0x2511
 runnable [0x7fb88847b000]
java.lang.Thread.State: RUNNABLE
 at
 com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable.getExpandedTypeID(ExpandedNameTable.java:160)
 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:293)
 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:524)
 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleFromNode(DOM2DTM.java:680)
 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleOfNode(DOM2DTM.java:732)
 at
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:576)
 - locked 0xf20af5e8 (a
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault)
 at
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode(XPathContext.java:188)
 at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:305)
 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.eval(JSTLXPathImpl.java:222)
 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:287)
 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:385)
 at
 org.apache.taglibs.standard.tag.common.xml.XPathUtil.valueOf(XPathUtil.java:213)
 at
 org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:73)
 at
 org.apache.taglibs.standard.tag.el.xml.ExprTag.doStartTag(ExprTag.java:71)
 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fout_005f0(simple_005f100_jsp.java:411)
 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f1(simple_005f100_jsp.java:377)
 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f0(simple_005f100_jsp.java:336)
 at
 org.apache.jsp.simple_005f100_jsp._jspService(simple_005f100_jsp.java:118)
 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 If you search for
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode
 slow jstl you will get to a bugzilla entry for jstl from
 https://issues.apache.org/bugzilla/show_bug.cgi?id=27717 which is
 closed.

 That bugentry suggested, that an xslt-Transfrom would be faster, than
 using x:forEach and if you try to replace the forEach loop with a
 transform, you will get better response times (on my system throughput
 went up from 1.6 r/s to 23.6 r/s for one thread. (I try to attach my
 changes, but sometimes the list strips attachements...)

 So either the bug has been reintroduced into jstl, or it is really slow
 and should be avoided.

Felix - thanks for your help. The current jstl version in the pom.xml
is 1.2 which looks like it was released in July 2006. Bug 27717 was
not fixed until December 2010.
I built and installed from source:
http://svn.apache.org/repos/asf//tomcat/taglibs/standard/trunk/ and
now I am getting 44 r/s !!

I now have 2 questions:
1 - When is the expected release of org.apache.taglibs taglibs-standard-impl ?

 All in all I think you should do your performance tests with a more
 modern benchmark. It would be best, if it would expose your expected
 workload and not someone others.

2 - What modern benchmark would you recommend for tomcat that includes
published results ?

 Regards
  Felix


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional

Re: So You Want High Performance ( cont )

2013-10-25 Thread Stephen More
On Fri, Oct 25, 2013 at 10:30 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Stephen,

 On 10/25/13, 9:13 AM, Stephen More wrote:
 On Fri, Oct 25, 2013 at 5:14 AM, Felix Schumacher
 felix.schumac...@internetallee.de wrote:
 On Do, 2013-10-24 at 11:29 -0400, Stephen More wrote:
 I came across this paper by Peter Lin (
 http://tomcat.apache.org/articles/performance.pdf ). In a
 simple xml addressbook war he summarizes how different
 variables affect the speed of the application. In one test he
 compares: Sun X1 400mhz Ultra Sparc IIe - 5 requests/sec AMD
 2ghz XP - 25 request/sec It appears that both used Tomcat
 4.1.19 and Sun Jdk1.4.1_01

 In an attempt to see what todays numbers look like I rebuilt
 the war ( svn co
 https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
 deployed in my environment Core i7-3720 QM @ 2.60 GHz SSD disk
 java version 1.7.0_45 apache-tomcat-7.0.42

 package the war - mvn package execute jmeter - mvn verify

 Jmeter shows my Throughput of 2.2 requests/sec ! With all the
 advances over the years ( or overhead ) are we just slowing
 down or are one of our results flawed ? ( I am running in
 VirtualBox - I think this would slow some things down - but not
 this much. )

 Are others seeing similar results ?
 I get almost the same throughput, but I don't believe it is
 tomcats fault (well not directly).

 If you look at the stacktraces while doing the jmeter test, you
 will see very often a stack trace like this:

 http-nio-8080-exec-8 daemon prio=10 tid=0x7fb83400b800
 nid=0x2511 runnable [0x7fb88847b000] java.lang.Thread.State:
 RUNNABLE at
 com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable.getExpandedTypeID(ExpandedNameTable.java:160)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:293)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:524)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleFromNode(DOM2DTM.java:680)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleOfNode(DOM2DTM.java:732)


 at
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:576)


 - - locked 0xf20af5e8 (a
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault) at
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode(XPathContext.java:188)


 at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:305)
 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.eval(JSTLXPathImpl.java:222)


 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:287)


 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:385)


 at
 org.apache.taglibs.standard.tag.common.xml.XPathUtil.valueOf(XPathUtil.java:213)


 at
 org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:73)


 at
 org.apache.taglibs.standard.tag.el.xml.ExprTag.doStartTag(ExprTag.java:71)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fout_005f0(simple_005f100_jsp.java:411)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f1(simple_005f100_jsp.java:377)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f0(simple_005f100_jsp.java:336)


 at
 org.apache.jsp.simple_005f100_jsp._jspService(simple_005f100_jsp.java:118)


 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 If you search for
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode


 slow jstl you will get to a bugzilla entry for jstl from
 https://issues.apache.org/bugzilla/show_bug.cgi?id=27717 which
 is closed.

 That bugentry suggested, that an xslt-Transfrom would be faster,
 than using x:forEach and if you try to replace the forEach loop
 with a transform, you will get better response times (on my
 system throughput went up from 1.6 r/s to 23.6 r/s for one
 thread. (I try to attach my changes, but sometimes the list
 strips attachements...)

 So either the bug has been reintroduced into jstl, or it is
 really slow and should be avoided.

 Felix - thanks for your help. The current jstl version in the
 pom.xml is 1.2 which looks like it was released in July 2006. Bug
 27717 was not fixed until December 2010. I built and installed from
 source:
 http://svn.apache.org/repos/asf//tomcat/taglibs/standard/trunk/
 and now I am getting 44 r/s !!

 I now have 2 questions: 1 - When is the expected release of
 org.apache.taglibs taglibs-standard-impl ?

 I believe Jeremy just recently (2013-09-14) rolled a 1.2.0-RC1
 release, but it didn't get enough votes for an actual release. I think
 this will be one last hurrah before the project closes-down.

 I thought everyone had moved from Apache/Tomcat Taglibs over to
 Glassfish's JSTL implementation... it seems to be the industry
 standard these days. Can you try with the GF version?

I

Re: So You Want High Performance ( cont )

2013-10-25 Thread Stephen More
On Fri, Oct 25, 2013 at 10:30 AM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Stephen,

 On 10/25/13, 9:13 AM, Stephen More wrote:
 On Fri, Oct 25, 2013 at 5:14 AM, Felix Schumacher
 felix.schumac...@internetallee.de wrote:
 On Do, 2013-10-24 at 11:29 -0400, Stephen More wrote:
 I came across this paper by Peter Lin (
 http://tomcat.apache.org/articles/performance.pdf ). In a
 simple xml addressbook war he summarizes how different
 variables affect the speed of the application. In one test he
 compares: Sun X1 400mhz Ultra Sparc IIe - 5 requests/sec AMD
 2ghz XP - 25 request/sec It appears that both used Tomcat
 4.1.19 and Sun Jdk1.4.1_01

 In an attempt to see what todays numbers look like I rebuilt
 the war ( svn co
 https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
 deployed in my environment Core i7-3720 QM @ 2.60 GHz SSD disk
 java version 1.7.0_45 apache-tomcat-7.0.42

 package the war - mvn package execute jmeter - mvn verify

 Jmeter shows my Throughput of 2.2 requests/sec ! With all the
 advances over the years ( or overhead ) are we just slowing
 down or are one of our results flawed ? ( I am running in
 VirtualBox - I think this would slow some things down - but not
 this much. )

 Are others seeing similar results ?
 I get almost the same throughput, but I don't believe it is
 tomcats fault (well not directly).

 If you look at the stacktraces while doing the jmeter test, you
 will see very often a stack trace like this:

 http-nio-8080-exec-8 daemon prio=10 tid=0x7fb83400b800
 nid=0x2511 runnable [0x7fb88847b000] java.lang.Thread.State:
 RUNNABLE at
 com.sun.org.apache.xml.internal.dtm.ref.ExpandedNameTable.getExpandedTypeID(ExpandedNameTable.java:160)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.addNode(DOM2DTM.java:293)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.nextNode(DOM2DTM.java:524)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleFromNode(DOM2DTM.java:680)


 at
 com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.getHandleOfNode(DOM2DTM.java:732)


 at
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault.getDTMHandleFromNode(DTMManagerDefault.java:576)


 - - locked 0xf20af5e8 (a
 com.sun.org.apache.xml.internal.dtm.ref.DTMManagerDefault) at
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode(XPathContext.java:188)


 at com.sun.org.apache.xpath.internal.XPath.execute(XPath.java:305)
 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.eval(JSTLXPathImpl.java:222)


 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:287)


 at
 org.apache.taglibs.standard.tag.common.xml.JSTLXPathImpl.evaluate(JSTLXPathImpl.java:385)


 at
 org.apache.taglibs.standard.tag.common.xml.XPathUtil.valueOf(XPathUtil.java:213)


 at
 org.apache.taglibs.standard.tag.common.xml.ExprSupport.doStartTag(ExprSupport.java:73)


 at
 org.apache.taglibs.standard.tag.el.xml.ExprTag.doStartTag(ExprTag.java:71)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fout_005f0(simple_005f100_jsp.java:411)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f1(simple_005f100_jsp.java:377)


 at
 org.apache.jsp.simple_005f100_jsp._jspx_meth_x_005fforEach_005f0(simple_005f100_jsp.java:336)


 at
 org.apache.jsp.simple_005f100_jsp._jspService(simple_005f100_jsp.java:118)


 at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)


 If you search for
 com.sun.org.apache.xpath.internal.XPathContext.getDTMHandleFromNode


 slow jstl you will get to a bugzilla entry for jstl from
 https://issues.apache.org/bugzilla/show_bug.cgi?id=27717 which
 is closed.

 That bugentry suggested, that an xslt-Transfrom would be faster,
 than using x:forEach and if you try to replace the forEach loop
 with a transform, you will get better response times (on my
 system throughput went up from 1.6 r/s to 23.6 r/s for one
 thread. (I try to attach my changes, but sometimes the list
 strips attachements...)

 So either the bug has been reintroduced into jstl, or it is
 really slow and should be avoided.

 Felix - thanks for your help. The current jstl version in the
 pom.xml is 1.2 which looks like it was released in July 2006. Bug
 27717 was not fixed until December 2010. I built and installed from
 source:
 http://svn.apache.org/repos/asf//tomcat/taglibs/standard/trunk/
 and now I am getting 44 r/s !!

 I now have 2 questions: 1 - When is the expected release of
 org.apache.taglibs taglibs-standard-impl ?

 I believe Jeremy just recently (2013-09-14) rolled a 1.2.0-RC1
 release, but it didn't get enough votes for an actual release. I think
 this will be one last hurrah before the project closes-down.

 I thought everyone had moved from Apache/Tomcat Taglibs over to
 Glassfish's JSTL implementation...

Wouldn't TomEE still depend on Apache/Tomcat Taglibs ?

 it seems to be the industry

So You Want High Performance ( cont )

2013-10-24 Thread Stephen More
I came across this paper by Peter Lin (
http://tomcat.apache.org/articles/performance.pdf ). In a simple xml
addressbook war he summarizes how different variables affect the speed
of the application. In one test he compares:
Sun X1 400mhz Ultra Sparc IIe - 5 requests/sec
AMD 2ghz XP - 25 request/sec
It appears that both used Tomcat 4.1.19 and Sun Jdk1.4.1_01

In an attempt to see what todays numbers look like I rebuilt the war (
svn co https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
deployed in my environment
Core i7-3720 QM @ 2.60 GHz
SSD disk
java version 1.7.0_45
apache-tomcat-7.0.42

package the war - mvn package
execute jmeter - mvn verify

Jmeter shows my Throughput of 2.2 requests/sec ! With all the advances
over the years ( or overhead ) are we just slowing down or are one of
our results flawed ? ( I am running in VirtualBox - I think this would
slow some things down - but not this much. )

Are others seeing similar results ?

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: So You Want High Performance ( cont )

2013-10-24 Thread Stephen More
On Thu, Oct 24, 2013 at 4:14 PM, Christopher Schultz
ch...@christopherschultz.net wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Stephen,

 On 10/24/13, 11:29 AM, Stephen More wrote:
 I came across this paper by Peter Lin (
 http://tomcat.apache.org/articles/performance.pdf ). In a simple
 xml addressbook war he summarizes how different variables affect
 the speed of the application. In one test he compares: Sun X1
 400mhz Ultra Sparc IIe - 5 requests/sec AMD 2ghz XP - 25
 request/sec It appears that both used Tomcat 4.1.19 and Sun
 Jdk1.4.1_01

 In an attempt to see what todays numbers look like I rebuilt the
 war ( svn co
 https://maven-examples.googlecode.com/svn/trunk/addrbook ) and
 deployed in my environment Core i7-3720 QM @ 2.60 GHz SSD disk java
 version 1.7.0_45 apache-tomcat-7.0.42

 package the war - mvn package execute jmeter - mvn verify

 Jmeter shows my Throughput of 2.2 requests/sec ! With all the
 advances over the years ( or overhead ) are we just slowing down or
 are one of our results flawed ? ( I am running in VirtualBox - I
 think this would slow some things down - but not this much. )

 VirtualBox is likely making this run terribly, though it can depend a
 lot on the environment, hardware, configuration, etc. Try running
 natively. You got 2.2 req/sec? That sounds ... completely
 unacceptable. Something must be terribly wrong.

Ok, I tried natively for 1 thread I got 1.2 req/sec - my task
manager showed some cores doing absolutely nothing so I re-ran it with
8 threads to get 5.0 req/sec. I agree this is unacceptable - something
must be wrong - but what ?

 What is your testing procedure?

I am running apache-tomcat-7.0.42-windows-x64 natively, I execute
jmeter via maven on a separate machine.

 Are others seeing similar results ?

 I don't think anyone has bothered to benchmark that example code in a
 while...

If anyone else could benchmark that code I sure would like to know your results.

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.14 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJSaX+uAAoJEBzwKT+lPKRYJoIP/RybdmUaJQxKjTeg55+Y0rTY
 1QxJJHx02PveszjT3Mm6M0JP5mGV/oD3CM9q83cYZ94FUx0b8+JtLbOtqwg7cgTQ
 QaASdlxevwdebyJ9SN7Vwdq/TicVanZzBGRN8jsEn4hX11FNRwWpc/pAae7dGiM3
 biR5ke+h97nhEgNCxTyAztmRmTJMGk2dqd7pZxX8gDqCISNmrCp9qHdS4ftlF+bZ
 IoGVq349rfUSfyjC0zHsbK4kjTvjIc4tiPpOeA9qmUs6ybINYxAIOcmYbnejxqXg
 tjM1DqBqNr3fxan+1EpcHe9iHHG5nViJ2SRKlJta2xQRsCgPVlH5jkL6buL7VrMg
 tNIs5rDw8dJ19Cm4vEYS6AVzQmZW+iqij/USJ9jZgUWd3+Zo5TUJWR1VRLJZN/LL
 Z8oNhOYXVXnoImutTZu0Xz1c73/sUjc/QLi1B7F49RxevNtCqw15oWxofCuPAZG5
 tqwNAXdxjof2bqmUXLcDYbYBzbQ6psR2M4dBh55REZVx7LiBxThmZ12IXUUU3Rij
 LnS9622g+EymBO92Gf67V6dCDI03wqf03a7mziMSgS8M3h17rGR0cc1irqxyEx8b
 jrIgGR8ajpw/JXqC9xasN8rXQ9auca0AfpKyVOutZv+BTKA3QqmBtPm28namMJUA
 6IUx6yr5IBEU/C2+oWck
 =EL8r
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: java version 1.7.0_25 + apache-tomcat-7.0.41 = Illegal type for StackMapType: -4

2013-06-22 Thread Stephen More
No, I do not know which JAR is failing.

I set the level to FINEST for every entry in logging.properties but it does
not indicate a specific jar or class file. Is there a specific log entry I
should use that will display that info ?

I can tell you my app includes JDO from datanucleus, JSF from Mojarra and
Spring.


On Fri, Jun 21, 2013 at 12:14 PM, Christopher Schultz 
ch...@christopherschultz.net wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA256

 Stephen,

 On 6/21/13 11:10 AM, Stephen More wrote:
  My web application has been working great with jdk1.6. At this
  point I am trying to upgrade to jdk1.7, when I deploy my war tomcat
  is throwing:
 
  Caused by: java.lang.RuntimeException: Illegal type for
  StackMapType: -4 at
 
 org.apache.tomcat.util.bcel.classfile.StackMapType.setType(StackMapType.java:73)

 I
 
 don't get this exception when I launch my webapp, but I do not have
 any annotations, etc.

 Do you know which JAR is failing?

 I would expect this kind of thing if you used a current BCEL against a
 newer .class file generated for example by Java 8, which BCEL might
 not yet support (or at least the version Tomcat uses).

 Can you enable debug logging and see if you can see which JAR or
 .class file is being scanned when this occurs?

 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
 Comment: GPGTools - http://gpgtools.org
 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

 iQIcBAEBCAAGBQJRxHvWAAoJEBzwKT+lPKRY5eUP/jOyYWJbZ0lL7Izd4v2lrWy6
 3Wxz/eXiHNY/aynp8eeICWq1B+clcJK5cRhLt+3y1V5FZwj8+Pei13JBNjeCOosp
 5GzdRnZ8+siTcHVVHUaqUykitOjiEbWPoWwOzS0Z+qdGDWDb+zRo80t4fYAA3VCb
 v+PQTHwSDRrmFshjQplCxkkhyMIaacGOfF221ssHQC6LkfMVtUMnZaHWRjPEotd9
 5djYmcKGQhrBMmgaIAS3agwGbacs4Of+nY1Kz5dWTyNpnS7cJKWwKHMAIXyzqq+Z
 e8zqYM4LkodIlZPGtOgRgZV1/AQ3yO31TQgJ4O2YCXp829XefIz5/JedU6wiIZI9
 Phm0gkl22a/AGKm3Dljr24V/lTKZy8wl7CoK/sCF3WvMBXyhletn0YS71v1WcI6K
 msdyT1KvKUqYJ519gs7GU48CSYe01DCxpH+7rOW4gYQsRgAXcB11krrm7o3CuIE+
 NUM0YQz/0uhpUc9Xm6zq2je8J0gXWcw+KjbwV3HCvkVrj5jSqnH2hleXY94SEW/p
 ccG0opRaPj8s5v0N1EhoS/uecfmlrhDBFNE0YSp5lvq2NW0WDkffs7otKqVu8XV9
 YEShan5Y7wCNMlnzJG6L9IZ6uWzjf0W66SJ5I1IQ6JRsO4hrOF0lC0VTXgVGFtoF
 1wAAGW3l8u/otEhi3C1u
 =GnPP
 -END PGP SIGNATURE-

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




java version 1.7.0_25 + apache-tomcat-7.0.41 = Illegal type for StackMapType: -4

2013-06-21 Thread Stephen More
My web application has been working great with jdk1.6. At this point I am
trying to upgrade to jdk1.7, when I deploy my war tomcat is throwing:

Jun 21, 2013 10:58:10 AM org.apache.catalina.core.ContainerBase
addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardEngine[Catalina].StandardHost[localhost].StandardContext[/crm]]
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
at
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:976)
at
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1653)
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.RuntimeException: Illegal type for StackMapType: -4
at
org.apache.tomcat.util.bcel.classfile.StackMapType.setType(StackMapType.java:73)
at
org.apache.tomcat.util.bcel.classfile.StackMapType.init(StackMapType.java:65)
at
org.apache.tomcat.util.bcel.classfile.StackMapType.init(StackMapType.java:52)
at
org.apache.tomcat.util.bcel.classfile.StackMapEntry.init(StackMapEntry.java:55)
at
org.apache.tomcat.util.bcel.classfile.StackMap.init(StackMap.java:73)
at
org.apache.tomcat.util.bcel.classfile.Attribute.readAttribute(Attribute.java:145)
at org.apache.tomcat.util.bcel.classfile.Code.init(Code.java:85)
at
org.apache.tomcat.util.bcel.classfile.Attribute.readAttribute(Attribute.java:126)
at
org.apache.tomcat.util.bcel.classfile.FieldOrMethod.init(FieldOrMethod.java:58)
at
org.apache.tomcat.util.bcel.classfile.Method.init(Method.java:72)
at
org.apache.tomcat.util.bcel.classfile.ClassParser.readMethods(ClassParser.java:268)
at
org.apache.tomcat.util.bcel.classfile.ClassParser.parse(ClassParser.java:128)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsStream(ContextConfig.java:2118)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsJar(ContextConfig.java:1994)
at
org.apache.catalina.startup.ContextConfig.processAnnotationsUrl(ContextConfig.java:1960)
at
org.apache.catalina.startup.ContextConfig.processAnnotations(ContextConfig.java:1945)
at
org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1319)
at
org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:878)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:376)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at
org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5269)
at
org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more

Is there a config/development change I have to make or is this a bug ?

-Thanks
Stephen More


PersistentManager Store property problem?

2013-02-13 Thread Owens, Stephen (ITD)
Hi,

I am using apache-tomcat-7.0.26 and am trying to get the PersistentManager with 
a JDBCStore running.
My context.xml is as follows:
?xml version='1.0' encoding='utf-8'?
!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the License); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

  http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an AS IS BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
--
!-- The contents of this file will be loaded for each web application --
Context

!-- Default set of monitored resources --
WatchedResourceWEB-INF/web.xml/WatchedResource

!-- Uncomment this to disable session persistence across Tomcat restarts 
--
!--
Manager pathname= /
--

!-- PersistentManager
The PersistentManager has the capability to swap active (but 
idle)
sessions out to a persistent storage mechanism,
as well as to save all sessions across a normal restart of 
Tomcat
--
Manager className=org.apache.catalina.session.PersistentManager
distributable=true
saveOnRestart=false
maxInactiveInterval=-1
maxIdleBackup=0
processExpiresFrequency=6
Store className=org.apache.catalina.session.JDBCStore
dataSourceName=jdbc/TCMgrSsnDB
checkInterval=3600
sessionTable=TOMCAT_SESSIONS
sessionIdCol=SESSION_ID
sessionValidCol=VALID_SESSION
sessionMaxInactiveCol=MAX_INACTIVE
sessionLastAccessedCol=LAST_ACCESS
sessionAppCol=APP_NAME
sessionDataCol=SESSION_DATA
/Store
/Manager

!-- Uncomment this to enable Comet connection tacking (provides events
 on session expiration as well as webapp lifecycle) --
!--
Valve className=org.apache.catalina.valves.CometConnectionManagerValve /
--

!-- Resource Link to host/manager authorization DB in GlobalNamingResources
--
ResourceLink name=jdbc/TCMgrSsnDB
global=jdbc/TCMgrSsnDB
type=org.apache.tomcat.jdbc.pool.DataSource/

/Context

I am using log4j and have the loglevel set to DEBUG.
When I checked the logs, I saw this:
catalina.out:2013-02-13 13:42:49,886 [pool-3-thread-1] WARN  
org.apache.tomcat.util.digester.Digester  - 
[SetPropertiesRule]{Context/Manager/Store} Setting property 'checkInterval' to 
'3600' did not find a matching property.

The Tomcat 7 Documentation at 
http://tomcat.apache.org/tomcat-7.0-doc/config/manager.html states for the 
Persistent Manager JDBC Based Store that the checkInterval attribute is the 
interval (in seconds) between checks for expired sessions among those sessions 
that are currently swapped out.

Is the checkInterval attribute invalid for a Persistent Manager JDBC Based 
Store?

Thanks,

Stephen R. Owens
Email: stephen.ow...@state.ma.us



Re: CVE-2012-4534 Apache Tomcat denial of service

2012-12-04 Thread Stephen Caine
Jim,

Check your Tomcat version.

http://localhost:8080/

Stephen

On Dec 4, 2012, at 2:47 PM, Mark Thomas ma...@apache.org wrote:

 CVE-2012-4534 Apache Tomcat denial of service
 
 Severity: Important
 
 Vendor: The Apache Software Foundation
 
 Versions Affected:
 - Tomcat 7.0.0 to 7.0.27
 - Tomcat 6.0.0 to 6.0.35
 
 Description:
 When using the NIO connector with sendfile and HTTPS enabled, if a
 client breaks the connection while reading the response an infinite loop
 is entered leading to a denial of service. This was originally reported
 as https://issues.apache.org/bugzilla/show_bug.cgi?id=52858.
 
 Mitigation:
 Users of affected versions should apply one of the following mitigations:
 - Tomcat 7.0.x users should upgrade to 7.0.28 or later
 - Tomcat 6.0.x users should upgrade to 6.0.36 or later
 
 Credit:
 The security implications of this bug were identified by Arun Neelicattu
 of the Red Hat Security Response Team.
 
 References:
 http://tomcat.apache.org/security.html
 http://tomcat.apache.org/security-7.html
 http://tomcat.apache.org/security-6.html
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



SimpleTCPCluster

2012-11-20 Thread Stephen Nelson-Smith
Hi,

I'm trying to test simple session sharing using SimpleTCPCluster on
Tomcat 7.0.32.

Following the documentation, I've uncommented the Cluster
className=org.apache.catalina.ha.tcp.SimpleTcpCluster/ element, and
ensured distributable / is in the web.xml of the examples web app.

From the docs:

- All your session attributes must implement java.io.Serializable

I know the webapps don't, but for proof of concept this is fine.  My
real app does.

- Uncomment the Cluster element in server.xml

Done.

- If you have defined custom cluster valves, make sure you have the
ReplicationValve defined as well under the Cluster element in
server.xml

I haven't.

- If your Tomcat instances are running on the same machine, make sure
the tcpListenPort attribute is unique for each instance, in most cases
Tomcat is smart enough to resolve this on it's own by autodetecting
available ports in the range 4000-4100

I have 2 x VMs running on CentOS 6.3, on different IPs

- Make sure your web.xml has the distributable/ element

Done.

- If you are using mod_jk, make sure that jvmRoute attribute is set at
your Engine Engine name=Catalina jvmRoute=node01  and that the
jvmRoute attribute value matches your worker name in
workers.properties

I'm not.

- Make sure that all nodes have the same time and sync with NTP service!

Done.

- Make sure that your loadbalancer is configured for sticky session mode.

Done (I'm using haproxy).

However, on starting Tomcat, I see:

Nov 20, 2012 10:50:16 AM org.apache.catalina.startup.Catalina start
SEVERE: Catalina.start:
org.apache.catalina.LifecycleException: Failed to start component
[StandardServer[8005]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at org.apache.catalina.startup.Catalina.start(Catalina.java:684)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:322)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:451)
Caused by: org.apache.catalina.LifecycleException: Failed to start
component [StandardService[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at 
org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:732)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 7 more
Caused by: org.apache.catalina.LifecycleException: Failed to start
component [StandardEngine[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at 
org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 9 more
Caused by: org.apache.catalina.LifecycleException: Failed to start
component [org.apache.catalina.ha.tcp.SimpleTcpCluster[Catalina]]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:154)
at 
org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1106)
at 
org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:302)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 11 more
Caused by: org.apache.catalina.LifecycleException:
org.apache.catalina.tribes.ChannelException:
java.lang.IllegalArgumentException: java.net.UnknownHostException:
auto: Name or service not known; No faulty members identified.
at 
org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal(SimpleTcpCluster.java:674)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
... 14 more
Caused by: org.apache.catalina.tribes.ChannelException:
java.lang.IllegalArgumentException: java.net.UnknownHostException:
auto: Name or service not known; No faulty members identified.
at 
org.apache.catalina.tribes.group.ChannelCoordinator.internalStart(ChannelCoordinator.java:178)
at 
org.apache.catalina.tribes.group.ChannelCoordinator.start(ChannelCoordinator.java:99)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:162)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:162)
at 
org.apache.catalina.tribes.group.interceptors.MessageDispatchInterceptor.start(MessageDispatchInterceptor.java:157)
at 
org.apache.catalina.tribes.group.ChannelInterceptorBase.start(ChannelInterceptorBase.java:162)
at 
org.apache.catalina.tribes.group.GroupChannel.start(GroupChannel.java:419)
at 
org.apache.catalina.ha.tcp.SimpleTcpCluster.startInternal(SimpleTcpCluster.java:669)
... 15 more
Caused by: 

Re: SimpleTCPCluster

2012-11-20 Thread Stephen Nelson-Smith
Hi Daniel.

On Tue, Nov 20, 2012 at 1:55 PM, Daniel Mikusa dmik...@vmware.com wrote:
 On Nov 20, 2012, at 5:53 AM, Stephen Nelson-Smith wrote:
 I've encountered this with Tomcat clustering on CentOS in the past.  Tomcat's 
 default configuration for the cluster receiver will automatically look up the 
 address to listen.  It does this by calling 
 java.net.InetAddress.getLocalHost().getHostAddress() [1].

 I can't remember exactly why this was failing for me on CentOS, but I'm 
 almost certain it was due to a problem with /etc/hosts.  I'd suggest taking a 
 look at that file and making sure it contains the right entries.

Thanks for the validation - that's pretty much exactly where my
deductions have led me.  I didn't build these machines, so I can't
speak for the validity of the config - will report.

 Otherwise, you can override the default Tomcat setting for the cluster 
 receiver's address attribute, which is auto and specify the address 
 manually.  That should workaround the problem.

Thanks a lot!

S.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: SimpleTCPCluster

2012-11-20 Thread Stephen Nelson-Smith
Hi,

On Tue, Nov 20, 2012 at 2:03 PM, Stephen Nelson-Smith
sanel...@gmail.com wrote:
 Hi Daniel.

 On Tue, Nov 20, 2012 at 1:55 PM, Daniel Mikusa dmik...@vmware.com wrote:
 On Nov 20, 2012, at 5:53 AM, Stephen Nelson-Smith wrote:
 I've encountered this with Tomcat clustering on CentOS in the past.  
 Tomcat's default configuration for the cluster receiver will automatically 
 look up the address to listen.  It does this by calling 
 java.net.InetAddress.getLocalHost().getHostAddress() [1].

 I can't remember exactly why this was failing for me on CentOS, but I'm 
 almost certain it was due to a problem with /etc/hosts.  I'd suggest taking 
 a look at that file and making sure it contains the right entries.

 Thanks for the validation - that's pretty much exactly where my
 deductions have led me.  I didn't build these machines, so I can't
 speak for the validity of the config - will report.

Yep - missing entry; entry added; all good.

Thanks again.

S.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSP page that will not update

2011-10-07 Thread Stephen Caine
Konstantin
 
 I have set meta tags for no cache, no pragma, etc., all to no avail.
 
 What do you mean?
 meta tags inside HTML document are useless for this. You have to set
 HTTP headers.

OK, but can you point me to where I might learn how to do this?
 
 What is most interesting is that all of this worked in Tomcat 5.5.7, but now 
 using Tomcat 5.5.34, re-opening a page does not automatically refresh 
 content.
 
 What browser it is?

Firefox and Safari on several different Mac OS X operating systems from 10.4 to 
10.7.
 
 Can you point me to information concerning AccessLogValves, please.
 
 webapps/docs/config/index.html - see Valves

Thank you,

Stephen
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



JSP page that will not update

2011-10-06 Thread Stephen Caine
List users,

I recently updated to Tomcat 5.5.34 from 5.5.7.  Keeping all the configuration 
files the same, I now notice that a jsp page that opens cached data whereas 
before the page always loaded updated data.  The call to the page is via a 
javascript using window.open.

Some questions…

1.  Has Tomcat 5.5.34 introduced some change that might account for what I am 
experiencing?
2.  Is there a setting in Tomcat that can be tweaked to address my issue?

Thank you,

Stephen Caine
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: JSP page that will not update

2011-10-06 Thread Stephen Caine
Konstantin,

Thank you for your reply.  I will try to be more specific.

The function I have on the page is a simple call to the OS (Mac) for the 
current date and time.  The first time the page is called, the current date and 
time is shown.  However, if the window is closed and the page is called again, 
the original date and time are shown, not the current date and time.  If I 
reload the page using menu commands, the date and time are updated, but 
re-opening the page does not update the date and time.  Note however, 
re-opening the page after 5 attempts, will eventually update the date and time.

I have set meta tags for no cache, no pragma, etc., all to no avail.

What is most interesting is that all of this worked in Tomcat 5.5.7, but now 
using Tomcat 5.5.34, re-opening a page does not automatically refresh content.

Can you point me to information concerning AccessLogValves, please.

I appreciate you time.

Stephen Caine


On Oct 6, 2011, at 7:47 PM, Konstantin Kolinko wrote:

 2011/10/7 Stephen Caine step...@commongrnd.com:
 List users,
 
 I recently updated to Tomcat 5.5.34 from 5.5.7.  Keeping all the 
 configuration files the same, I now notice that a jsp page that opens cached 
 data whereas before the page always loaded updated data.  The call to the 
 page is via a javascript using window.open.
 
 
 Your description is too high-level.
 
 You need to find what actually happens. Either
 a) the page generates stale data
 b) the page is not requested by browser (a stale copy is used)
 
 a) happens on server,
 b) happens in the browser, but depends on what HTTP headers are
 returned with your response.
 
 You need to perform some investigation, what really happens, and
 whether it is a) or b).
 At least, configure an AccessLogValve in Tomcat.
 
 Some questions…
 
 1.  Has Tomcat 5.5.34 introduced some change that might account for what I 
 am experiencing?
 
 :/
 
 2.  Is there a setting in Tomcat that can be tweaked to address my issue?
 
 See above.
 
 Best regards,
 Konstantin Kolinko
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Tomcat 7 generated web.xml

2011-07-15 Thread Stephen Munro
I'm looking for details on how to get the generated web.xml after all the
annotations have been processed.  I had watched a video
on this feature and as I understand it, once the annotations have been
processed, it's possible to log the web.xml generated from it and
use it for production, which means you can disable annotations thus
improving performance. How do I do this?

-- 
Warmest Regards,

Stephen Munro


Re: Tomcat 7 generated web.xml

2011-07-15 Thread Stephen Munro
Thanks for the quick reply! I've got it working, so thanks. I'm a little
curious why the web-app structure is dumped directly to the logs rather than
have it written to a .xml for convenience say...web-generated.xml?

On 15 July 2011 21:04, Jesse Farinacci jie...@gmail.com wrote:

 Greetings,

 On Fri, Jul 15, 2011 at 3:52 PM, Stephen Munro
 stephen.ross.mu...@gmail.com wrote:
  I'm looking for details on how to get the generated web.xml after all the
  annotations have been processed.

 See http://tomcat.apache.org/tomcat-7.0-doc/config/context.html and
 look for logEffectiveWebXml.

 -Jesse

 --
 There are 10 types of people in this world, those
 that can read binary and those that can not.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Warmest Regards,

Stephen Munro


Re: Tomcat 7 generated web.xml

2011-07-15 Thread Stephen Munro
Yeah, you may be right out it's usefulness, but on the video I watched, it
was being pitched as a performance boost if you had a massive web app (with
annotations and web-fragments). So the use case would be, develop the app
with annotations enabled and in production, switch them off and use the
master (generated) web.xml, that's what my understanding of it was. So, with
that in mind, I'd have thought a web.xml file would have been created and
that could be checked into version control without the user having to do
anything.

This may not be what had been envisioned for it's primary use, it just
struck me as a nice feature to have.

On 15 July 2011 22:18, Jesse Farinacci jie...@gmail.com wrote:

 Greetings,

 On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
 stephen.ross.mu...@gmail.com wrote:
  Thanks for the quick reply! I've got it working, so thanks. I'm a little
  curious why the web-app structure is dumped directly to the logs rather
 than
  have it written to a .xml for convenience say...web-generated.xml?

 Great! The configuration option name has log right in it. I wouldn't
 expect it to do anything other than log the effective web.xml. Having
 this effective web.xml output to a special file seems of limited
 value, you can simply copy and paste in the rare event that you
 actually require it.

 -Jesse

 --
 There are 10 types of people in this world, those
 that can read binary and those that can not.

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Warmest Regards,

Stephen Munro


Re: Tomcat 7 generated web.xml

2011-07-15 Thread Stephen Munro
No, that wasn't the way it was pitched. The video was from springsource and
a Mark Thomas was discussing the feature in question (
http://www.youtube.com/watch?v=HSPo8k6DbTsfeature=related). He did say that
this feature was good for ensuring nothing was enabled accidentally through
web-fragments and that the log feature would help sanity check the web-app
configuration. However, he did state it was a good way for improving
performance.  This was purely out of my own curiosity and I've not looked
into Tomcat much and it seemed (to me at least) worth asking about. As you
seemed to have implied in your comment, unless the app is rebooted on a
regular basis, it may not be worth dumping the in memory copy to a generated
web.xml file.



On 15 July 2011 22:28, Pid p...@pidster.com wrote:

 On 15/07/2011 22:25, Stephen Munro wrote:
  Yeah, you may be right out it's usefulness, but on the video I watched,
 it
  was being pitched as a performance boost if you had a massive web app
 (with
  annotations and web-fragments). So the use case would be, develop the app
  with annotations enabled and in production, switch them off and use the
  master (generated) web.xml, that's what my understanding of it was. So,
 with
  that in mind, I'd have thought a web.xml file would have been created and
  that could be checked into version control without the user having to do
  anything.

 Does the video describe an app which is rebooted frequently in production?


 p


  This may not be what had been envisioned for it's primary use, it just
  struck me as a nice feature to have.
 
  On 15 July 2011 22:18, Jesse Farinacci jie...@gmail.com wrote:
 
  Greetings,
 
  On Fri, Jul 15, 2011 at 5:10 PM, Stephen Munro
  stephen.ross.mu...@gmail.com wrote:
  Thanks for the quick reply! I've got it working, so thanks. I'm a
 little
  curious why the web-app structure is dumped directly to the logs rather
  than
  have it written to a .xml for convenience say...web-generated.xml?
 
  Great! The configuration option name has log right in it. I wouldn't
  expect it to do anything other than log the effective web.xml. Having
  this effective web.xml output to a special file seems of limited
  value, you can simply copy and paste in the rare event that you
  actually require it.
 
  -Jesse
 
  --
  There are 10 types of people in this world, those
  that can read binary and those that can not.
 
  -
  To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
  For additional commands, e-mail: users-h...@tomcat.apache.org
 
 
 
 





-- 
Warmest Regards,

Stephen Munro


Re: Java update from Apple broke Tomcat

2010-11-02 Thread Stephen Caine
Rob,

We use Tomcat 6.0.28 on Mac OS X 10.6.4 with the latest Java update and it 
seems to start up just fine.

Stephen Caine
Soft Breeze Systems, LLC

On Nov 1, 2010, at 1:55 PM, Rob Tanner wrote:

 Hi,
 
 While I run production on Linux servers, I do my development on my iMac.
 Last week, I ran the most recent Apple Java upgrade , and now Tomcat (which
 is a critical part of my development environment) won't start up.  I get the
 error:
 
 Nov 1, 2010 8:58:54 AM org.apache.catalina.startup.Bootstrap
 initClassLoaders
 SEVERE: Class loader creation threw exception
 java.lang.NoSuchFieldError: IS_DIR
 at 
 org.apache.catalina.startup.Bootstrap.createClassLoader(Bootstrap.java:167)
 at 
 org.apache.catalina.startup.Bootstrap.initClassLoaders(Bootstrap.java:92)
 at org.apache.catalina.startup.Bootstrap.init(Bootstrap.java:207)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:391)
 
 Other details:
 
 java version 1.6.0_22
 Java(TM) SE Runtime Environment (build 1.6.0_22-b04-307-10M3261)
 Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03-307, mixed mode)
 
 Tomcat version:  6.0.18 and 6.0.29 — both fail to start, throwing the same
 exception
 
 From the error, it appears that things are missing from the update (or at
 least one field is).  Has anyone else seen this?  Is there a known
 work-around?
 
 Thanks,
 
 Rob Tanner
 Linfield College


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tabbed browsers sharing session - work around.

2010-10-05 Thread Stephen Caine
Rob,

The way you describe session sharing is indeed a problem.  The way we deal with 
this is to use a separate database table to keep track of window ids.  A unique 
value is assigned when a window is opened and maintained until the window is 
closed.  Although the session may be the same for all open windows (tabs), the 
window id is unique.  Significant values are posted to the window table and 
retrieved based on the window id.

If there is another method using a Tomcat centric approach, I would love to 
hear about it.

Stephen

On Oct 5, 2010, at 9:01 AM, Ronald Klop wrote:

 Rob,
 
 IE 6 is even more confusing. If you open a new window with ctrl-N you have 
 the same session sharing as with tabs. Only if you click the IE6-icon to 
 start a new instance of the process it will not share them. Opening a new tab 
 in IE7 is like using ctrl-n to open a new window in IE6.
 
 Ronald.
 
 
 Op dinsdag, 5 oktober 2010 10:26 schreef Rob Gregory 
 rob.greg...@ibsolutions.com:
 Hi Chris,
 Is there any way to dynamically create these contexts or do they require a 
 live.xml, test.xml, etc within conf/Catalina/localhost. The multiple 
 contexts would be my preferred approach although I would like to achieve 
 this with a single code base if this is possible. The multiple environments 
 are driven purely by the backend database connection, i.e. the code is the 
 same with the only difference being where the data is being saved to. Hence 
 the requirement to stop the browser sharing the same session when in 
 different database connections. I'm surprised that other people are not 
 having the same issues since the browser manufacturers decided to make this 
 crazy change to session management between tabs/instances and suddenly share 
 the same session. In I.E.6 two browser instances would be two separate 
 sessions. I.E.7 they are the same session! Thanks for your input.
 Kind Regards,
 Rob.
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 Ronald,
 On 10/4/2010 6:11 AM, Ronald Klop wrote:
  You can run your test environment on another hostname.
   live.example.com
  test.example.com
  train.example.com
 Or under another context:
 http://www.example.com/live
 http://www.example.com/test
 http://www.example.com/train
 The real question is why there's any confusion: your hostnames and/or
 URLs ought to be unique enough already. Otherwise, this sort of
 foolishness can affect your real users and you'll leak data all over
 the place.
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 iEYEARECAAYFAkyqDDQACgkQ9CaO5/Lv0PDWRACgrlgU+jY+n8nMCZ2WTO63UHDh
 10UAoJdyNWqu0nlRGcWbJ6Mcc7zbsGy+
 =JP4k
 -END PGP SIGNATURE-
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Unexpected errors after opening port 80

2010-09-03 Thread Faro Stephen (NHS Connecting for Health)
I am running a Tomcat server on Windows Server 2003 RC2 over HTTPS (443). The 
server has been running smoothly for many months with 100s of thousands of 
daily transactions.

Yesterday my networks team modified the firewall rules to permit traffic on 
port 80, it could be a coincidence but after this we had 8 errors calling 
Oracle Procedures on a separate Unix based Oracle DB server and 2 errors 
connecting to a remote API. These errors were unspecific and we believe they 
were due to network timeouts / dropped packets, as a last resort we restarted 
the Tomcat server and have not seen any errors since. The only reference to 
port 80 in the Tomcat config is (server.xml)...

Connector executor=tomcatThreadPool
port=80 protocol=HTTP/1.1
connectionTimeout=2
redirectPort=443 /

I am not a Tomcat expert and don't fully understand Tomcats Thread Pooling but 
could this be in any way related to our errors observed before the restart?

Thanks for your help in advance.

Steve

Stephen Faro
Analyst Programmer





This message may contain confidential information. If you are not the intended 
recipient please inform the
sender that you have received the message in error before deleting it.
Please do not disclose, copy or distribute information in this e-mail or take 
any action in reliance on its contents:
to do so is strictly prohibited and may be unlawful.

Thank you for your co-operation.

NHSmail is the secure email and directory service available for all NHS staff 
in England and Scotland
NHSmail is approved for exchanging patient data and other sensitive information 
with NHSmail and GSI recipients
NHSmail provides an email address for your career in the NHS and can be 
accessed anywhere
For more information and to find out how you can switch, visit 
www.connectingforhealth.nhs.uk/nhsmail




Re: Session problem

2010-08-25 Thread Stephen Caine
Jason,

I was referring to an issue where a user opens several tabbed references to the 
same window.  If the session value is changed in one window, the value will 
change in subsequent references in the other tabbed window(s).  Actually, this 
is significant problem, but if this is not what was being asked, then ignore my 
comment.

Stephen

On Aug 24, 2010, at 8:06 PM, Jason Britton wrote:

 Stephen - your statement doesn't really make sense in context to the
 problem he described or how I replied.  From Hisham's first post I
 believe he's describing tabs within the context of a single web page
 interface, when he clicks on any of the three tabs a request is made
 (asynchronous or otherwise), request passes through a servlet filter
 that checks for existence of session attribute etc..  I was suggesting
 he check that he hadn't, for some unknown reason, hardcoded a
 different domain for the Messages link, if that were the case that
 domain (eg. localhost instead of dev2) would not have the same session
 as the other links and the session attribute value he was looking for
 might not be there, which would fit with what he's describing.
 
 Jason
 
 
 On Tue, Aug 24, 2010 at 3:37 PM, Stephen Caine step...@commongrnd.com wrote:
 Jason,
 
 As each window shares the same session, a change to the session value in one 
 window will effect the session value in the others.
 
 Stephen Caine
 
 On Aug 24, 2010, at 5:21 PM, Jason Britton wrote:
 
 I would make sure that the link for your Messages tab is going to the same
 domain as that your session was established under and is hitting the same
 domain as your Home and Admin links.  This doesn't seem to have anything
 to do with Tomcat though.
 
 
 On Tue, Aug 24, 2010 at 1:53 PM, Hisham mohis...@gmail.com wrote:
 
 Hello all,
 
 I have a problem that is driving me crazy.  I don't even know if its a
 Tomcat issue but maybe someone out there can help me out.
 
 I have a webapp that I first developed locally.  I tested this on my
 local environment (windows) and had no issues.  I then deployed the
 same app to our QA environment (linux).  There i am seeing something
 strange.  There are three main tabs, Home, Messages and Admin.
 I can go between home and admin, no probs.  But once i click on
 Messages, somehow the session on the server gets messed up.  The way i
 check whether session is valid is not is that I have a filter that
 will check if a certain attribute is present in the session or not.
 If its not, i assume the session is invalid and forward to login page.
 As soon as i click on the Messages link, i cannot do anything else;
 anywhere else i click it takes me to the login page.  I put print
 statements in my filter and verified that it is not able to find the
 attribute in the session.  Which is strange because the session id is
 the same (i have verified by printing it out, and also seeing what is
 sent in the actual request headers via firebug).  I am not removing
 the attribute from the session in any place; and in any case it works
 fine locally as i said before.
 
 Does any one have any clue as to what could be happening?  I can post
 code if needed, but i don't know where to begin :)
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Session problem

2010-08-24 Thread Stephen Caine
Jason,

As each window shares the same session, a change to the session value in one 
window will effect the session value in the others.

Stephen Caine

On Aug 24, 2010, at 5:21 PM, Jason Britton wrote:

 I would make sure that the link for your Messages tab is going to the same
 domain as that your session was established under and is hitting the same
 domain as your Home and Admin links.  This doesn't seem to have anything
 to do with Tomcat though.
 
 
 On Tue, Aug 24, 2010 at 1:53 PM, Hisham mohis...@gmail.com wrote:
 
 Hello all,
 
 I have a problem that is driving me crazy.  I don't even know if its a
 Tomcat issue but maybe someone out there can help me out.
 
 I have a webapp that I first developed locally.  I tested this on my
 local environment (windows) and had no issues.  I then deployed the
 same app to our QA environment (linux).  There i am seeing something
 strange.  There are three main tabs, Home, Messages and Admin.
 I can go between home and admin, no probs.  But once i click on
 Messages, somehow the session on the server gets messed up.  The way i
 check whether session is valid is not is that I have a filter that
 will check if a certain attribute is present in the session or not.
 If its not, i assume the session is invalid and forward to login page.
 As soon as i click on the Messages link, i cannot do anything else;
 anywhere else i click it takes me to the login page.  I put print
 statements in my filter and verified that it is not able to find the
 attribute in the session.  Which is strange because the session id is
 the same (i have verified by printing it out, and also seeing what is
 sent in the actual request headers via firebug).  I am not removing
 the attribute from the session in any place; and in any case it works
 fine locally as i said before.
 
 Does any one have any clue as to what could be happening?  I can post
 code if needed, but i don't know where to begin :)
 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Tomcat 6 SSL configuration error

2010-07-23 Thread Stephen Lorenz
Try http://localhost:8443/ https://localhost:8443/ (i.e. without the
https).  Perhaps the sslEnabled parameter is not configured properly?

--Steve

On Fri, Jul 23, 2010 at 6:26 AM, aung bar hlay aungbarh...@gmail.comwrote:

 hi

 I've read tomcat 6 ssl configuration and
 have gone through all the steps.

 My problem is when i open browser and
 type https://localhost:8443/;,
 then,it takes too long and at last
 display error connection was reset.

 I'm using Apache Tomcat 6.0.18,
 Mozilla Firefox 3.6, Jdk 1.6.0.

 Please reply to me.



Putting APACHE in front of a stand-alone Tomcat Server

2010-05-17 Thread Stephen .


Hi all,

just a quick question.

I am currently using a stand-alone Tomcat Server to run an application.

However, I plan to expand this application (which is web-based) to enable 
Authentication processes from external IDPs  (Identity Providers).

Unfortunately, to be able to implement this, the IDPs require that Tomcat must 
not be a stand-alone server. It requires Apache  (apparently, all 
authentication requests will need to be routed via the Apache)

My question is : is it possible to make this change (somehow install, or 
place Apache in front of my current Tomcat server)?  Or does this require a 
whole new installation of Apache Tomcat?

I am using : Apache Tomcat 6.0.18


(Funny thing : I always thought that the name Apache Tomcat automatically 
meant that my server already had Apache in front of it. But, it seems I was 
wrong)


  
_
Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

RE: Putting APACHE in front of a stand-alone Tomcat Server

2010-05-17 Thread Stephen .

Hi,

thanks for your response.

However, I would need some more explanation.

Exactly where and how would I implement those Tomcat Connectors ?

Apparently, all I have is the Tomcat engine itself. So, what I need is an 
actual Apache server.  (Am I right?)

Another thing :  I've had my Tomcat running for a while now. The application 
which is running on the server is Sun's Identity Manager (IDM).

If I now place an Apache in front of it, would that, in any way, damage the web 
application itself?


Thanks




 Date: Mon, 17 May 2010 13:44:12 +0200
 Subject: Re: Putting APACHE in front of a stand-alone Tomcat Server
 From: borut.hadzia...@gmail.com
 To: users@tomcat.apache.org
 
 Take a look at http://tomcat.apache.org/connectors-doc/
 
 I think you can also use apache mod_proxy.
 
 On Mon, May 17, 2010 at 1:36 PM, Stephen . marr...@hotmail.com wrote:
 
 
  Hi all,
 
  just a quick question.
 
  I am currently using a stand-alone Tomcat Server to run an application.
 
  However, I plan to expand this application (which is web-based) to enable 
  Authentication processes from external IDPs  (Identity Providers).
 
  Unfortunately, to be able to implement this, the IDPs require that Tomcat 
  must not be a stand-alone server. It requires Apache  (apparently, all 
  authentication requests will need to be routed via the Apache)
 
  My question is : is it possible to make this change (somehow install, or 
  place Apache in front of my current Tomcat server)?  Or does this require 
  a whole new installation of Apache Tomcat?
 
  I am using : Apache Tomcat 6.0.18
 
 
  (Funny thing : I always thought that the name Apache Tomcat automatically 
  meant that my server already had Apache in front of it. But, it seems I was 
  wrong)
 
 
 
  _
  Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
  https://signup.live.com/signup.aspx?id=60969
 
 
 
 -- 
 Why?
 Because YES!
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  
_
Hotmail: Free, trusted and rich email service.
https://signup.live.com/signup.aspx?id=60969

RE: Putting APACHE in front of a stand-alone Tomcat Server

2010-05-17 Thread Stephen .


Hi Pid,

HTTPD doesn't help me much because I am using Windows.

(I assume HTTPD is only for Unix/Linux systems)


-Stephen




 Date: Mon, 17 May 2010 12:54:42 +0100
 From: p...@pidster.com
 To: users@tomcat.apache.org
 Subject: Re: Putting APACHE in front of a stand-alone Tomcat Server
 
 On 17/05/2010 12:36, Stephen . wrote:
  
  
  Hi all,
  
  just a quick question.
  
  I am currently using a stand-alone Tomcat Server to run an application.
  
  However, I plan to expand this application (which is web-based) to enable 
  Authentication processes from external IDPs  (Identity Providers).
  
  Unfortunately, to be able to implement this, the IDPs require that Tomcat 
  must not be a stand-alone server. It requires Apache  (apparently, all 
  authentication requests will need to be routed via the Apache)
  
  My question is : is it possible to make this change (somehow install, or 
  place Apache in front of my current Tomcat server)?  Or does this require 
  a whole new installation of Apache Tomcat?
  
  I am using : Apache Tomcat 6.0.18
 
 6.0.26 is shinier.  [Hint].
 
  (Funny thing : I always thought that the name Apache Tomcat automatically 
  meant that my server already had Apache in front of it. But, it seems I was 
  wrong)
 
 HTTPD can be run alongside/in front of Tomcat, using mod_jk or mod_proxy
 to forward some/all requests to the latter.
 
 Typical use cases are using HTTPD as a poor-mans load-balancer, or when
 combining different technologies (e.g. PHP, Java/JSP).
 
 HTTPD can handle authentication, or Tomcat can, but not both at the same
 AFAIK.  The AJP Connector will need it's 'tomcatAuthentication'
 attribute set to 'false' in the former case.
 
 
 Out of interest, which IDPs require Apache HTTPD?
 
 
 p
 
 
  _
  Hotmail: Trusted email with Microsoft’s powerful SPAM protection.
  https://signup.live.com/signup.aspx?id=60969
 
 
  
_
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969

Re: Installing Java Advanced Imaging In Tomcat.

2010-04-26 Thread Stephen Souness
aditya siram aditya.siram at gmail.com writes:

 
 Hi all,
 I am having issues using jai [1]  with a Tomcat webapp. I am running
 the tomcat6 package installed from the Ubuntu repos.
 
 The webapp does some image decompression and is unable to detect
 CLibJpegImageReader which is a class in the jai_imageio.jar.
 
 I have copied this jar file to my WEB-INF/lib directory and also to
 /var/lib/tomcat6/lib and /usr/share/tomcat6/lib hoping that it would
 work from one of these locations. Additionally it is in my
 JAVA_HOME/jre/lib/ext directory so it should be available after the
 bootstrap phase.
 
 I know that JAI is installed correctly because a stand-alone app is
 able to access the required class.
 
 Any help is appreciated
 -deech


I think someone reported something similar a few weeks back.

The response that worked for them was:

Try disabling the JreMemoryLeakPreventionListener in conf/server.xml, just in
case it was interfering with the JAI registration.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re-direct webpage from HTTP to HTTPS

2010-04-15 Thread Stephen .


Hi all,

I have recently bought and installed an SSL Certificate on my Apache Tomcat 
Server.

I modified the server.xml file, so that my webpage now uses only HTTPS  
(meaning, a secure site)

However, I would like to modify it such that : if someone types in only HTTP,  
he will nevertheless be directed to the proper place : HTTPS://mysite.com

I know that this is a simple thing to do;  I'm just not sure of the exact syntax

Any help, please?

Thanks


  
_
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969

RE: Tomcat scalability setting - need help please

2010-04-11 Thread Stephen Souness

What sort of transaction isolation level requirements does your application
have?

If users are prevented from accessing the functionality of the system when a
large query is being run then I would recommend checking whether the
database is locking the tables.





cinlung wrote:
 
 Dear Leon
 
 Let me answer your question by the number of the questions:
 1. My threadpool settings: are you talking about the java threadpool or
 the
 tomcat server setting for the thread pool. If this is tomcat, I am sorry I
 think I set it to standard from installation. I did not change any tomcat
 standard settings except for the -xmx and -xms stuff. As for java, the DB
 thread pool is set for 200 connections at once.
 
 What I meant by slows down is that user clicks on a simple form view
 function that usually takes less dan a blink of an eye to open, now the
 application just not responding. The browser just keep loading and the
 load
 animation for IE keeps spinning, but does not return the appropriate
 response page and sometimes it just died (blank). When I check the tomcat
 logs nothing went wrong.
 
 This happens if a user run one of the heavy duty app and someone else run
 another app (even simple ones). Regarding multiple tomcat machine I am
 trying to avoid it because I would have to rewrite the entire software or
 get an QOS machine to disperse the weight.
 
 2. For number 2, I did the warning for user to wait and not to close the
 browser before it is finished. But, a lot of them just don't even bother
 to
 read the warning and keep closing it. I was wondering if there is an API
 for
 monitoring dead users out there. Or I can always create a new API to
 monitor
 user activities by planting an applet on the user site that will keep
 pinging to the server and if the ping died, that means the user closed the
 browser. Is this wise? 
 
 Or I can try to see The java Concurency thing that you mentioned below.
 
 Thank you for your advice and sorry for my bad English.
 
 
 -Original Message-
 From: Leon Rosenberg [mailto:rosenberg.l...@googlemail.com] 
 Sent: Thursday, April 08, 2010 5:31 PM
 To: Tomcat Users List
 Subject: Re: Tomcat scalability setting - need help please
 
 Hello Rendra,
 
 comments inline.
 
 On Thu, Apr 8, 2010 at 11:00 AM, Cin Lung cinl...@gmail.com wrote:
 Dear All Dev

 Sorry if repost, I got an error from the mailing list server.
 Can anyone help me with my problem? I have two biggest problems as
 follow:

 1. Multi Connection Problem:
 I have a web application that service to multiple users. Everytime the 
 users accessing the server reach 100 users at the same time, the 
 tomcat would slows down. I tried to set -xmx1024 and -xms1024, but it 
 did not have any impact at all.
 I tried to set the memory cache to 2048 and above, but the tomcat 
 won't start.
 
 What are your threadpool settings? What exactly is 'slows down' If it
 stops
 responding you are obviously running out of threads. If it just gets
 slower,
 you should consider measuring the load on your machine and webapp.
 Maybe you should consider scaling to multiple tomcats/machines.
 
 Is there any way to improve tomcat's performance. Will there be any 
 use of Java NIO Framework in tomcat? I mean apache has Mina, why not 
 combine with tomcat?
 
 There are a lot of ways, but first you should identify your problem.
 

 2. User cancellation problem
 Another thing that really bug me is that user would click on a web 
 application that perform a very extensive task. The user was not 
 patient and just close the browser accessing the app. This did not 
 make that particular job stop. In fact the job is still running until 
 finish and then it got no place to return the result since the user 
 closed the browser. As the result, my server is working really hard 
 and takes up all the resources available, and causes other users to lag.

 Is there any way to make that particular user task/thread stop working?
 
 The common way to handle this is to inform user that the task is going to
 last a bit more. To achieve this, the original request starts a background
 job which executes the heavy task. The original request then sends the
 user
 to a wait page, which explains that he/she has to wait for the execution.
 The wait page reloads itself all 1-2 seconds checking whether the
 background
 job has finished. If this happens, the wait page sends the user to the
 result page, where he can examine the result of the background task.
 There are a lot of classes like Executor, Future etc. which can help you
 in
 synchronization of background jobs. Java Concurrency in Practice is a good
 particular start.
 
 regards
 Leon
 
 
 
 
 
 
 
 

 Thank you in advance
 Rendra


 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org


 
 -
 To 

Re: Comet explicit event close

2010-02-09 Thread Stephen Byrne
On Tuesday 09 February 2010 07:11:40 you wrote:
 Hi,
 I  am Using a Socket client to send a http request to sever and then waits
 to read response from the socket inputstream..
 
 1. I have a comet servlet. On its read event it starts a new thread passing
 the request and response object.
 
 2.The read event code block then returns.
 3. The thread started in the read event starts writing the responses in the
 response stream.
 PrintWriter writer =response.getWriter();
 writer.write(asynresponse);
 
 4. after writing say 5 responses i want to just close the request and
 response (not the socket which sent the request)
 Sending header Connection:close closes the Socket
 
 How do i do this?
 
 Since i cannot trigger the Comet servlet END event explicitly, where/how
 can I call event.close();
 
 I tried passing the event object from the read event to the thread and
 called event.close in the thread. But an exception was
 thrown saying event object is no longer  associated with the request and
 response.
 
 Thanks,
 Animesh

Why are you starting a new thread instead of writing the response and calling 
event.close() from the thread in which event(CometEvent) is called?
 
 P.S: BTW Kudos to the forum. Is is so alive. have been sending queries
  since some days and got replies.
 Also just to let u know i have a business problem where a http request and
 response are to be served using comet asyncronously on the same socket
 connection.
 
 So i have a single socket client which wants to send http request again and
 again (pipeline) and waits for a asyn response from the comet server.
  trying a POC for the same.
 Any ideas for concrete pipelining clients would be greatly appreciated.
 
 Thanks,
 Animesh
 

-- 
Stephen Byrne
step...@lincware.com
(585) 286-5817

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Configuring two connectors and COMET Read event

2010-02-04 Thread Stephen Byrne
Animesh Sonkar wrote:
*snip*
 2. I am not able to invoke the READ event.  How do i do that?

You need to send the HTTP request as chunked data. If you happen to be
using an HttpURLConnection, call setChunkedStreamingMode( 1 ). If you
are taking a lower level approach, (i.e. using sockets), send a header
Transfer-Encoding: chunked, and send CRLF and flush your stream
between chunks.

*snip*
 Thanks,
 Animesh.


-- 
Stephen Byrne
step...@lincware.com
(585) 286-5817

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



CometProcessor proxied through Apache httpd

2010-01-27 Thread Stephen Byrne
Is there a way to get CometProcessor to work when proxying through 
Apache httpd? Here is what I have tried:


I have an HttpServlet implementing CometProcessor.

When I have a Tomcat connector like this:

Connector port=8912 protocol=HTTP/1.1
  address=192.168.1.30 /

and I connect to it directly, everything works wonderfully - I get 
CometEvent.EventType.READ events as I send data from the client.



When I have a Tomcat connector like this:

Connector port=8911 protocol=HTTP/1.1
  address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet http://localhost:8911/path/to/servlet [P]

I get exactly one CometEvent.EventType.READ event with all of the data 
after I finish sending data from the client.



When I have a Tomcat connector like this:
Connector port=8909 protocol=AJP/1.3
  address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet ajp://localhost:8909/path/to/servlet [P]

I get zero CometEvents and the client gets an HTTP error 405 (Method Not 
Allowed). I was hoping that AJP would work so I could try using 
ProxyPass with flushpackets=on, but the Apache documentation says that 
only works with AJP.



If I use Http11NioConnector instead of HTTP/1.1 and try to proxy with 
Apache, I get the same results as if I were using the HTTP/1.1 connector.


My client code (Java) is:

// Direct to Tomcat (HTTP)
//URL url = new URL( http://server:8912/path/to/servlet; );
// Apache proxies to Tomcat
URL url = new URL( http://server/path/to/servlet; );
HttpURLConnection connection = (HttpURLConnection)
  url.openConnection();
connection.setChunkedStreamingMode( 1 );
connection.setDoOutput( true );
connection.setDoInput( true );
connection.connect();
OutputStream os = connection.getOutputStream();
for ( int i = 0; i  10; i++ ) {
  os.write( 1 );
  os.flush();
  Thread.sleep( 1000 );
}
os.close();
log.debug( response: + connection.getResponseCode() );
log.debug( response: + connection.getResponseMessage() );
connection.disconnect();

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: CometProcessor proxied through Apache httpd

2010-01-27 Thread Stephen Byrne

Robin Wilson wrote:

Have you tried using mod_proxy_ajp?

ProxyPass /some/path ajp://tomcat.host.domain:8009/some/other/path


Yes, I did try this, and got the same results as using RewriteRule - a 
405 error.



--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
CELL: 512-426-3929
DESK: 512-623-5913
www.KingsIsle.com

-Original Message-
From: Stephen Byrne [mailto:step...@lincware.com] 
Sent: Wednesday, January 27, 2010 9:27 AM

To: users@tomcat.apache.org
Subject: CometProcessor proxied through Apache httpd

Is there a way to get CometProcessor to work when proxying through 
Apache httpd? Here is what I have tried:


I have an HttpServlet implementing CometProcessor.

When I have a Tomcat connector like this:

Connector port=8912 protocol=HTTP/1.1
   address=192.168.1.30 /

and I connect to it directly, everything works wonderfully - I get 
CometEvent.EventType.READ events as I send data from the client.



When I have a Tomcat connector like this:

Connector port=8911 protocol=HTTP/1.1
   address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet http://localhost:8911/path/to/servlet [P]

I get exactly one CometEvent.EventType.READ event with all of the data 
after I finish sending data from the client.



When I have a Tomcat connector like this:
Connector port=8909 protocol=AJP/1.3
   address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet ajp://localhost:8909/path/to/servlet [P]

I get zero CometEvents and the client gets an HTTP error 405 (Method Not 
Allowed). I was hoping that AJP would work so I could try using 
ProxyPass with flushpackets=on, but the Apache documentation says that 
only works with AJP.



If I use Http11NioConnector instead of HTTP/1.1 and try to proxy with 
Apache, I get the same results as if I were using the HTTP/1.1 connector.


My client code (Java) is:

// Direct to Tomcat (HTTP)
//URL url = new URL( http://server:8912/path/to/servlet; );
// Apache proxies to Tomcat
URL url = new URL( http://server/path/to/servlet; );
HttpURLConnection connection = (HttpURLConnection)
   url.openConnection();
connection.setChunkedStreamingMode( 1 );
connection.setDoOutput( true );
connection.setDoInput( true );
connection.connect();
OutputStream os = connection.getOutputStream();
for ( int i = 0; i  10; i++ ) {
   os.write( 1 );
   os.flush();
   Thread.sleep( 1000 );
}
os.close();
log.debug( response: + connection.getResponseCode() );
log.debug( response: + connection.getResponseMessage() );
connection.disconnect();

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: CometProcessor proxied through Apache httpd

2010-01-27 Thread Stephen Byrne

Robin Wilson wrote:

Where are you putting the ProxyPass (which file, where in the file)?

Also, did you have this in the file somewhere before the ProxyPass:

LoadModule proxy_ajp_module modules/mod_proxy_ajp.so

AND... In your Apache modules directory, is there a 'mod_proxy_ajp.so' file?

Lastly, this is what our connector looks like in the 'server.xml' file for the 
tomcat instance:

Connector port=8009 protocol=AJP/1.3
   /

So I'm not sure if the 'address' is causing the problem or not.

Keep in mind, 'proxy' (and AJP) don't work the same as HTTP exactly. The 
rewrites will just re-point your browser to use the new URL (so rewriting to an 
'ajp://' protocol will break the browser - since it doesn't speak 'ajp' 
protocol). The proxy actually passes the request _through_ the Apache HTTP 
process - to the Tomcat's AJP process - so the browser only talks 'http' to the 
Apache service, while Apache talks 'ajp' to the Tomcat service. It's the 
difference of:

Browser --HTTP request-- Apache
Browser --HTTP (redirect to Tomcat path)-- Apache
Browser --HTTP request-- Tomcat
Browser --HTTP response-- Tomcat

vs.

Browser --HTTP request-- Apache --AJP (proxied request)-- Tomcat
Browser --HTTP response-- Apache --AJP (proxied response)-- Tomcat

(I'll admit, I could be wrong on this - but that's how I think it works...)


I do have proxy_ajp_module loaded.
I have the ProxyPass (or RewriteRule) in a VirtualHost
The [P] at the end of the RewriteRule causes Apache to pass the request 
through the proxy - not to send a redirect to the browser.


Have you successfully used a CometProcessor behind an AJP proxy?

-Stephen



--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
CELL: 512-426-3929
DESK: 512-623-5913
www.KingsIsle.com


-Original Message-
From: Stephen Byrne [mailto:step...@lincware.com] 
Sent: Wednesday, January 27, 2010 9:54 AM

To: Tomcat Users List
Subject: Re: CometProcessor proxied through Apache httpd

Robin Wilson wrote:

Have you tried using mod_proxy_ajp?

ProxyPass /some/path ajp://tomcat.host.domain:8009/some/other/path


Yes, I did try this, and got the same results as using RewriteRule - a 
405 error.



--
Robin D. Wilson
Director of Web Development
KingsIsle Entertainment, Inc.
CELL: 512-426-3929
DESK: 512-623-5913
www.KingsIsle.com

-Original Message-
From: Stephen Byrne [mailto:step...@lincware.com] 
Sent: Wednesday, January 27, 2010 9:27 AM

To: users@tomcat.apache.org
Subject: CometProcessor proxied through Apache httpd

Is there a way to get CometProcessor to work when proxying through 
Apache httpd? Here is what I have tried:


I have an HttpServlet implementing CometProcessor.

When I have a Tomcat connector like this:

Connector port=8912 protocol=HTTP/1.1
   address=192.168.1.30 /

and I connect to it directly, everything works wonderfully - I get 
CometEvent.EventType.READ events as I send data from the client.



When I have a Tomcat connector like this:

Connector port=8911 protocol=HTTP/1.1
   address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet http://localhost:8911/path/to/servlet [P]

I get exactly one CometEvent.EventType.READ event with all of the data 
after I finish sending data from the client.



When I have a Tomcat connector like this:
Connector port=8909 protocol=AJP/1.3
   address=127.0.0.1 /

and have Apache httpd proxy requests like this:

RewriteRule ^/path/to/servlet ajp://localhost:8909/path/to/servlet [P]

I get zero CometEvents and the client gets an HTTP error 405 (Method Not 
Allowed). I was hoping that AJP would work so I could try using 
ProxyPass with flushpackets=on, but the Apache documentation says that 
only works with AJP.



If I use Http11NioConnector instead of HTTP/1.1 and try to proxy with 
Apache, I get the same results as if I were using the HTTP/1.1 connector.


My client code (Java) is:

// Direct to Tomcat (HTTP)
//URL url = new URL( http://server:8912/path/to/servlet; );
// Apache proxies to Tomcat
URL url = new URL( http://server/path/to/servlet; );
HttpURLConnection connection = (HttpURLConnection)
   url.openConnection();
connection.setChunkedStreamingMode( 1 );
connection.setDoOutput( true );
connection.setDoInput( true );
connection.connect();
OutputStream os = connection.getOutputStream();
for ( int i = 0; i  10; i++ ) {
   os.write( 1 );
   os.flush();
   Thread.sleep( 1000 );
}
os.close();
log.debug( response: + connection.getResponseCode() );
log.debug( response: + connection.getResponseMessage() );
connection.disconnect();

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

RE: Importing CERTIFICATE into Java Keystore

2009-11-20 Thread Stephen .


Hi again,

I got the LDAP connection working on my IDM.

Test Connection Succeeded


However, when I try to create a new User on the LDAP Resource, I get the 
following error :


javax.naming.CommunicationException: 
sun.security.validator.ValidatorException: PKIX path building failed: 


sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
valid 
certification path to requested target



Do you have an idea what this could mean?

Thanks


Regards

Stephen





 Date: Thu, 19 Nov 2009 15:22:07 -0500
 From: ch...@christopherschultz.net
 To: marr...@hotmail.com
 CC: users@tomcat.apache.org
 Subject: Re: Importing CERTIFICATE  into Java Keystore
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Stephen,
 
 On 11/19/2009 2:42 AM, Stephen . wrote:
  My JAVA folder has 3 different locations which contain the command KEYTOOL
  
  I don't even know which of them is supposed to hold the certificate.
 
 None of those hold any certificates: they are just programs that operate
 on files called keystores. A keystore is a specially-formatted file
 that contains one or more certificates and keys. You can create a new
 one or use an existing one.
 
 Typically, your JVM has a system-level keystore installed that contains
 all of the special top-level certificates from the big guys like
 VeriSign and Thawte. That allows your JVM to trust certificates signed
 by those certificate authorities. X.509 (which is what all this stuff is
 defined as) is built on a tree of trust where a small number of
 implicitly-trusted entities (VeriSign, Thawte, etc.) are allowed to
 dictate who is and who is not trusted on the web via these certificates.
 It's a great racket.
 
  Yesterday, just to be on the safe side, I imported my certificate into
  ALL 3 locations (under 3 different aliases)
 
 The real question was which keystore you were operating on. From the
 'keytool' manual page:
 
 
 Each keytool command has a -keystore option for specifying the name and
 location of the persistent keystore file for the keystore managed by
 keytool. The keystore is by default stored in a file named .keystore
 in the user's home directory, as determined by the user.home system
 property.
 
 
 So, do you have a file in ~/.keystore? If so, it's likely to be the
 place where all the certificates you are (re-)importing are going. You
 need to configure this keystore to be the one that is used for your JNDI
 connection. How are you configuring your JNDI resource? Please post the
 configuration (minus any passwords, of course) and tell us where that
 configuration appears.
 
  Then I found yet another command online which says that, it's not enough
  to import the certificate into keystore.  It needs to be imported
  directly into the CACERT file.
 
 That sounds like malarkey.
 
  To make matters even worse, I found yet another advice in Tomcat's
  documentation, saying : before importing the certificate, you need to
  first import a so-called TRUST CHAIN.
 
 That may be possible. See... the big guys like VeriSign don't have just
 a single certificate/key that they use to sign your certificate(s): they
 have dozens. That is, in the tree of trust, there are many branches.
 There are many reasons for that which I won't go into, here. Basically,
 VeriSign's top-level cert (and they have more than one) trusts
 VeriSign's mid-level certs, which in turn trust VeriSign's lowest-level
 cert, which trusts you.
 
 If you want the JVM to trust your certificate, you need to provide your
 certificate (duh!) plus the 2 intervening (chain) certificates to
 bridge the chain of trust from your cert to the top-level VeriSign cert
 that ships with the JVM.
 
  In some places, it says you need this trust chain if the certificate was
  applied for by yourself.
 
 That statement is a bit ambiguous.
 
  is it:
  *keytool -import -file tomcatCert.crt -trustcacerts
  -alias tomcat -keystore c:/apps/jdk/jre/lib/security/cacerts -storepass
  changeit*
  
  or is it  :   * keytool -import -alias root -keystore
  your_keystore_filename -trustcacerts -file
  filename_of_the_chain_certificate*
 
 It's both, or neither :)
 
 Usually, you don't want to modify the keystore that came with the JVM
 (that's c:/apps/jdk/jre/lib/security/cacerts). Why? Because if you
 upgrade your JVM, then you're trusted certs will appear to vanish
 because the new JVM ships with a new cacerts file which doesn't include
 your changes.
 
 What would be best is something like this (the \s in here are a
 *NIX-style command continues on the next line convention... they are
 not intended to be actually entered on the command line, but indicate
 that you shouldn't press ENTER at the end of each line of text):
 
 keytool -import  \
 -file chain-1-cert.crt   \
 -trustcacerts\
 -alias chain-1   \
 -keystore path\to\my\keystore
 
 (then enter the password when prompted)
 
 This will import one of the chain

RE: Importing CERTIFICATE into Java Keystore

2009-11-19 Thread Stephen .


Chris,

thank you for your reply.

And thank you so much for taking the time and trouble to explain all this to me.

I really don't know much about JNDI.  I don't even know where and how it is 
configured. 

But, I am going to try your suggestions, and see if it works out.

If you want, I could keep you posted on this.

Thanks again.


Regards

Stephen





 Date: Thu, 19 Nov 2009 15:22:07 -0500
 From: ch...@christopherschultz.net
 To: marr...@hotmail.com
 CC: users@tomcat.apache.org
 Subject: Re: Importing CERTIFICATE  into Java Keystore
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Stephen,
 
 On 11/19/2009 2:42 AM, Stephen . wrote:
  My JAVA folder has 3 different locations which contain the command KEYTOOL
  
  I don't even know which of them is supposed to hold the certificate.
 
 None of those hold any certificates: they are just programs that operate
 on files called keystores. A keystore is a specially-formatted file
 that contains one or more certificates and keys. You can create a new
 one or use an existing one.
 
 Typically, your JVM has a system-level keystore installed that contains
 all of the special top-level certificates from the big guys like
 VeriSign and Thawte. That allows your JVM to trust certificates signed
 by those certificate authorities. X.509 (which is what all this stuff is
 defined as) is built on a tree of trust where a small number of
 implicitly-trusted entities (VeriSign, Thawte, etc.) are allowed to
 dictate who is and who is not trusted on the web via these certificates.
 It's a great racket.
 
  Yesterday, just to be on the safe side, I imported my certificate into
  ALL 3 locations (under 3 different aliases)
 
 The real question was which keystore you were operating on. From the
 'keytool' manual page:
 
 
 Each keytool command has a -keystore option for specifying the name and
 location of the persistent keystore file for the keystore managed by
 keytool. The keystore is by default stored in a file named .keystore
 in the user's home directory, as determined by the user.home system
 property.
 
 
 So, do you have a file in ~/.keystore? If so, it's likely to be the
 place where all the certificates you are (re-)importing are going. You
 need to configure this keystore to be the one that is used for your JNDI
 connection. How are you configuring your JNDI resource? Please post the
 configuration (minus any passwords, of course) and tell us where that
 configuration appears.
 
  Then I found yet another command online which says that, it's not enough
  to import the certificate into keystore.  It needs to be imported
  directly into the CACERT file.
 
 That sounds like malarkey.
 
  To make matters even worse, I found yet another advice in Tomcat's
  documentation, saying : before importing the certificate, you need to
  first import a so-called TRUST CHAIN.
 
 That may be possible. See... the big guys like VeriSign don't have just
 a single certificate/key that they use to sign your certificate(s): they
 have dozens. That is, in the tree of trust, there are many branches.
 There are many reasons for that which I won't go into, here. Basically,
 VeriSign's top-level cert (and they have more than one) trusts
 VeriSign's mid-level certs, which in turn trust VeriSign's lowest-level
 cert, which trusts you.
 
 If you want the JVM to trust your certificate, you need to provide your
 certificate (duh!) plus the 2 intervening (chain) certificates to
 bridge the chain of trust from your cert to the top-level VeriSign cert
 that ships with the JVM.
 
  In some places, it says you need this trust chain if the certificate was
  applied for by yourself.
 
 That statement is a bit ambiguous.
 
  is it:
  *keytool -import -file tomcatCert.crt -trustcacerts
  -alias tomcat -keystore c:/apps/jdk/jre/lib/security/cacerts -storepass
  changeit*
  
  or is it  :   * keytool -import -alias root -keystore
  your_keystore_filename -trustcacerts -file
  filename_of_the_chain_certificate*
 
 It's both, or neither :)
 
 Usually, you don't want to modify the keystore that came with the JVM
 (that's c:/apps/jdk/jre/lib/security/cacerts). Why? Because if you
 upgrade your JVM, then you're trusted certs will appear to vanish
 because the new JVM ships with a new cacerts file which doesn't include
 your changes.
 
 What would be best is something like this (the \s in here are a
 *NIX-style command continues on the next line convention... they are
 not intended to be actually entered on the command line, but indicate
 that you shouldn't press ENTER at the end of each line of text):
 
 keytool -import  \
 -file chain-1-cert.crt   \
 -trustcacerts\
 -alias chain-1   \
 -keystore path\to\my\keystore
 
 (then enter the password when prompted)
 
 This will import one of the chain certificates you may need to import
 for whoever signed your certificate. Who did sign it, by the way? Repeat
 that command for each

Importing CERTIFICATE into Java Keystore

2009-11-18 Thread Stephen .


Hi.

I have an IDM instance setup. 

I am currently trying to configure and set-up an LDAP Resource.

During the configuration, I got the error :


Could not connect to the LDAP server api.csc.fi. == 
javax.naming.CommunicationException: simple bind failed: api.csc.fi:636



Upon extensive research (on Tomcat websites, as well as Forums), I got
the notion that I needed to import the ldapCertificate into my JAVA
Keystore, otherwise it would be impossible for IDM to successfully
connect to LDAP.



I am using Apache Tomcat as my application server. I was able to locate
several online documents which explained how to import a trusted
certificate into the Keystore (unfortunately, these documents seem to
give several different solutions to the same problem).



Eventually, I decided to use the following command at my command-prompt :





 keytool -importcert -alias abc -file ABCCA.cer (where abc is the alias)



The import was successful. 


However, I am still getting the same error on my LDAP configuration.

Am I doing something wrong?  Is there something ELSE I need to do ?


Best regards,

Stephen
  
_
Windows Live Hotmail: Your friends can get your Facebook updates, right from 
Hotmail®.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_4:092009

Expression Language Changes

2009-11-18 Thread Stephen Caine
Where can I find a full and complete list of changes made to the expression 
language (EL) starting with Tomcat v5.5.7 through Tomcat v6.0.20?  I need for 
this to be a detailed as possible.

Thank you,

Stephen Caine
CommonGround Softworks, Inc.
-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Expression Language Changes

2009-11-18 Thread Stephen Caine
Mark,

Thank you.  I'll check it out.
 
 Where can I find a full and complete list of changes made to the expression 
 language (EL) starting with Tomcat v5.5.7 through Tomcat v6.0.20?  I need 
 for this to be a detailed as possible.
 
 http://svn.apache.org/viewvc/tomcat/


RE: Importing CERTIFICATE into Java Keystore

2009-11-18 Thread Stephen .


Thanks for your response,

No, I don't know any of these things.  This is why I am so confused!!   

My JAVA folder has 3 different locations which contain the command KEYTOOL

I don't even know which of them is supposed to hold the certificate.

Yesterday, just to be on the safe side, I imported my certificate into ALL 3 
locations (under 3 different aliases)

Still did not work.

Then I found yet another command online which says that, it's not enough to 
import the certificate into keystore.  It needs to be imported directly into 
the CACERT file.

But, it does not say HOW this should be done!!


To make matters even worse, I found yet another advice in Tomcat's 
documentation, saying : before importing the certificate, you need to first 
import a so-called TRUST CHAIN. 

In some places, it says you need this trust chain if the certificate was 
applied for by yourself. 

In some places, it does not mention the trust chain at all, if you already 
trust the certificate.


So, what exactly is the CORRECT way to do this?

And what is the right command???


is it  :   keytool -import -file tomcatCert.crt -trustcacerts -alias tomcat 
-keystore c:/apps/jdk/jre/lib/security/cacerts -storepass changeit

or is it  :keytool -import -alias root -keystore your_keystore_filename 
-trustcacerts -file filename_of_the_chain_certificate

or : keytool -import -alias tomcat -keystore your_keystore_filename -file 
your_certificate_filename

or :  keytool -importcert -alias abc -file ABCCA.cer



Which is it ???

And what is the difference between KEYSTORE and CACERT 


I am just so confused!!







 Date: Wed, 18 Nov 2009 15:00:17 -0500
 From: ch...@christopherschultz.net
 To: users@tomcat.apache.org
 Subject: Re: Importing CERTIFICATE  into Java Keystore
 
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Stephen,
 
 On 11/18/2009 3:26 AM, Stephen . wrote:
 
   keytool -importcert -alias abc -file ABCCA.cer (where abc is the 
  alias)
 
 You need to make sure that the keystore file you used to import the
 certificate is also the keystore used by the LDAP resource.
 
 Do you know what keystore into which you imported your cert?
 Do you know what keystore is being used by the LDAP resource?
 
 - -chris
 -BEGIN PGP SIGNATURE-
 Version: GnuPG v1.4.10 (MingW32)
 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
 
 iEYEARECAAYFAksEUlEACgkQ9CaO5/Lv0PCpogCcDEhSp2nvPErskak6mbdkpJqR
 PD8AnjglMawq8ag9j3YTh9HefruQ4oLY
 =TR5G
 -END PGP SIGNATURE-
 
 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org
 
  
_
Windows Live: Keep your friends up to date with what you do online.
http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_1:092010

Re: IE + Flash + mod_jk issue

2009-05-13 Thread Stephen More
On Tue, May 12, 2009 at 4:58 PM, Rainer Jung  wrote:
 On 12.05.2009 22:33, Stephen More wrote:
 I have a flash application ( Macromedia Breeze Presentation ) that is
 working fine when I access it directly from tomcat's port 8080.

 When I access it through apache using mod_jk, IE loads some of the
 flash files, but not all.
 The problem is only appearing with IE, it is working fine with Firefox.

 Here are my options:
 JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories

 Could this be a mod_jk issue or should I be looking at something else ?

I found a solution.

I needed to remove the following from my apache httpd config:
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/html

I guess a better solution might be:
  http://www.robertswarthout.com/2007/05/ie-6-apache-mod_deflate-blank-pages/

-Steve

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



IE + Flash + mod_jk issue

2009-05-12 Thread Stephen More
I have a flash application ( Macromedia Breeze Presentation ) that is
working fine when I access it directly from tomcat's port 8080.

When I access it through apache using mod_jk, IE loads some of the
flash files, but not all.
The problem is only appearing with IE, it is working fine with Firefox.

Here are my options:
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories

Could this be a mod_jk issue or should I be looking at something else ?

Any help is appreciated.
-Thanks
Steve More

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with maximum threads

2009-04-21 Thread Stephen Caine

Anand,

As others will surely tell you, there is something amiss in your  
application that spawns threads.  However, the maximum number of  
threads Tomcat will handle is somewhere about 2400.  So, if you are  
getting an error at 1000 threads, look somewhere else.


Stephen Caine
Soft Breeze Systems, LLC

On Apr 21, 2009, at 7:34 AM, connossieur wrote:



Hi,

I am using Tomcat 6.0.9 with the following server.xml config file:

The Java version I am using is JDK1.6.0_06.
The problem is with the tomcat web app being used for a load test at  
200
messages/sec. The application runs well enough for half an hour but  
after
that time, the CPU consumption is maximum and idle is 0. Also, there  
are
more than 1000 threads even if I have configured the maximum threads  
to be

70 in the configuration. There is no problem in the application code.

Where can be the problem in the Tomcat?
Thanks,
Anand
--
View this message in context: 
http://www.nabble.com/Problem-with-maximum-threads-tp23154175p23154175.html
Sent from the Tomcat - User mailing list archive at Nabble.com.



-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Problem with maximum threads

2009-04-21 Thread Stephen Caine

Chuck,

This is the number of threads Tomcat will handle before it errors with  
'max threads reached.  This is on OS X, 64 bit memory.  The heap size  
is 2 gigs.


If you know how to increase this number, then please provide the  
information.  Others have also noted this limit on OS X in previous  
posts to this list.


Stephen

On Apr 21, 2009, at 9:38 AM, Caldarale, Charles R wrote:


From: Stephen Caine [mailto:step...@commongrnd.com]
Subject: Re: Problem with maximum threads

However, the maximum number of threads Tomcat will
handle is somewhere about 2400.


I'm curious: where did you conjure up that number?  The actual limit  
will vary greatly depending on platform, JVM level, heap size, heap  
usage, and especially 32- or 64-bit environments.


- Chuck


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




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebdavServlet + custom DirContext = unexpected behaviour

2009-02-15 Thread Stephen Winnall

On 14 Feb 2009, at 21:04, Mark Thomas wrote:


Stephen Winnall wrote:


Context
  Resources className=org.vimia.xw.db.dircontext.DBDirContext /
  Resource name=jdbc/xwdb auth=Container
type=javax.sql.DataSource
driverClassName=org.postgresql.Driver
url=...
username=... password=... maxActive=20 maxIdle=10
maxWait=-1/
/Context


If you replace the DirContext implementation, Tomcat will look in your
database for WEB-INF/web.xml which is where the WebDAV servlet needs  
to

be defined. Did you include this resource (and any other required
WEB-INF resources) in your database?


So WEB-INF/web.xml *does* have to be in the database. Does this mean  
that the whole servlet context has to be in the database? Duh, is this  
why it is called DirContext?



I assume your context.xml file is under:
CATALINA_BASE/engine name/host name/


It's under CATALINA_BASE/conf/engine name/host name/, but I guess  
that's what you meant.


Thanks for your help, Mark. This means a major re-think for me, but at  
least I now know what I have to think about!


Steve


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebdavServlet + custom DirContext = unexpected behaviour

2009-02-13 Thread Stephen Winnall

Thanks for your feedback.

On 13 Feb 2009, at 05:04, Caldarale, Charles R wrote:


From: Stephen Winnall [mailto:st...@winnall.ch]
Subject: WebdavServlet + custom DirContext = unexpected behaviour

My Tomcat is as installed by NetBeans 6.5, that is
with a separate CATALINA_HOME and CATALINA_BASE.


I'd strongly recommend that you first learn how to run Tomcat  
directly, outside of any IDE, before muddying the picture with an  
extra layer of obfuscation.  Problem solving will be much simpler.


Fair comment. So I have now installed Tomcat 6.0.18 from scratch.





I modified $CATALINA_BASE/conf/catalina.properties to make
common.loader look also in $CATALINA_BASE/common/lib and I
put DBDirContext and supporting cast into there.


Now you've already gone off the deep end; that's not something you  
should have to (or want to) do.  By default, there is no common/lib  
in Tomcat 6.0, and you don't need to resurrect the past.  Any jars  
or classes Tomcat needs access to should be in Tomcat's lib  
directory, nowhere else.  If you provide a replacement for the  
default Resources handler, it must go into Tomcat's lib directory,  
since it's used by Tomcat, not the webapp.


I did originally put everything into $CATALINA_HOME/lib. However, I  
like to keep my stuff separate from the base product, which is why I  
had created a separate folder.


However, with my new installation I put DBDirContext and friends into  
$CATALINA_HOME/lib as you suggest.


When I started up the new installation, I got exactly the same  
behaviour as before.






The Tomcat documentation suggests that changing the
Resources .../ to something other than the filesystem
results in Tomcat not being able to read files it needs:


Not true - it says the *webapp* won't be able to access the file  
system; it says nothing about Tomcat's ability to do so.


Thanks, that has cleared up an uncertainty for me.





do I have to make a hybrid DBDirContext that gets the
files Tomcat needs from the filesystem and the data I
want from the database?


I don't think so.  Start over with a clean Tomat install (not the  
one bundled with the IDE) and go from there.


Done that and there's no change in behaviour. When I switch on the  
Resources handler, the OPTIONS request is apparently handled out of  
HttpServlet; when I switch it off, it is handled out of WebdavServlet.


Steve


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: WebdavServlet + custom DirContext = unexpected behaviour

2009-02-13 Thread Stephen Winnall

Can anyone help me with this? I'm completely stuck!

I have a Tomcat 6.0.18 installation with WebdavServlet enabled. If I  
use the following Context file, WebDAV works OK:


Context
   Resource name=jdbc/xwdb auth=Container
 type=javax.sql.DataSource  
driverClassName=org.postgresql.Driver

 url=...
 username=... password=... maxActive=20 maxIdle=10  
maxWait=-1/

/Context

However, I want to use WebDAV to access a database, so I've written my  
own DirContext. I declare the DirContext as a Resources handler in  
the Context file as follows:


Context
   Resources className=org.vimia.xw.db.dircontext.DBDirContext /
   Resource name=jdbc/xwdb auth=Container
 type=javax.sql.DataSource  
driverClassName=org.postgresql.Driver

 url=...
 username=... password=... maxActive=20 maxIdle=10  
maxWait=-1/

/Context

But when I do this, WebdavServlet is ignored and HTTP sessions are  
created with HttpServlet / DefaultServlet, which fail, of course,  
because they know nothing about WebDAV. The Resources handler seems  
effectively to make WebdavServlet invisible...


I've googled for just about every combination of dirContext,  
classloader, Tomcat 6, resources, context.xml, WebdavServlet. There  
are 2 people who have asked before about how to access a database from  
WebdavServlet, but no answers.


I guess I'm missing something dead simple, but I don't know what to  
look for.


Steve


On 13 Feb 2009, at 13:33, Stephen Winnall wrote:


Thanks for your feedback.

On 13 Feb 2009, at 05:04, Caldarale, Charles R wrote:


From: Stephen Winnall [mailto:st...@winnall.ch]
Subject: WebdavServlet + custom DirContext = unexpected behaviour

My Tomcat is as installed by NetBeans 6.5, that is
with a separate CATALINA_HOME and CATALINA_BASE.


I'd strongly recommend that you first learn how to run Tomcat  
directly, outside of any IDE, before muddying the picture with an  
extra layer of obfuscation.  Problem solving will be much simpler.


Fair comment. So I have now installed Tomcat 6.0.18 from scratch.





I modified $CATALINA_BASE/conf/catalina.properties to make
common.loader look also in $CATALINA_BASE/common/lib and I
put DBDirContext and supporting cast into there.


Now you've already gone off the deep end; that's not something you  
should have to (or want to) do.  By default, there is no common/lib  
in Tomcat 6.0, and you don't need to resurrect the past.  Any jars  
or classes Tomcat needs access to should be in Tomcat's lib  
directory, nowhere else.  If you provide a replacement for the  
default Resources handler, it must go into Tomcat's lib  
directory, since it's used by Tomcat, not the webapp.


I did originally put everything into $CATALINA_HOME/lib. However, I  
like to keep my stuff separate from the base product, which is why I  
had created a separate folder.


However, with my new installation I put DBDirContext and friends  
into $CATALINA_HOME/lib as you suggest.


When I started up the new installation, I got exactly the same  
behaviour as before.






The Tomcat documentation suggests that changing the
Resources .../ to something other than the filesystem
results in Tomcat not being able to read files it needs:


Not true - it says the *webapp* won't be able to access the file  
system; it says nothing about Tomcat's ability to do so.


Thanks, that has cleared up an uncertainty for me.





do I have to make a hybrid DBDirContext that gets the
files Tomcat needs from the filesystem and the data I
want from the database?


I don't think so.  Start over with a clean Tomat install (not the  
one bundled with the IDE) and go from there.


Done that and there's no change in behaviour. When I switch on the  
Resources handler, the OPTIONS request is apparently handled out  
of HttpServlet; when I switch it off, it is handled out of  
WebdavServlet.


Steve


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



WebdavServlet + custom DirContext = unexpected behaviour

2009-02-12 Thread Stephen Winnall
I'm developing my first ever servlet for Tomcat 6.0.18 under Mac OS X  
10.5.6 with Java 1.5.0_16. I've used Tomcat a lot with Cocoon and I  
know Java reasonably well.


I'd like to extend the standard WebdavServlet that comes with Tomcat  
to access data from a relational database using JDBC. I've started to  
write a DirContext (called DBDirContext) to do this. I've written a  
test servlet


public class DBServlet extends WebdavServlet {...}

and filled it with methods which print out a message and invoke their  
super methods:


... xxx(...) {
System.out.println(some text);
super.xxx(...);
}

i.e. I just want a trace on standard output of what WebDAV calls so I  
know what bits of DBDirContext to develop next.


My Tomcat is as installed by NetBeans 6.5, that is with a separate  
CATALINA_HOME and CATALINA_BASE. I have discovered that my  
DBDirContext and supporting database stuff is not found if I include  
it in the WAR file deployed into $CATALINA_BASE/webapps, so I modified  
$CATALINA_BASE/conf/catalina.properties to make common.loader look  
also in $CATALINA_BASE/common/lib and I put DBDirContext and  
supporting cast into there.


If I put the following file into META-INF/context.xml, I can call  
DBServlet over an HTTP session and successfully mount a WebDAV disk  
using the filesystem:


Context
Resource name=jdbc/xwdb auth=Container
  type=javax.sql.DataSource  
driverClassName=org.postgresql.Driver

  url=...
  username=... password=... maxActive=20 maxIdle=10  
maxWait=-1/

/Context

All of my output to standard output appears in the log.

However, when I include Resources... / to pull in DBDirContext as  
follows, WebDAV gets as far as an initial OPTIONS method and gives up:


Context
Resources className=org.vimia.xw.db.dircontext.DBDirContext /
Resource name=jdbc/xwdb auth=Container
  type=javax.sql.DataSource  
driverClassName=org.postgresql.Driver

  url=...
  username=... password=... maxActive=20 maxIdle=10  
maxWait=-1/

/Context

The trace I built in does not appear on standard output in this case.  
Examining the response to the OPTIONS method, I see that WebDAV  
generates a response from doOptions in HttpServlet and not from the  
overriding one in WebdavServlet.


So WebdavServlet and my DBServlet seem to be being ignored. I don't  
understand why and I'd be grateful if someone could give me some  
pointers. The Tomcat documentation suggests that changing the  
Resources .../ to something other than the filesystem results in  
Tomcat not being able to read files it needs: does this include my JAR  
files? If so, do I have to make a hybrid DBDirContext that gets the  
files Tomcat needs from the filesystem and the data I want from the  
database?


Steve





Re: Apache Tomcat 6.0 loads blank page

2009-02-01 Thread Stephen Souness

Hi.

I believe the error will be preventing Tomcat from starting - which is 
why the restart attempt is failing when it attempts to connect to the 
shutdown port - according to the log posted.


Find and fix the XML issue, then you should be good to get Tomcat started.


--
Stephen Souness


André Warnier wrote:

What do you mean the logs are not informative ?
I am no Tomcat expert to interpret the log exactly, but my guess is that 
you have an XML error right into your conf/server.xml file, which is the 
main Tomcat configuration file.  I am quite surprised that Tomcat is 
starting at all.


SEVERE: Parse Fatal Error at line 71 column 8: Comment must start with
 
You may want to have a look at the position indicated above.
if it is not in server.xml, it is obviously in some other XML file which 
Tomcat tries to read at startup.


zia mohades wrote:

Hi again:

Andre thank you for your email:

1) when I check the logs I see the follwoing

   for localhost logs :1-Feb-2009 4:16:04 PM
org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()

   for catalina logs:  I have this:
1-Feb-2009 5:01:42 PM org.apache.tomcat.util.digester.Digester fatalError
SEVERE: Parse Fatal Error at line 71 column 8: Comment must start with
!--.
org.xml.sax.SAXParseException: Comment must start with !--.
at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) 


at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174) 


at
com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:388) 


at
com.sun.org.apache.xerces.internal.impl.XMLScanner.reportFatalError(XMLScanner.java:1411) 


at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.startOfMarkup(XMLDocumentFragmentScannerImpl.java:2577) 


at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2695) 


at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648) 


at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) 


at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807) 


at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) 


at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107) 


at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) 


at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) 


at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:516)
at org.apache.catalina.startup.Catalina.start(Catalina.java:570)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
1-Feb-2009 5:01:42 PM org.apache.catalina.startup.Catalina load
WARNING: Catalina.start using conf/server.xml:
org.xml.sax.SAXParseException: Comment must start with !--.
at
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1231) 


at
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) 


at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1644)
at org.apache.catalina.startup.Catalina.load(Catalina.java:516)
at org.apache.catalina.startup.Catalina.start(Catalina.java:570)
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:597)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
1-Feb-2009 5:01:42 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 0 ms

   but again, I can successfully access http://localhost:8080 and 
blank for
http://localhost:8080/mms_test. so the log files are not very 
informative.


2) I have downloaded LiveHttpHeaders plugin and followed your 
instructions.

Believe it or not when I access http://localhost:8080/mms_test or
http://localhost:8080 or http://localhost:8080

Re: Tomcat 6.0 loading servlet twice

2009-01-29 Thread Stephen Souness

Hi,

If you go in via Tomcat's Manager app, do you see more webapps than you 
expect?


A long time ago I made the mistake of deploying apps under the webapps 
directory as well as configuring them with their own context - this 
resulted in those particular applications being loaded twice.


Also, make sure you clean out Tomcat's work directory - just to be sure 
that your config changes are taking effect.


--
Stephen Souness


Ani wrote:



On Thu, Jan 29, 2009 at 11:40, Ani jadhao.anirud...@gmail.com wrote:


Hello,
I have a web application in which I am facing one wiered pbm. I see tomcat
loading servlet twice , on which my application logic is failing and quits.
Getting below error in log file.
My findings : One thing I did was , inside comp folder I made a copy of
website folder and renamed it to website_old. Now both folders contains
servlet.jar. Will it be causing a pbm???
==
Jan 29, 2009 10:48:34 AM org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO: validateJarFile(.\comp\website_old\WEB-INF\lib\servlet.jar) - jar no

t loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
==


I have
Server.xml has an entry of below

Context docBase=C:\Program Files\Avaya/comp/website path=/website
reloadable=false crossContext=true /

So tomcat should look for website folder in the specified directory, but
in the C:\Program Files\Avaya/comp directory, there are two directories ,
website and website_old.
Why tomcat is searching for C:\Program Files\Avaya/comp/website_old
application if it gets the C:\Program Files\Avaya/comp/website . ??
I have tomcat6.

Any reason??
--Ani








-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: javax.naming.NameNotFoundException: Name jdbc is not bound in this Context

2009-01-29 Thread Stephen Souness

Which lib did you put your jars in?

The web app's or Tomcat's?


--
Stephen Souness

Hamacher, Eric wrote:

Hello:

This has been a truly frustrating problem.  Here is what I did:

Tomcat 6.0.18
JDK 1.5 u 16
Eclipse w/ WTP 3.4.1
Ojdbc14dms.jar
Dms.jar

I placed my drivers in lib.

In web.xml, I put

resource-ref
  res-ref-namejdbc/GFDataSource/res-ref-name
  res-typejavax.sql.DataSource/res-type
  res-authContainer/res-auth
/resource-ref

I placed the following in three different places, conf/server.xml, 
conf/context.xml, and in a context file in my app's META-INF directory:

  Resource name=jdbc/GFDataSource auth=Container
type=javax.sql.DataSource
maxActive=30
maxIdle=2
maxWait=1000
username=username
password=password
driverClassName=oracle.jdbc.OracleDriver
uri=jdbc:oracle:thin:@aserver:2224:DB/

For driverClassName, I've also tried oracle.jdbc.driver.OracleDriver.

This application works on other servers.

Please help!

J.  ERIC  HAMACHER
Software Application Developer
608.664.3859
8476 Greenway Boulevard
Suite 100
Middleton, WI  53562
USA
GALLUP Technology

Achiever | Learner | Restorative | Intellection | Deliberative





-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-28 Thread Stephen Caine

Chris,


This is very helpful.  It strongly suggests the issue is memory  
management, not JFreeChart.


I'd put my money on bad hardware. Every single time I've seen a  
release version of a JVM fail, it's because of bad memory, CPU,  
motherboard, or the combination thereof.


I recommend trying the same code and configuration on a separate  
physical machine to see if that might be the problem. Does Mac have  
anything like memtest86? Can you even run that on x86-based Macs?


My initial presumption was bad memory, but after running a very  
intensive memory test (provided by Apple), no problems were found.   
Also, no other process results in a JVM crash.  Only when JFreeChart  
is run does the JVM crash.  This is an X-Serve, dual core intel that  
has 12 gigs of RAM running OS X 10.5.


Stephen Caine
Soft Breeze Systems, LLC

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: HTTP status 404 - Context config

2009-01-28 Thread Stephen Vaughan
Nevermind, I've resolved it.

thank you for replying.

On Wed, Jan 28, 2009 at 2:04 AM, Caldarale, Charles R 
chuck.caldar...@unisys.com wrote:

  From: Stephen Vaughan [mailto:stephenvaug...@gmail.com]
  Subject: HTTP status 404 - Context config
 
  I'm having trouble setting up a context with jdbc.postgresql

 What version of Tomcat?

 What vendor and version of JVM?

 What platform?

 Where is your Context element located?

 What's in the Tomcat logs?

 (Don't muck with log4j unless your webapp requires it - start over with a
 clean install of Tomcat.)

  - Chuck


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

 -
 To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
 For additional commands, e-mail: users-h...@tomcat.apache.org




-- 
Best Regards,
Stephen


HTTP status 404 - Context config

2009-01-26 Thread Stephen Vaughan
Hi,

I'm having trouble setting up a context with jdbc.postgresql (noob). As far
as I know the context is fine, but when I have it enabled all pages are
returning HTTP Status 404 - *The requested resource () is not available.

*My context:

Context path=/path
   docBase=path
   debug=5
   reloadable=true
   crossContext=true

   Resource   name=jdbc/path
auth=Container
type=javax.sql.DataSource
maxActive=100
maxIdle=10
maxWait=1
username=user
password=password
driverClassName=org.postgresql.Driver
url=jdbc:postgresql://
123.123.123.123:5432/databasePRODUCTION/
/Context

I have placed postgresql-8.3-604.jdbc4.jar in $tomcat/lib/. Tried setting up
log4j to help better diagnose the problem, but it's not producing anything
useful in the logs. I'm using the log4j example from this page:
http://tomcat.apache.org/tomcat-6.0-doc/logging.html

Please help!

-- 
Best Regards,
Stephen


Java Crash

2009-01-23 Thread Stephen Caine

All,

Whenever I attempt to access a charting jsp, I get an invalid memory  
access error and the JVM just crashes.  Here are the relevant portions  
of the java crash log.  Any thoughts would be appreciated.  Is this an  
Apple Java issue??


Stephen Caine
CommonGround Softworks, Inc.

___

Process: java [67620]
Path:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Home/bin/java
Identifier:  java
Version: ??? (???)
Code Type:   X86-64 (Native)
Parent Process:  launchd [1]

Date/Time:   2009-01-21 14:53:08.281 -0500
OS Version:  Mac OS X Server 10.5.5 (9F33)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0001b6f272f8
Crashed Thread:  28

Application Specific Information:

Java information:
Exception type: Bus Error (0xa) at pc=0x0001010a633d

Java VM: Java HotSpot(TM) 64-Bit Server VM (1.6.0_07-b06-57 mixed mode
macosx-amd64)

Heap
PSYoungGen  total 690496K, used 680383K [0x00018a56,  
0x0001b500, 0x0001b500)
eden space 684160K, 98% used  
[0x00018a56,0x0001b37a0de0,0x0001b418)
from space 6336K, 99% used  
[0x0001b418,0x0001b47aeeb0,0x0001b47b)
to   space 8384K, 0% used  
[0x0001b47d,0x0001b47d,0x0001b500)
PSOldGentotal 1398144K, used 1296068K [0x00013500,  
0x00018a56, 0x00018a56)
object space 1398144K, 92% used  
[0x00013500,0x0001841b11d0,0x00018a56)
PSPermGen   total 437248K, used 431571K [0x00010500,  
0x00011fb0, 0x00013500)
object space 437248K, 98% used  
[0x00010500,0x00011f574c70,0x00011fb0)


Virtual Machine Arguments:
JVM Args: -Xserver -Xms2048m -Xmx2048m -XX:+MaxFDLimit - 
XX:MaxPermSize=768m

-XX:+UseParallelGC -Djava.awt.headless=true
-Djava.endorsed.dirs=/Applications/Qilan 3/Tomcat_Qilan//common/endorsed
-Dcatalina.base=/Applications/Qilan 3/Tomcat_Qilan/
-Dcatalina.home=/Applications/Qilan 3/Tomcat_Qilan/
-Djava.io.tmpdir=/Applications/Qilan 3/Tomcat_Qilan//temp
Java Command: org.apache.catalina.startup.Bootstrap start
Launcher Type: SUN_STANDARD
Physical Memory: Page Size = 4k, Total = 2048M, Free = 1811M

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-23 Thread Stephen Caine

Jonathan,

that is almost certainly an Apple Java issue.  If by charting, you  
mean graphics, then even more so.  The Java2D api on Mac still has  
bugs that will crash.


I am sorry that I did not specify the charting jsp.  We are using the  
ones provided by CEWolf (based on JFreeChart).


Stephen Caine

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: Java Crash

2009-01-23 Thread Stephen Caine

Ken,

This is very helpful.  It strongly suggests the issue is memory  
management, not JFreeChart.


Thanks,

Stephen

On Jan 23, 2009, at 2:28 PM, Ken Bowen wrote:

Just a datapoint:  I have a webapp which does basic graph  
construction using JFreeChart which has been running in development  
mode on a Mac OS X 10.5.6 under both Tomcat 5.5.26 and 6.0.18 for  
many months, and has never produced such a crash.


On Jan 23, 2009, at 1:56 PM, Stephen Caine wrote:


Jonathan,

that is almost certainly an Apple Java issue.  If by charting, you  
mean graphics, then even more so.  The Java2D api on Mac still has  
bugs that will crash.


I am sorry that I did not specify the charting jsp.  We are using  
the ones provided by CEWolf (based on JFreeChart).


Stephen Caine

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org




-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Cookie problem in 5.5.26

2008-10-30 Thread Stephen More
I see in version 5.5.26 there are Cookie handling/parsing changes!

5.5.25 and prior I was able to read cookie values that included colons:
   cookie-name: lastaccess cookie-value: 10/30/2008%2010:41:00%20AM

5.5.26 and after:
   cookie-name: lastaccess cookie-value: 10/30/2008%2010


Other threads are suggesting setVersion(1) when creating the cookie.
The problem is that I am not creating this cookie. It is being created
on a different system and I just need to read it.

How can I read this 3rd party cookie-value in tomcat 5.5.26 and greater ?


-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: Data Truncated when proxied from Apache

2008-10-21 Thread Stephen Nelson-Smith
Hi Filip,

On Wed, Oct 15, 2008 at 10:44 PM, Filip Hanik - Dev Lists
[EMAIL PROTECTED] wrote:
 use mod_proxy_http or mod_jk,

I am now but I don't understand why it behaved as it did - any idea?

snip

 I have an application which parses XML.  It sits behind an Apache
 Httpd 2.2 server using mod_proxy_ajp.  I am finding that if I POST
 more than about 1600 chars, the POST gets truncated, and I get an XML
 parse error.

 Httpd logs show:

 [Tue Sep 30 19:40:27 2008] [debug] mod_proxy_ajp.c(206): proxy: got
 1380 bytes of data

 And:

 [Tue Sep 30 19:40:27 2008] [debug] ajp_header.c(284):
 ajp_marshal_into_msgb: Header[3] [Content-Length] = [1615]

 Checking back over my logs, proxy has never got more than 1614 bytes of
 data.

 Does anyone have any idea what is cutting this off?  I am imagining
 there may be a setting somewhere which says: Don't pass more than
 $value bytes of data.

-
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: Appeal to Tomcat developers

2008-10-16 Thread Stephen Caine

Andre,

In regards to contacting IS people (not developers or specialists) who  
use Tomcat in production environments, please contact me off-list.  I  
think I can help to point  you in the right direction and get you  
access to the resources you are requesting.


Thank you,

Stephen Caine
CommonGround Softworks, Inc.
[EMAIL PROTECTED]


In my original post (and I apologise if this was not clear enough),  
I am specifically trying to speak for the sysadmin / average Tomcat  
user, and appealing to experts (such as you probably), to help make  
it simpler for these people to use and configure Tomcat. Please.


I have no doubt that for experts, the logging as it is now is  
probably clear, effective, efficient, flexible and everything you  
would ask for.


log4j is a beautiful package, but it is a monster, requiring deep  
Java knowledge, and even so, many hours of dedicated work to dominate.

From the look of it, Commons Logging is a similar piece of cake.

No doubt that for someone who mainly does Java programming for a  
living, it is worth the effort.
But many (the majority ?) of Tomcat users and administrators do not  
have that time, at least not for that package alone, when they  
simultaneously have to learn a little bit of many other packages.

That does not mean that they don't like Tomcat, at least not yet.

Or else, shall we say up front that Tomcat is a development tool, to  
be used exclusively by Java and Tomcat programming specialists, and  
not in production environments ?





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




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



Re: Tomcat getting insufficient POST data

2008-10-02 Thread Stephen Nelson-Smith
Hello,

 Yes - I'll package 6.0.18 this afternoon and test it this evening.

Initial tests look positive - will do more extensive tests this
morning.  Thanks very much for the suggestion.

S.

-
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 getting insufficient POST data

2008-10-01 Thread Stephen Nelson-Smith
Hi Rainer,
  This reminds me of some problem we found when fixing BZ 44494. Could you
 please try with 6.0.18? Your symptoms don't really fit 44494 exactly, but
 there's a chance 6.0.18 fixed it.

Yes - I'll package 6.0.18 this afternoon and test it this evening.

S.

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



Data Truncated when proxied from Apache

2008-09-30 Thread Stephen Nelson-Smith
Hi,

I have an application which parses XML.  It sits behind an Apache
Httpd 2.2 server using mod_proxy_ajp.  I am finding that if I POST
more than about 1600 chars, the POST gets truncated, and I get an XML
parse error.

Httpd logs show:

[Tue Sep 30 19:40:27 2008] [debug] mod_proxy_ajp.c(206): proxy: got
1380 bytes of data

And:

[Tue Sep 30 19:40:27 2008] [debug] ajp_header.c(284):
ajp_marshal_into_msgb: Header[3] [Content-Length] = [1615]

Checking back over my logs, proxy has never got more than 1614 bytes of data.

Does anyone have any idea what is cutting this off?  I am imagining
there may be a setting somewhere which says: Don't pass more than
$value bytes of data.

S.

-
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 getting insufficient POST data

2008-09-30 Thread Stephen Nelson-Smith
I have an application that parses xml.  I send it xml using another
little app, which makes an http post.  The averge size of a post is
about 3000 characters.  Here is the significant information:

* I have a system which is being replaced, which consists of RHEL3,
httpd 2.0, mod_jk and Tomcat 6.0.16
* I have a new system, to replace the old one, which consists of 3 x
Tomcat 6.0.16 machines, to be load balanced.

Testing:

* Submitting straight to one of the new tomcat 6.0.16 machines, over
http, works without fail - the XML is parsed.
* Submitting to the old system (httpd 2.0 using mod_jk, with tomcat
6.0.16 on  the same box) works fine.
* Submitting to a separate machine, running httpd 2.2, and  using
mod_proxy_ajp to proxy to tomcat 6.0.16 only works if the POST is
smaller than about 1600 bytes, otherwise the data appears to be
unterminated to the app.  Tcpdump shows where the data continues into
a second packet, and this is exactly where the app says the xml is
unterminated.
* Submitting to a separate machine using nginx or httpd, and proxying
via http to a tomcat machinen works fine, only the very first time
after a tomcat restart.  Thereafter it fails, in the same way -
complaining about unterminated XML.  As soon as Tomcat is restarted,
the very next one works, and then fails again thereafter.

Can anyone see a pattern here?  I can't see a way through any more,
and it's looking like we can't find any way to load-balance, or even
simply proxy to Tomcat reliably.

I'm at my wit's end... so any help would be most gratefully received.

S.

-
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 getting insufficient POST data

2008-09-30 Thread Stephen Nelson-Smith
On Tue, Sep 30, 2008 at 8:12 PM, Stephen Nelson-Smith
[EMAIL PROTECTED] wrote:

 Testing:

 * Submitting straight to one of the new tomcat 6.0.16 machines, over
 http, works without fail - the XML is parsed.

Ok so now it transpires that actually direct http to Tomcat never
worked more than once, after a tomcat restart either.  So the only
thing that works is the mod_jk setup.

This makes me very suspicious - why would it work only once?

Can I cluster with mod_jk and apache 2.2?

S.

-
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: mod_ajp and Load-Balancing Issue

2008-09-22 Thread Stephen Nelson-Smith
On Mon, Sep 22, 2008 at 1:45 AM, Shaun Senecal [EMAIL PROTECTED] wrote:
 Are you using the ClusterSingleSignOn Valve?

I'm not, no.

I have httpd 2.2 on the front-end, with a balancer pool thus:

ProxyRequests Off
ProxyVia Off
ProxyPreserveHost On
ProxyErrorOverride On
ProxyTimeout 60

Proxy balancer://tomcat
   BalancerMember ajp://10.1.1.231:8009 min=10 max=50
   BalancerMember ajp://10.1.1.232:8009 min=10 max=50
   #BalancerMember ajp://10.1.1.233:8009 min=10 max=50
   Order deny,allow
   Allow from all
/Proxy

ProxyPass / balancer://tomcat/ lbmethod=byrequests
stickysession=JSESSIONID nofailover=On
ProxyPass /servlet  balancer://tomcat/servlet
lbmethod=byrequests stickysession=JSESSIONID nofailover=On
ProxyPass /piston   balancer://tomcat/piston
lbmethod=byrequests stickysession=JSESSIONID nofailover=On
ProxyPass /manager  balancer://tomcat/manager
lbmethod=byrequests stickysession=JSESSIONID nofailover=On
ProxyPass /link balancer://tomcat/link
lbmethod=byrequests stickysession=JSESSIONID nofailover=On
ProxyPass /ajax balancer://tomcat/ajax
lbmethod=byrequests stickysession=JSESSIONID nofailover=On


When I browse to the login page, I see a jsessionid in firebug.  I
login, the jessionid cookie stays the same.  I try to navigate within
the application, and wherever I click I end up on the login screen
again, with the message user has timed out.  The cookie doesn't
change until I login, in which case I see a new cookie.

If I comment out two of the BalancerMembers, the app works fine.  If I
add one in (as above) I get the same behaviour.

From reading the archives, it seems I should set a route in httpd.conf
snippet and a jvmroute in the engine tag for each tomcat server.xml.
I'll try this shortly, but it seems as if Richard did this, but still
experienced problems.

Thanks,

S.

-
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: mod_ajp and Load-Balancing Issue

2008-09-21 Thread Stephen Nelson-Smith
Good morning,

 By error, I just meant that I'd get redirected to the login page
 instead of the expected page. Sorry to confuse. There are no error
 pages, logs or messages. Just that I got switched to a different node.

snip

 If you want to debug a little more: In Tomcat you can add a
 %S to your log pattern, which will log the session id. In
 httpd you can log the Set-Cookie outgoing header
 %{Set-Cookie}o and the JSESSIONID cookie %{JSESSIONID}C.
 If you are not using cookies, you can of course see the
 jsessionid path parameter dircetly in the logged URL.

 Thanks. I'll do that. (First time apache troubleshooter here). I'll get
 back on the results.

Did you get this to work?  I have exactly the same problem.  Apache
2.2 using mod_proxy_ajp with 3 x tomcat 6 instances behind it.  If I
remove two of the tomcats from the balancer pool, the application
works.  When I put them back in, I can log into one of the servers,
but as soon as I change screens on the application, I'm logged out.
This is because if the application detects a session change, it logs
the user out.  I need the load-balancer to direct traffic to the same
tomcat server on which the session began unless that server is down.

S.

-
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: Deploying a Java Web Application on / folder

2008-09-17 Thread Stephen Souness

You'll get better mileage as;

ROOT.war

- case sensitivity tends to matter for this sort of thing.


--
Stephen Souness


Martin Gainty wrote:

deploy your application as root.war
http://tomcat.apache.org/tomcat-5.5-doc/virtual-hosting-howto.html

Martin 
__ 
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission. 




Date: Wed, 17 Sep 2008 16:45:28 -0700
From: [EMAIL PROTECTED]
To: users@tomcat.apache.org
Subject: Deploying a Java Web Application on / folder



Hello,

I am trying to deploy a java Web application on Tomcat Server. This is part
of my server.xml file

Host name=anotherheadsets.com appBase=/home/anotherheadsets/public_html
unpackWARs=true autoDeploy=true
xmlValidation=false xmlNamespaceAware=false
 Aliaswww.anotherheadsets.com/Alias
 Context path= reloadable=true
docBase=/home/anotherheadsets/public_html /
 Context path=/manager
docBase=/usr/local/tomcat/users/anotherheadsets/tomcat/webapps/manager
  privileged=true antiResourceLocking=false
antiJARLocking=false reloadable=true /
  /Host

When I am deploying my application as ProjectOne.war on tomcat, the
application works fine when I use the url

http://www.anotherheadsets.com/ProjectOne


But when I am using the url

http://www.anotherheadsets.com

the application doesn't seem to work properly...


How do I deploy my application on the home URL rather than a subdirectory...
What modifications do I need to make to config files.

Thank you in advance.

Kris







--
View this message in context: 
http://www.nabble.com/Deploying-a-Java-Web-Application-on---folder-tp19543430p19543430.html
Sent from the Tomcat - User mailing list archive at Nabble.com.


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



_
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/



-
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: Preventing File Access

2008-09-10 Thread Stephen Caine

Steve,


Can someone point me to where I can read how to prevent/redirect  
access to a particular file in the Tomcat/webapp context.
Specifically, all of my directories have the OS X DS_Store file.   
I  would like to redirect users to an error page when this file is  
directly accessed.


In the future it would help if you mention what version of Tomcat  
you are using.


version 5.5.7



You will have to use a security constraint,

read these two threads for examples.

http://marc.info/?l=tomcat-userm=110311676821916w=2

http://marc.info/?l=tomcat-userm=98100806313397w=2


Thank you for the reference.

Stephen Caine
CommonGround Softworks, Inc.

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



Preventing File Access

2008-09-09 Thread Stephen Caine

All,

Can someone point me to where I can read how to prevent/redirect  
access to a particular file in the Tomcat/webapp context.   
Specifically, all of my directories have the OS X DS_Store file.  I  
would like to redirect users to an error page when this file is  
directly accessed.


Thank you,

Stephen Caine
CommonGround Softworks, Inc.

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

2008-08-13 Thread Stephen Nelson-Smith
Hi,

 When you move Tomcat to another machine, no Host matches and you get a
 400 error.

The problem was that I was hitting the loadbalancer with name lb1 or
www.mysite.com.  This was being proxied to machines called tomcat1,
tomcat2 etc.  Changing the alias to www.mysite.com seems to have fixed
this.

 Note that name=tomcat1 plus Aliastomcat1/Alias doesn't get you
 anything ;)

Do you mean that the alias is redundant?

S.

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

2008-08-13 Thread Stephen Nelson-Smith
On Tue, Aug 12, 2008 at 9:40 PM, Caldarale, Charles R
[EMAIL PROTECTED] wrote:
 Stephen Nelson-Smith wrote:

 My server.xml was not originally written by me, and
 has been handed down and modified over the ages.  It
 was originally from Tomcat 4.1

 This is generally a really bad idea.

I thought it might be... I just had the sense that this was a rather
nasty stone under which some nasty things might be hiding.

 You need to take the standard server.xml that comes with the particular 
 Tomcat release you're using and modify it with whatever you need for your 
 environment, such as Resource elements.  Blindly adding all the junk from 
 older levels will bite you.

Yep - I will do just this.  The guideline in the definitive guide (2nd
ed) seem helpful, but I do find some of the terminology confusing.
Will sing out if I get really stuck.

S.

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

2008-08-12 Thread Stephen Nelson-Smith
Ok... just to be clear, after more testing:

On the same machine, using apache 2.2 mod_proxy_ajp:

1) set ProxyPass to localhost
2) use application server.xml

All works.

Move apache to a different machine.

1) Set ProxyPass to IP or DNS name of tomcat server

Apache gives a 400 and I get no content.

2) Move stock server.xml into place

I get content.

I have no idea what's going on there... any ideas / suggestions?

S.


On Tue, Aug 12, 2008 at 8:45 AM, Stephen Nelson-Smith
[EMAIL PROTECTED] wrote:
 I have a server running apache 2.2, configured to proxy to another
 tomcat server, running 6.0.16.  This works fine with the stock
 server.xml, and the webapps, but when I move my own server.xml into
 place, apache reports a 400, and I get no page.

 Some background:

 * The apache config works in production with Tomcat 6 when running on
 the same machine as tomcat, with tomcat1 substituted for the IP of
 the virtual host.
 * My server.xml was not originally written by me, and has been handed
 down and modified over the ages.  It was originally from Tomcat 4.1
 * Tomcat works fine in standalone mode - the app works.

 I have some questions:

 1) How do I configure logging?  I don't see any information such as
 200s or 400s anywhere in the logs directory.  I also don't see my
 tomcat1 log file, although I suspect that is because Logger no longer
 works in tomcat 6.  I don't see how to troubleshoot without this
 information
 2) All I want to happen is for http://loadbalancer/login.jsp to be
 passed to http://tomcat/login.jsp using ajp/1.3.  What is the simplest
 thing that could possibly work?

 The configs are:

 Apache:

 VirtualHost 192.168.0.1
 ProxyRequests Off
 Proxy *
Order deny,allow
Allow from all
 /Proxy
 ProxyPass / ajp://tomcat1:8009/
 ProxyPass /servlet ajp://tomcat1:8009/servlet
 ProxyPass /piston ajp://tomcat1:8009/piston
 ProxyPass /manager ajp://tomcat1:8009/manager
 ProxyPass /link ajp://tomcat1:8009/link
 ProxyPass /ajax ajp://tomcat1:8009/ajax
 ProxyVia on
 /VirtualHost

 Tomcat:

 ?xml version='1.0' encoding='ISO-8859-1'?
 Server port=8005 shutdown=SHUTDOWN
  Listener className=org.apache.catalina.core.AprLifecycleListener
 SSLEngine=on /
  Listener className=org.apache.catalina.core.JasperListener /
  Listener className=org.apache.catalina.mbeans.ServerLifecycleListener /
  Listener 
 className=org.apache.catalina.mbeans.GlobalResourcesLifecycleListener
 /
  GlobalNamingResources
Resource name=UserDatabase auth=Container
  type=org.apache.catalina.UserDatabase
  description=User database that can be updated and saved
  factory=org.apache.catalina.users.MemoryUserDatabaseFactory
  pathname=conf/tomcat-users.xml /
  /GlobalNamingResources
  Service name=Catalina
Connector port=8080 protocol=HTTP/1.1
   connectionTimeout=2
   redirectPort=8443 /
Connector port=8009 protocol=AJP/1.3 redirectPort=8443
   enableLookups=false
   connectionTimeout=0 disableUploadTimeout=false
   proxyName=tomcat1 proxyPort=80
   acceptCount=10 bufferSize=2048 compression=off
   connectionLinger=-1 connectionUploadTimeout=30
   debug=0 maxKeepAliveRequests=100
 maxProcessors=500 minProcessors=5
   scheme=http secure=false serverSocketTimeout=0
 tcpNoDelay=true
   tomcatAuthentication=true
 useBodyEncodingForURI=true useURIValidationHack=false/
Engine name=Catalina defaultHost=localhost
  Realm className=org.apache.catalina.realm.UserDatabaseRealm
 resourceName=UserDatabase/
  Host appBase=/home/sites/home/web liveDeploy=false
 autoDeploy=false debug=4 name=tomcat1 
Aliastomcat1/Alias
Context cachingAllowed=true cookies=true
 crossContext=true debug=0 docBase=  path= privileged=false
 reloadable=true 
  Logger className=org.apache.catalina.logger.FileLogger
 debug=0 directory=logs prefix=tomcat1 suffix=.txt
 timestamp=true verbosity=1/
/Context
  /Host
/Engine
  /Service
 /Server


 Thanks,

 S.


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



  1   2   3   >