Re: Tomcat efficiency (was: RE: Optimal Settings to use Tomcat as a HTTP File Server)

2011-06-13 Thread Peter Crowther
On 13 June 2011 21:41, Jeff Sturm  wrote:

> > From: Bill Miller [mailto:millebi.subscripti...@gmail.com]
> > -Static image serving (much more economical because the HTTP server is
> much lighter
> > "weight" than a JVM/App server) -etc...
>
> [...]

I just tried a trivial benchmark of a static file (187 bytes) that yielded
> 3,223 req/sec from httpd, and 3,172 req/sec from Tomcat.  That's a
> difference under 2%.  A 2% performance difference isn't compelling enough to
> me to make an architectural decision one way or the other.  I haven't
> benchmarked larger files, but I can imagine that APR's sendfile support
> would give Tomcat an assist there.
>
> http://tomcat.apache.org/articles/benchmark_summary.pdf

I seem to recall some more recent benchmarks as well?  The summary I've seen
is "you'll run out of network bandwidth long before you run out of the
capacity to serve static files in any modern system, whether you're using
httpd or Tomcat".

- Peter


Re: pauses on simple .html pages

2011-06-11 Thread Peter Crowther
On 9 June 2011 21:25,  wrote:
> I have a script setup does a wget hit to docs/config/valve.html
> every 1 second. If the wget call takes longer than 1 second it
> grabs a bunch of stats -- iostat, vmstat, top, jstack, last 30
> lines of jvm.log.

Nice setup - I wish more people did that!  Can I just ask a Really
Dumb Question: *exactly* when does this grab the stats?  Does it wait
for the response, or does it start gathering as soon as it's aware of
a problem (say, at 1 second)?  At the moment, for example, jstack
might not be showing anything because you're gathering data after the
call has completed.

- Peter

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



Re: Expected behavior of Tomcat under load

2011-05-25 Thread Peter Crowther
Operating system and version?
Java version?
Tomcat version: 6.0.32 - thanks for this.
Java or native connector?
Pure Tomcat or something else in front?  (I'm assuming pure Tomcat from what
else you say)

- Peter

On 25 May 2011 12:51, Asankha C. Perera  wrote:

> Hi All
>
> During some performance tests, we've seen that Tomcat resets TCP
> connections under high load. To reproduce this rather consistently, a thread
> pool with a maximum of 300 threads could be configured on default Tomcat
> 6.0.32, and then 1280 ~ 2560 concurrent user requests simulated from a
> different machine over a real NW interface. I assume this could be
> reproduced with proportionately smaller numbers for both as well. The
> implementation uses a Xfire soap service.
>
> Tomcat refusing connections, or taking longer to accept new connections, or
> taking longer to reply (causing a socket timeout) can be expected under such
> load - but what we see are TCP resets of connections to which a client has
> already sent a full HTTP request.
>
> Is this the default behavior of Tomcat? The problem this presents is that
> the client cannot safely fail over to another instance, unlike with a
> refused connection or a connect timeout (i.e. delay in accepting)
>
> thanks
> asankha
>
>
> No. TimeSourceDestination   Protocol
> Src Port Dst Port Info
>  389961 37.056567   10.77.69.810.101.29.42  TCP
>  9062 8080 9062 > 8080 [SYN] Seq=0 Win=5792 [TCP CHECKSUM INCORRECT]
> Len=0 MSS=1460 TSV=363753 TSER=363574 WS=7
>  391297 37.108766   10.101.29.42  10.77.69.8TCP
>  8080 9062 8080 > 9062 [SYN, ACK] Seq=0 Ack=1 Win=5792 Len=0
> MSS=1460 TSV=363383 TSER=363753 WS=7
>  391298 37.108773   10.77.69.810.101.29.42  TCP
>  9062 8080 9062 > 8080 [ACK] Seq=1 Ack=1 Win=5888 [TCP CHECKSUM
> INCORRECT] Len=0 TSV=363758 TSER=363383
>  391893 37.115809   10.77.69.810.101.29.42  HTTP
> 9062 8080 POST /xfire/xfire-service HTTP/1.1
>  391894 37.115837   10.77.69.810.101.29.42  HTTP
> 9062 8080 Continuation or non-HTTP traffic[Packet size limited
> during capture]
>  392677 37.125492   10.101.29.42  10.77.69.8TCP
>  8080 9062 8080 > 9062 [RST] Seq=1 Win=0 Len=0
>
>
> --
> Asankha C. Perera
> AdroitLogic, http://adroitlogic.org
>
> http://esbmagic.blogspot.com
>
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Connection pool race condition

2011-04-28 Thread Peter Crowther
You could use Windows' service dependency management (
http://support.microsoft.com/kb/193888) to start Tomcat only after Oracle
reports that it's running.  This might still cause problems if Oracle does
the same as SQL Server and continues recovering after its "official" startup
has finished.  In that case, I'd try to write a small service that polled
Oracle every few seconds till it started, then reported itself as started,
and make Tomcat dependent on that.  Service creation in Windows isn't too
hard, but it's another moving part to support!

- Peter

On 27 April 2011 21:18, chris derham  wrote:

> All,
>
> So we have various tomcat services setup on windows. When windows updates
> are auto installed, sometimes they force a reboot of the server. When this
> happens, the tomcats win the race with the database (Oracle) to startup.
> Then the connection pool can't start, and then the war file is flagged as
> shutdown. We have tried to make the tomcat services dependent on the oracle
> service (both db service and tns listener), but same happens. Just tried to
> turn the connection pool initial size down to zero, but the app fetches
> some
> config at startup. I guess we could recode to lazily fetch this upon first
> access. Just curious if anyone has hit this, and if there is a way to delay
> the tomcat service startup.
>
> Tomcat 7.0.12
> Windows server 2008 r2 64 bit
>
> >java -version
> java version "1.6.0_24"
> Java(TM) SE Runtime Environment (build 1.6.0_24-b07)
> Java HotSpot(TM) 64-Bit Server VM (build 19.1-b02, mixed mode)
>
> We have connection pool setup in catalina_base\conf\context.xml
>
>auth="Container"
>type="javax.sql.DataSource"
>username="username"
>password="password"
>driverClassName="oracle.jdbc.OracleDriver"
>url="jdbc:oracle:thin:@localhost:1521:xe"
>maxActive="20"
>maxIdle="2"
>minIdle="1"
>initialSize="2"
>/>
>
>
> 27-Apr-2011 19:48:22 org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring root WebApplicationContext
> 27-Apr-2011 19:48:31 org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring FrameworkServlet 'dispatcher'
> 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log
> INFO: Destroying Spring FrameworkServlet 'dispatcher'
> 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log
> INFO: Closing Spring root WebApplicationContext
> 27-Apr-2011 20:21:22 org.apache.catalina.core.ApplicationContext log
> INFO: Shutting down log4j
> 27-Apr-2011 20:25:36 org.apache.catalina.core.StandardContext listenerStart
> SEVERE: Exception sending context initialized event to listener instance of
> class liquibase.integration.servlet.LiquibaseServletListener
> java.lang.RuntimeException: javax.naming.NamingException: Cannot create
> PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in
> progress
> )
>at
>
> liquibase.integration.servlet.LiquibaseServletListener.contextInitialized(LiquibaseServletListener.java:159)
>at
>
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4701)
>at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5204)
>at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5199)
>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>at
>
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>at java.lang.Thread.run(Thread.java:662)
> Caused by: javax.naming.NamingException: Cannot create
> PoolableConnectionFactory (ORA-01033: ORACLE initialization or shutdown in
> progress
> )
>at org.apache.naming.NamingContext.lookup(NamingContext.java:843)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:145)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:814)
>at org.apache.naming.NamingContext.lookup(NamingContext.java:159)
>at org.apache.naming.SelectorContext.lookup(SelectorContext.java:158)
>at javax.naming.InitialContext.lookup(InitialContext.java:392)
>
> Thanks
>
> Chris
>


Re: Tomcat 5.5.23 installation issues

2011-04-18 Thread Peter Crowther
On 18 April 2011 11:48, Venkata Surapaneni  wrote:

>I have installed Tomcat 5.5.23 on Windows 2008,32 bit  and
> Java 1.6.0_23 . The installation completed fine.
>
> When I typed in localhost:8080 on the web page Tomcat home page is
> displayed indicating that Tomcat installation is done.
>
> But when I type the ip address of the machine like 10.4.2.10:8080 instead
> of local host, Tomcat home page is not displayed.
>
> I thought it may be something related to the host mapping and checked the
> hosts file in etc folder and it doesn't seem to have anything extra
> configured except the default.
>
> Any idea why Tomcat is not working with the IP address?
>
> 0) Is there any particular reason to use that version?

1) Port 8080 may be bound to localhost rather than all ports.  netstat -an |
find "8080" will tell you.  If it is, change Tomcat's server.xml
appropriately.

2) You may need to open up port 8080 on the firewall.

- Peter


Re: How to limit tomcats thread consumption?

2011-04-05 Thread Peter Crowther
On 4 April 2011 18:29, André Warnier  wrote:

> Michael Jerger wrote:
>
>> last days I leased a virtual host at 1und1 (a german hoster).
>> Unfortunately 1und1 found a new, creative  way to limit the joy of using
>> their VPH - they limit the number of operating-system processes to 256
>> processes in total.
>>
>
> a) are you sure ? Since, commercially speaking, I can't imagine what
> benefit they would get from this (as opposed to e.g. limiting the amount of
> RAM or disk space), I tend to have a doubt.
>
> Doesn't surprise me at all.  I've moved completely off 1and1; I found them
an incredibly low-quality provider who quietly limited many areas of
functionality.  I've used Memset in the UK for the last 2 years and have so
far been very impressed.

André, the commercial benefit to 1and1 is summarised in the following
conversation:

Techie: "We've run out of threads, and it'll take days to migrate our
application off 1and1."
Money person: "What can we do?"
Techie: "Pay 1and1 more money for a bigger machine."
Money person: "Erm... OK."

- Peter


Re: Can't move files using symbolic links (allowLinking=true)

2011-03-22 Thread Peter Crowther
On 22 March 2011 08:32, Goyo  wrote:

> Inside "origin" there're about ten subdirs like "target". Some of them are
> symlinked to the new filesystem. The rest, must remain in their path so:
> - AFAIK, we can't mount the new drive to origin/target because target is
> not
> the only subdir we are symlinking (it is we should make more than one
> mount,
> one for every subdir we need to link.
> - We neither can make the symlink (or the mount) to the entire "origin"
> dir,
> because the client demands that only certain subdirs should be moved to the
> new drive.
>
> It seems there's no an easy way...
>
> Then you're screwed and so's the client.  Here are the conditions:

   1. You are not allowed to change or rewrite the C source code;
   2. The C source code uses rename(2) to move the file (it's worth checking
   this assumption);
   3. Rename(2) will not allow a file to be moved across filesystems;
   4. You are not allowed to configure partitions in such a way that all the
   files to be moved remain within the same filesystem after the move.

To solve the problem, you or the client will have to relax one of these
conditions.  The alternative is that the system keeps failing!

If we're correct about the technical restrictions in 1, 2 and 3, then your
(and the client's) only possibility to get a working system is to relax 4.

- Peter


Re: Can't move files using symbolic links (allowLinking=true)

2011-03-21 Thread Peter Crowther
On 21 March 2011 20:39, André Warnier  wrote:

> Maybe a guess : under Unix/Linux, "move" (mv) is a "rename", and it is not
> the same as "copy + delete original".  And a "move" (rename) works as long
> as the source and target are inside the same filesystem, but not if they are
> on different filesystems.
> (copy + delete does work in that case).
>

Nice one André!  I'd completely missed that.

 Maybe your C application (of which you do not have the source code), tries
> to do a "move" internally ?
>
> Running strace on the process containing the C code would show that up
fairly quickly.  You'd see rename(2) calls returning EXDEV.

If that's the case, changing the symlink to be at origin or mounting a new
filesystem at origin would solve this particular problem - but might cause
more chaos if there are other moves going on!

- Peter


Re: Can't move files using symbolic links (allowLinking=true)

2011-03-21 Thread Peter Crowther
On 21 March 2011 17:36, Goyo  wrote:
The (another) problem is that we can't access the source code :S

*chuckle* Gotta love configurable code.

OK, so the issue is that you're short of space.  How about mounting a
partition at origin/target?  Or even origin, depending how short of space
you are.  If you use loopback, the "partition"'s source doesn't even have to
be raw disk - it can be a file.

- Peter


Re: Can't move files using symbolic links (allowLinking=true)

2011-03-21 Thread Peter Crowther
On 21 March 2011 16:35, Goyo  wrote:

> We want to move a file from origin/ to origin/target/
> Previously, this movement was made perfect
> Then, we change origin/target/ for a symlink called target which points to
> another path in another partition.
> Now, it doesn't move the file when using the server application (although
> we
> can do it manually from the filesystem using the same user of the tomcat
> server).
>
> Can you change the server to move the file to origin/target/. ?  Sounds
crazy, I know, but you'd be surprised how often referencing the directory
that's the target of a symlink resolves such issues.

- Peter


Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)

2011-03-15 Thread Peter Crowther
On 15 March 2011 13:02, Caldarale, Charles R wrote:

> Also, a Java int, when allocated on the stack, must take up the same number
> of bits as a pointer.
>
> That's an interesting space/time trade-off (I presume it's to prevent
excess arithmetic on stack value accesses).  I wonder whether it's still a
good trade-off on (say) a modern Intel architecture?

- Peter


Re: [OT] Followup on 32-bit versus 64-bit performance discussion(s)

2011-03-15 Thread Peter Crowther
On 15 March 2011 07:36, Leon Rosenberg  wrote:

> So a 64bit cpu has a 32bit mode, or how would a 32bit OS shrink the
> transmit size? I mean the registers stay the same?


Frequently, the bottleneck with realistic loads is access to main memory
(or, not quite equivalently, on-die cache size).  Assuming you have some
locality of reference (adjacent instructions tend to be executed together,
adjacent data items tend to be used together) then transferring 128 bits
from main memory to cache is somewhat more likely to get you more useful
bits of data in 4x32 bit items than in 2x64 bit items.

- Peter


Re: Performance 5.5 vs 6 vs 7

2011-03-14 Thread Peter Crowther
On 14 March 2011 12:08, David kerber  wrote:

> Dave, could you give us any more information about your network?  What is
> the piece that's at 80% utilisation when you see the trouble?  Is it a
> point-to-point connection, or an Ethernet LAN, or what?  If it's Ethernet,
> what hardware are you using for connection?
>
> It's our internet connection to the outside world, which is a T-1, with a
> Cisco ASA for the firewall.  The connections we're processing are from a
> bunch of separate customer sites, but which all connect to us through the
> customer's gateway.


A T1 used to be 1.5 Mbit/s bidirectional, back when I did my basic network
training (which, I admit, is a good few years ago).  Is it still?  If so,
that's quite low.  I have 34 Mbit/s down, 1.5 Mbit/s up to my house for the
price of a decent restaurant meal for one per month.  What might your
upgrade options be?

Also, see if the ASA can give you any usage statistics.  There's a small
chance that you're saturating your firewall if you have a very large number
of short-lived connections.  Cisco's figures don't always stack up here - in
the past, I've had to debug load problems with Cisco routers that were
supposed to be able to handle two ISDN PRIs, and couldn't when there was
heavy call setup and termination load.  I accept this isn't quite a parallel
case!

Tomcat might still be the problem, but I'd certainly take a long hard look
at your network infrastructure.  Does the server really have to be on your
site, or can you have a server in a bunker somewhere that passes hourly /
daily reports to your site via a heavily compressed file format?  Our
telemetry system does that, for example, just running in a VM (for
reliability, believe it or not).

Cheers,

- Peter


Re: Performance 5.5 vs 6 vs 7

2011-03-14 Thread Peter Crowther
On 13 March 2011 21:01, Tony Anecito  wrote:

> As someone mentioned the network can imit you. If your bandwidth
> utilization is
> at 60% or over you are in trouble since collisions start to become a
> serious
> issue.
>
> Collisions may or may not be an issue, depending on the exact mode of
operation of the congested network link.

Collisions are a feature of the original Ethernet.  They're still an issue
on many Ethernets, but there are provisos even here.  If your switch does
store-and-forward, or you simply have a switched network and all the traffic
is between two stations, then collisions are relatively unlikely and the
Ethernet usage can go considerably higher than 60% before collisions and
retries start to become significant.  Sure, if you're on wireless or using
an old 10baseT or Cheapernet hub, 60% is about the knee in the curve.  But
I'd be a little surprised if Dave were using such ancient technology for a
critical piece of infrastructure such as this server :-).

Point-to-point links, such as most broadband connections, do not suffer from
collisions as the routers at each end store and forward traffic across the
link.  That said, by the time you get to 80% usage then each packet is
typically going to have to queue behind several others.  Even if this only
adds a few milliseconds of latency each time, it builds up when you multiply
it by the TCP 3-way handshake, 4-way FIN/ACK sequence, plus any data you're
transferring.

Dave, could you give us any more information about your network?  What is
the piece that's at 80% utilisation when you see the trouble?  Is it a
point-to-point connection, or an Ethernet LAN, or what?  If it's Ethernet,
what hardware are you using for connection?

Tony - I also don't believe 2ms is the best you can get on Ethernet.  If it
was, most big machine rooms would have silted up with network traffic long
ago ;-).  It depends on what network technology you're using.  For example,
gigabit Ethernet latencies are considerably lower than good ol' 10 meg.
What link speeds do you have to your router?  100 Mbit/s?

- Peter


Re: Performance 5.5 vs 6 vs 7

2011-03-12 Thread Peter Crowther
On 11 March 2011 20:02, David kerber  wrote:

> I've already checked my connection bandwidth, and that still has some
> headroom, though not a lot.
>
> What's "not a lot"?  If latency across the connection is starting to
increase due to congestion, that could increase the time to process
requests, therefore increase the number of requests still active, therefore
consume more resources on the server.

Also, what is the connection and what's upstream of it?  Might upstream
congestion be an issue?

- Peter


Re: Tomcat and SSL

2011-03-02 Thread Peter Crowther
On 2 March 2011 15:56, jvr  wrote:

> My question:
>
> If I'm not using JK Connector is mandatory configure tomcat as stand-alone
> server?
>
> or, although I'm not using JK Connector I could consider Apache like the
> primary web server?
>
> If you are not *somehow* forwarding requests from your primary web server
to Tomcat, then you should configure Tomcat as a stand-alone server, yes.
*Somehow* for Apache httpd could be using JK or using Apache httpd as a
reverse proxy.  Either way, you'll need to change part of Apache httpd's
configuration so that it forwards the requests to Tomcat that you want to
receive in Tomcat.

Two processes cannot share the same TCP port on the same IP address.  So
assuming your machine only has one IP address: if you already have Apache
httpd on port 8443, then you cannot also configure Tomcat as a stand-alone
server on port 8443.  You could get Apache httpd to accept all requests on
8443 and forward some to Tomcat (Apache httpd would then be the primary web
server), or you could move Apache httpd to a different port and configure
Tomcat as a stand-alone server on 8443, or you could configure Tomcat as a
stand-alone server on a different port.

Does that help, or have I answered the wrong question? :-)

- Peter


Re: [OT] Memory Leak in Tomcat

2011-02-24 Thread Peter Crowther
On 24 February 2011 09:42, André Warnier  wrote:

> Jeffrey Janner wrote:
> ..
>
>>
>>>
>> Not sure exactly what Windows does once you've entered a verified user/pw
>> combination for a service.  I'm guessing that it stores the password
>> somehow, because if you change the password, the service won't start next
>> time.
>>
>>
> It is stored in whatever format, encrypted or not or hashed or not, in
> whatever store the Domain Controller uses to store user credentials.
> It doesn't matter.
> NTLM authentication afterward works using "tokens" which somehow encode the
> information needed by a server to verify that the client is who it says it
> is, and the server is who it says it is.
> The point is that the password is not stored in clear on the client, when
> "client" means whatever host is trying to authenticate itself.  It is of
> coursee fleetingly in memory at some point, to construct the authentication
> tokens, but is not kept. Only the token is kept.
>
> André, I'd be interested in how you arrived at these assertions.  In
particular, I don't believe your first sentence.  I can start a service that
logs on as a domain account when my domain member (a laptop) is not
connected to the domain.  Therefore the domain member is storing something
somewhere, not just the DC.  And any time "something" is stored "somewhere"
it is subject to attack, as the Linux-based tools for changing Windows
administrator passwords demonstrate rather well - Windows may not allow
direct SAM hive access, but a foreign OS has no such compunctions.

This is all a long way from the original subject, of course.  I routinely
use SSPI authentication to SQL Server when I can do, as it does reduce the
attack surface somewhat.  SSPI generally makes it harder for an attacker to
retrieve the credentials used to authenticate a database client to SQL
Server.  It makes no difference to any attack that subverts the client
directly in order to attack through an existing or client-created new
connection, of course.

- Peter


Re: Is IBM Right About Java?

2011-02-09 Thread Peter Crowther
On 9 February 2011 01:36, Caldarale, Charles R
wrote:

> The JVM always reserves the maximum heap size as virtual space, but does
> not allocate more of the heap than the current limit; the limit will be
> adjusted up or down within the -Xms : -Xmx range as load dictates.  The
> unused virtual space is not available for any other use.
>
> Chuck, d'you happen to know how the virtual space reservation impacts swap
space requirements (if at all)?  Although somewhat less unpleasant than
buying RAM, 200 * 0.5Gbytes is still a lot of disk to allocate for swap if
you expect it's never going to be used.  I therefore assume there's not a
direct mapping of reserved virtual space to reserved space in the swap file.

- Peter


Re: running multiple instances of Tomcat on same server

2011-02-04 Thread Peter Crowther
On 4 February 2011 14:27, James Godrej  wrote:

> I have to run multiple instances of Tomcat.
> The reason I am doing so is I have a server where I hosted a learning
> management
> system known as
> Sakai which runs on Tomcat 5.5.30 and now on same server I have to host
> another
> learning management system known as OLAT.
>

Sakai 2.x makes enough weird modifications to the classloading mechanisms
that I wouldn't recommend running *anything* else in the same JVM as it!
Hopefully v3 will alleviate some of the worse problems.


>
> As per OLAT  doc here in Tomcat section
> http://www.olat.org/docu/install/olat_install_admin_docu_one_page.html
> it says
> "In situations where more than one instance is required (e.g.,
>  multiple
> cluster nodes on the same host) it is worth setting up each OLAT instance
> in its
> own JVM and sharing a common base installation
> (see Tomcat documentation
> concerning CATALINA_BASE installations.)"
>
> Can some one point me where is that given on Tomcat official docs or what
> is the
> doc which I gave link above trying to say.
>
> In the Tomcat installation root, there's a file called RUNNING.txt.  It
gives details on how to run multiple instances of Tomcat side-by-side.  In
essence, you copy the directories that are per-Tomcat (conf, work, webapps
etc.) and leave the read-only directories (bin etc) in one place.

Chuck's point is important.  Each Tomcat instance will need a unique
endpoint for its shutdown port and each connector - you can't run both on
port 80 on the same IP address unless you use some kind of reverse proxy
(there are many options here).

- Peter


Re: CLOSE_WAIT

2011-02-03 Thread Peter Crowther
On 3 February 2011 11:35, Pid  wrote:

> What factor caused so many people to hijack this thread?
>
> Using a mail client such as Gmail, which performs its own threading and
doesn't respect or even show the thread ID.

(And, Andre, you're right, I was confusing the two states - my bad)

- Peter


Re: CLOSE_WAIT

2011-02-02 Thread Peter Crowther
On 2 February 2011 10:24, Bw57899  wrote:

> Install an application in apache tomcat (6.0.29) in dev env on Solaris 10
> with no issue.
>
> But after move to production, there are always about 50 ~ 100 CLOSE_WAIT on
> port 1521. The application need connect an Oracle database which is on
> another server.
>
> So what can I do to check the problem?
>
> CLOSE_WAIT is normal behaviour - after a TCP socket is closed, it's
tombstoned for a period so that the TCP stack knows what to do with incoming
datagrams that might be late.

Why do you think this is a problem?  Except that you might be opening and
closing a lot of connections to Oracle?

- Peter


Re: IPR issues

2011-01-21 Thread Peter Crowther
On 21 January 2011 11:54, apache tomcat  wrote:

> I'd like to know if there is any patent infringement tied to the product.
>
> So would everybody!

There's language in the license about patents, but there's nothing to stop a
patent troll popping up and claiming that Tomcat infringes one of their
patents.  Without an exhaustive search of all the patents in force in the
world, along with consideration of how each one might be twisted so that a
troll can claim it affects Tomcat or something on which Tomcat relies,
nobody can be sure that nobody will claim patent infringement at some point.

Can you give us any more information about why you are asking the question?
If it's "because our company policy prevents us from using any software that
might infringe anybody's patents", then you should never use any software.
Or hardware.  Or pretty much anything else, actually.  What risk are you
trying to protect against, and what's your acceptable level of that risk?

- Peter


Re: [OT] Setting HTTP response headers caching for 1 year doesn't work

2011-01-20 Thread Peter Crowther
On 19 January 2011 16:30, Christopher Schultz
 wrote:
> [Peter]
>> I'm actually interested to know your environment for your
>> precision.c code, as a single-precision (32-bit) float is only good for 6-7
>> significant figures and your answers agree to 11sf.

... and I'm cross-eyed and can't count digits.  You're right, Chris.

- Peter

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



Re: [OT] Setting HTTP response headers caching for 1 year doesn't work

2011-01-19 Thread Peter Crowther
On 19 January 2011 15:53, Caldarale, Charles R
 wrote:
> No, most hardware (e.g., all flavors of x86) just sets a flag indicating that 
> an overflow has occurred; it's up to the executing program to check the flag.

And on some machines (again, x86 springs to mind) it's easier to check
some flags than others.  I needed to do this for some stats software
recently.  Detecting FP overflow was easy ("there's an instruction for
that"), detecting integer overflow was significantly harder.

- Peter

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



Re: [OT] Setting HTTP response headers caching for 1 year doesn't work

2011-01-19 Thread Peter Crowther
On 19 January 2011 08:34, André Warnier  wrote:

> Well, they haven't made a language yet which can divide acres by feet and
> coerce the result into furlongs.
>

Google "20 acres / 22 feet in furlongs" and prepare for a surprise ;-).

- Peter


Re: [OT] Setting HTTP response headers caching for 1 year doesn't work

2011-01-19 Thread Peter Crowther
On 19 January 2011 03:10, Christopher Schultz
wrote:

> Yup: float is the default decimal type. Double-precision takes longer,
> so you have to ask for it.
>

Chris, that's the only comment in your post I'd take issue with.  To my
knowledge, a constant with a fractional part is assumed to be double unless
stated otherwise.  I'm actually interested to know your environment for your
precision.c code, as a single-precision (32-bit) float is only good for 6-7
significant figures and your answers agree to 11sf.  Is your compiler
quietly using IEEE754 64-bit precision, even where you request float?

> I maintain what I said : a programming language which produces a wrong
> > result, without even a warning, for an expression as simple as
> > Long a = (1000 * 60 * 60 * 24 * 365)
> > should be consigned to iPods and stuff, not used for serious things like
> > Tomcat.
>

Andre,

On the contrary: I consider a language that allows one to disable at runtime
bounds checks, overflow checks and any other time overhead to be ideal for
code that gains advantage from being highly performant.  The smaller
Tomcat's overhead, the greater the processing power available for
applications.  In turn, this means fewer joules of heat generated per
request processed, less power and air conditioning load in the data centre,
and hence cheaper application deployments.  Given the number of Tomcat
deployments worldwide, I would expect almost any investment in improving
Tomcat's performance to pay off in terms of reduced total cost to humanity.

"Friendly" languages, on the other hand, are ideal for workstations, where a
few microseconds or milliseconds per iteration rarely matters, or for code
where the cost of execution is vastly outwighed by the cost of development.
I love Smalltalk as a prototyping language, for example; but I don't use it
for the inner loops of genomics code that's optimised to squeeze every piece
of speed of of a particular AMD processor in a cluster, and that takes the
time to process some experimental results down from a year to a day.

Horses for courses.

- Peter


Re: Apache Web Site Acting Wonky?

2010-12-14 Thread Peter Crowther
On 14 December 2010 16:28, Christopher Schultz  wrote:

> The last thing the infra team needs is 20M emails saying
> "teh server ist down HELPZORZ!!!1!!".
>
> You're giving the denizens of the Internet far too much credit.  There'd be
20 like that, and the rest would also include something along the lines of
"lololpwnedn00bz"

- Peter


Re: how to enable Tomcat to handle proprietary TCP streams (non-http data)

2010-12-09 Thread Peter Crowther
On 8 December 2010 19:51, razor  wrote:

>  So i can just start my own thread (threads) for receiving non-http
>  data (where to put initialization/starting stuff? as a new servlet ? )
>

If you implement your entire non-HTTP system as a servlet in its own
context, you have the advantage that you can implement a few web pages on
that servlet for control and monitoring of your service, and can start and
stop it independently of the rest of your servlets.

 and then my code will put received data in some 'public' synchronized
>  queue/collection or database (like HSQLDB)
>  and other threads/modules (and again, where should i start them? in
>  new servlets?) can process data
>

You can start as many threads as you like in one servlet, provided you
monitor them and make sure you shut them down tidily.  I'd suggest you
manage them all from a single servlet, so that you don't get hit by issues
like the inability to control context startup orders.  As all of your code
then shares the same class loader, you can use whatever mechanism you wish
to communicate between the modules.

 and at the end next threads have to send data using webservices or/and
>  webdav (a lot of data and i need resume option if something goes
>  wrong)
>

That's fine; if the threads in your code are themselves making client
connections to web services and/or WebDAV then the container won't give you
any assistance anyway.  It's up to you to make sure the client code works!

>
>  Is my thinking correct ?
>
> It's certainly pretty close :-).  I'd tend to keep your subsystem in one
context rather than many, as it gives you more options.

Good luck!

- Peter


[OT] Re: DBCP abandoned trace - unable to understand the leak

2010-11-04 Thread Peter Crowther
On 4 November 2010 10:54, Mark Thomas  wrote:

> On 04/11/2010 05:01, sasidhar prabhakar wrote:
> > I have one doubt.
> You have a question not a doubt
>
> I see this on many forums, and have come to realise it's associated with
speakers of at least one of the widely-used languages in India.  I've just
come to accept that "doubt" is the most obvious English translation of the
concept - though I agree with you that "question" is more understandable to
most English speakers.

To sasidhar prabhakar: if you don't mind me asking, what's your native
language and what's the word or phrase that you're translating as "doubt"?
When this comes up in forums, I'd like to be able to tell the poster that
"question" is probably a better English translation than "doubt", and I
would be able to do that more easily if I knew the original word or phrase
that you're translating.

- Peter


Re: Printing using system commands from Tomcat as a service

2010-10-12 Thread Peter Crowther
On 12 October 2010 11:57, F2Andy  wrote:

> To
> print, it creates a new file, which is then copied to lpt4: (which is
> actually a USB port on a networked computer, via "net use")
>
> Exactly where and when is the "net use" running?  There are two key points
with Windows services:

1) A service starts with its own copy of the environment, so even if it is
running as the same user as the console user it does not share drive or
device mappings;

2) A service does not get a fully-processed copy of the environment, so
drive and device mappings are not restored from the environment.

So:

a) Make sure your Tomcat service is running as a user that is known to the
network (not "Local service", "Local system" or an account that is local to
the server), otherwise your service will be unable to authenticate to the
machine with the printer;

b) Write yourself a batch file that does the net use and the copy, and
invoke *that* from your system command.

Hope this helps you resolve the problem!

- Peter


Re: [OT] Tomcat on Linux

2010-09-20 Thread Peter Crowther
On 20 September 2010 09:51, Tommy Pham  wrote:

> Thanks everyone for your input.  I was hoping to get a better understanding
> of the differences between the flavors of Linux and how well and easy for me
> to run Tomcat.  I guess I'll have to spend more time on various flavors.
>
> They all work.  Use the version you already know.  If you don't already
know Linux, use the operating system you do know in order to run Tomcat.
Your time cost in learning a new OS or Linux variant will vastly outweigh
any other savings you might make.

- Peter


Re: Tomcat Version Numbers

2010-08-25 Thread Peter Crowther
On 25 August 2010 15:23, Christopher Schultz
wrote:

> Again, this is partly because I feel a certain sense of order which
> requires releases to be X.0.0.
>
> Why?  And by "release" do you mean "stable, production-quality releases
that we'll stake our reputations on" (in which case almost every x.0.0 would
in reality fail the test) or do you mean "released outside the development
team"?

Not saying it's "wrong" (I tend to avoid "right" and "wrong" due to
relativism), just interested by the expectation.

Cheers,

- Peter


Re: java.net.BindException: Address already in use

2010-08-25 Thread Peter Crowther
Well, the ports you're requesting are or have recently been in use.

Try:
netstat -an | grep 8209
... just in case someone's given the service a name in /etc/services.  Also
just check that you've not got the same number in two places in
conf/server.xml, for example as the shutdown port.  Finally, check none of
your scripts are trying to start two instances of the same Tomcat at the
same time - it has happened!

If it's none of those, come back to us.  If you could give us details about
your environment (OS version, Tomcat version, Java version) we'd be more
likely to give help that's specific to you.  I can see Tomcat 5.5.23 in the
logs (why so old, by the way?) but have no idea about the others.

Finally, what's that Socks socket doing at shutdown?

- Peter

On 25 August 2010 15:17, Paul Bourget wrote:

> I assumed that this indicates be a port conflict before I googled this
> problem.  Every solution I found said "find and resolve the port
> conflict".  I cannot find the conflict.
>
>
>
>
>
> [r...@localhost logs]# netstat -a | grep 8209
>
> [r...@localhost logs]#
>
>
>
> [r...@localhost logs]# netstat -a | grep 8606
>
> [r...@localhost logs]#
>
>
>
> [r...@localhost logs]# ps -ef | egrep 'httpd | apache | tomcat |
> catalina'
>
> root  3036 1  0 Aug24 ?00:00:00 Xvnc :5 -desktop
> localhost.localdomain:5 (root) -httpd /usr/share/vnc/classes -auth
> /root/.Xauthority -geometry 1024x768 -depth 16 -rfbwait 3 -rfbauth
> /root/.vnc/passwd -rfbport 5905 -pn
>
>
>
>
>
> Here's the log output
>
>
>
> [r...@localhost logs]# more catalina.2010-08-24.log
>
> Aug 24, 2010 1:51:16 PM org.apache.catalina.startup.Catalina load
>
> INFO: Initialization processed in 570 ms
>
> Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardService start
>
> INFO: Starting service Tomcat-Standalone
>
> Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardEngine start
>
> INFO: Starting Servlet Engine: Apache Tomcat/5.5.23
>
> Aug 24, 2010 1:51:16 PM org.apache.catalina.core.StandardHost start
>
> INFO: XML validation disabled
>
> Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init
>
> **
>
> INFO: Port busy 8209 java.net.BindException: Address already in use
>
> **
>
> Aug 24, 2010 1:51:42 PM org.apache.jk.common.ChannelSocket init
>
> INFO: JK: ajp13 listening on /0.0.0.0:8210
>
> Aug 24, 2010 1:51:42 PM org.apache.jk.server.JkMain start
>
> INFO: Jk running ID=1 time=1/89  config=null
>
> Aug 24, 2010 1:51:42 PM org.apache.catalina.startup.Catalina start
>
> INFO: Server startup in 25506 ms
>
> **
>
> Aug 24, 2010 1:51:42 PM org.apache.catalina.core.StandardServer await
>
> SEVERE: StandardServer.await: create[8606]:
>
> java.net.BindException: Address already in use
>
>at java.net.PlainSocketImpl.socketBind(Native Method)
>
>at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:359)
>
>at java.net.ServerSocket.bind(ServerSocket.java:319)
>
>at java.net.ServerSocket.(ServerSocket.java:185)
>
>at
> org.apache.catalina.core.StandardServer.await(StandardServer.java:363)
>
>at org.apache.catalina.startup.Catalina.await(Catalina.java:616)
>
>at org.apache.catalina.startup.Catalina.start(Catalina.java:576)
>
>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
>at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>
>at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>
>at java.lang.reflect.Method.invoke(Method.java:585)
>
>at
> org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
>
>at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
>
> Aug 24, 2010 1:51:43 PM org.apache.catalina.core.StandardService stop
>
> INFO: Stopping service Tomcat-Standalone
>
> Aug 24, 2010 2:29:02 PM org.apache.catalina.connector.Connector pause
>
> SEVERE: Protocol handler pause failed
>
> java.net.SocketException: Network is unreachable
>
>at java.net.PlainSocketImpl.socketConnect(Native Method)
>
>at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>
>at
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>
>at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>
>at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
>
>at java.net.Socket.connect(Socket.java:520)
>
>at java.net.Socket.connect(Socket.java:470)
>
>at java.net.Socket.(Socket.java:367)
>
>
>
>
>
>
>
>
>
>
>
> Paul Bourget
>
> Director, Network Operations
>
> Isabella Products
>
> 9 Damonmill Square, Suite 4A
>
> Concord, MA 01742
>
> 978 287 0007 Ext 123
>
>
>
>


Re: How to spwan child processes.

2010-08-24 Thread Peter Crowther
On 23 August 2010 21:56, André Warnier  wrote:

> and can someone finally explain what "spwaning child processes" means ?
>

It's a UNIXism - a fork() call spawns a child process from a parent
process.  Not sure how much further back it goes into the deep, dark and
slightly dank dungeon of operating system history.

- Peter


Re: WARNING: Error registering request

2010-08-17 Thread Peter Crowther
On 17 August 2010 06:41, VenkateswaraRao Eswar wrote:

> Could you please respond to this mail ASAP?
>
> That's a very good way of making sure the volunteers on this list *never*
respond to your email.  You are not paying for this support.  There is no
service level agreement.  If you want support that responds in a fixed time
- or at all - then buy some.

- Peter


[OT] Re: Tomcat hangs every few hours

2010-08-17 Thread Peter Crowther
On 17 August 2010 10:48, sasidhar prabhakar  wrote:

> In thread dump I observed every thread doing the same thing.
> In my code I sends sms to users by using HttpURLConnection.
> I am using this code for months I didn't get the problem earlier.
> For few days I am getting this problem consistently. Whenever tomcat hangs
> I
> takes the thread dump,
> every time it shows the same results.
>
> Here is my one of threads dump. this is common for all remaining threads.
>
> Somebody guide me to solve this problem. I am trying but unable to do this
>
> "http-80-300" daemon prio=1 tid=0x76890ef0 nid=0x6bb6 runnable
> [0x6def..0x6def0db0]
>at java.net.SocketInputStream.socketRead0(Native Method)
>at java.net.SocketInputStream.read(SocketInputStream.java:129)
> [...]



>   at SendSms.sendToSingleRecipientNoNpri(SendSms.java:89)
>
[...]

The socket is hanging trying to read the response.  Your SMS provider
probably isn't responding to you on occasion.  I assume you've written test
code to do a SMS send; if not, write it and test the SMS send outside of
Tomcat.

This is not a Tomcat issue, so I've marked it [OT].

- Peter


Re: EXTERNAL: Re: Random file generation

2010-08-17 Thread Peter Crowther
On 16 August 2010 23:44, Miller, Kevin R  wrote:

> Any idea what this data is that is being sent to me?
>
> I'd expect it to be the start of the SSL negotiation. You're trying to do
something unexpected, namely treating a SSL connection as if it wasn't one.
Unsurprisingly, this doesn't work.

- Peter


Re: Random file generation

2010-08-16 Thread Peter Crowther
In other words: "If I try to interpret the SSL handshake from Tomcat as if
it were a byte stream to be interpreted by my browser, the byte stream the
server happens to generate has the first two bytes 'MZ' and my browser can't
interpret it as anything other than a Windows executable."

That such an action results in unexpected behaviour shouldn't be a surprise,
surely?

- Peter

On 16 August 2010 21:06, Miller, Kevin R  wrote:

> I am running Tomcat 6.0.26 on a Solaris 10 system.  The Tomcat server is
> configured to listen to HTTPS communications on port 8443.  When browsing to
> the Tomcat server remotely using the following syntax everything works as
> expected:
> https://10.10.10.10:8443/
>
> If however we accidentally leave out the "s" in https like this:
> http://10.10.10.10:8443/
>
> The Tomcat server responds with a 7 byte .exe file to download.  Each time
> we make the request again it generates a new .exe file with a different name
> (cd64dni2.exe or z0v8671g.exe for example).  The exe fail fails to execute
> on a windows system.   The contents of all of the exe files are exactly the
> same (binary data)
>
> If I run an od on the file I get the following:
> $od cd64dni2.exe
> 000 001425 01 001002 12
> 007
>
>
> Can anyone explain what this file is and why it is getting generated?
>


Re: Can't configure webapps to disk partition

2010-08-12 Thread Peter Crowther
On 11 August 2010 21:36, André Warnier  wrote:

> To point correctly to the location of this drive E:, you should probably
> use instead the UNC path, like //server/share.  That is because, depending
> on the user-id under which tomcat runs, this shared directory may not
> necessarily be mapped to a drive letter, or not to the same E: drive letter.
>
>
> That's not a "probably" - you *will* have to use the UNC path :-).  Windows
services don't completely process the profile of their user as they start,
and don't map drives to shares even if such mappings are defined in the user
profile.  It's fine if E: is a local partition, however (Carl hasn't told
us, or I missed it).

- Peter


Re: Tomcat Thread utilization growing very large causing a hung tomcat instance

2010-08-03 Thread Peter Crowther
What happens if you *reduce* the allocated heap size - do you actually need
that much Java heap?  Native threads are created outside of the Java heap.
You have 2G for (4 * 400) = 1600 threads plus the OS, or about 1 Mbyte per
thread (this assumes no swap space).  That may not be enough.

- Peter

On 3 August 2010 15:21, Tomcat Novice  wrote:

> Hi,
>
> I hope someone can help me. I am new to tomcat and I have been encountering
> issues where a particular tomcat instance/s are having large thread count
> during load testing and results in a hung state. The error shown on the
> browser is: java.lang.OutOfMemoryError: unable to create new native thread
> (stack trace attached)
>
> Environment:
>
> OS: Windows 2003 64 bit
> JDK 1.5
> 8GB Total Machine RAM
> 4 Tomcat 5.5 instances running as a service on one Physical Server (each
> Tomcat configured to use 1.5GB of Heap) 4 instances x 1.5GB = 6GB of Heap
> 4 Identical servers configured the same way and load balanced
> IIS Web Server front end (AJP Port configured) no maxThreads property is
> set on server.xml for AJP port declaration. Per documentation (
> http://tomcat.apache.org/tomcat-5.5-doc/config/ajp.html), if no value is
> set maxThreads are set to 200
>
> Not all 4 servers are experiencing this problem.
>
> 1. Any ideas how I can resolve/isolate this problem?
> 2. I know I need to do a thread dump but I am not familiar on how to
> analyze thread dumps from Tomcat. Can you point me to documententation on
> how I can analyze thread dumps from Tomcat?
> 3. Also, can someone confirm if the thread dumps from JDK 1.5 are the same
> as the Thread Dumps from a JDK 1.6? I seem to be getting different formats.
> Can someone just confirm?
> 4. If the maxThread is set to 200, why are the Tomcat instances utilizing
> up to 400 Threads (see screenshot)
>
> Regards,
>
> Tomcat Novice
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: Session error while loading an object

2010-07-14 Thread Peter Crowther
On 14 July 2010 08:02, abhishek jain  wrote:

> I just realized that i am having in the Cart object which i save in
> session,
> references of datasource and message resources.
> This is creating the problem as they i believe are not serializable,
> Is there any way of overcoming them.
>
> They're not serializable for a good reason - you shouldn't really be
keeping references to system resources between requests.  As you've found
out, the session can be serialized at any time, and it may be deserialized a
long time later - potentially even after the application has been
restarted.  At this point, the references to datasources and message
resources may no longer be valid.

Why are you keeping references to the datasource and message resources in
the Cart now?  Can you re-think your design of the Cart so that it keeps
only serializable data between requests?

- Peter


Re: Session error while loading an object

2010-07-13 Thread Peter Crowther
On 13 July 2010 16:15, abhishek jain  wrote:

> On Tue, Jul 13, 2010 at 2:11 PM, Peter Crowther <
> peter.crowt...@melandra.com
> > wrote:
>
> > On 13 July 2010 09:34, abhishek jain  wrote:
> >
> > > I am using tomcat 5.5 , struts 1.x and i encounter the following error:
> > > I actually store the object in session and retrieve that(for a shopping
> > > cart
> > > application), pl. advice what i can do to remove this error:
> > >
> > > java.io.NotSerializableException: com.cart.Customer
> > >
> >
> > You need to make sure that com.cart.Customer (and anything else you store
> > in
> > the session) is serializable.
> >
> > - Peter
> >
>
> Thanks Peter,
> i will check but i get this error only at times, and not always.
> Can this still be the cause of the problem.
> thanks
> abhishek
>

Yes.  It's happening because your webapp is being reloaded (are you changing
some part of it?) and there are active sessions.  The sessions are
serialised to persist them; then the webapp is restarted; then the sessions
are deserialised.

If there are no sessions at the time the webapp is restarted, the problem
will not occur.

- Peter


Re: Session error while loading an object

2010-07-13 Thread Peter Crowther
On 13 July 2010 09:34, abhishek jain  wrote:

> I am using tomcat 5.5 , struts 1.x and i encounter the following error:
> I actually store the object in session and retrieve that(for a shopping
> cart
> application), pl. advice what i can do to remove this error:
>
> java.io.NotSerializableException: com.cart.Customer
>

You need to make sure that com.cart.Customer (and anything else you store in
the session) is serializable.

- Peter


Re: favicon when serving non-html

2010-07-06 Thread Peter Crowther
On 6 July 2010 15:10, Dola Woolfe  wrote:

> When I serve up, say, a PDF file, how do I control the favicon?
>
> What is the behaviour you would like/expect from the user agent in this
case?

- Peter


Re: Classloading

2010-06-28 Thread Peter Crowther
On 28 June 2010 14:07, Ockleford Paul (NHS Connecting for Health) <
paul.ocklef...@nhs.net> wrote:

> Pretty much and I don't know the reason why that is, I am not in charge of
> the linux servers I only started looking into it because I couldn't get my
> method to work but it worked on my local windows environment. The entire web
> app is classes so its actually a class in WEB-INF\classes, that for some
> unknown reason the entire package is also sym linked in
> tomcat\common\classes.
>
> Can you think of any reason why someone would do that? I can only assume
> that at some point in the past someone else has had classloading issues and
> decided that that hack would solve it. That is unconfirmed though.
>
> Another option would be if two different webapps "need" to share static
variables (such as a singleton) in a common class.  At that point, the
common class must only be loaded once, so must be in common (or higher).

- Peter


Re: exception on hitting tomcat url

2010-06-28 Thread Peter Crowther
Do you have an AJP connector configured on port 8081, rather than a HTTP
connector?  That would explain the symptom you're seeing.

- Peter

On 28 June 2010 11:24, vinay basavanal  wrote:

> HI all,
>
>my tomcat starts with no problem but when i hot
> http://localhost:8081/where 8081 is the port that tomcat runs
> i get following error
> EVERE: BAD packet signature 18245
> Jun 28, 2010 3:50:58 PM org.apache.jk.common.ChannelSocket
> processConnection
> SEVERE: Error, processing connection
> java.lang.IndexOutOfBoundsException
>  at java.io.BufferedInputStream.read(BufferedInputStream.java:306)
>  at org.apache.jk.common.ChannelSocket.read(ChannelSocket.java:620)
>  at org.apache.jk.common.ChannelSocket.receive(ChannelSocket.java:577)
>  at
>
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:685)
>  at
>
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
>  at
>
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
>  at java.lang.Thread.run(Thread.java:595)
>
> please help me out.
>
> --
> Thanks & Regards
> Vinay
> 9972078950
>


Re: placiing content and application on a microsoft DFS solution

2010-06-22 Thread Peter Crowther
On 22 June 2010 16:10, M.H.G. Emmerig  wrote:

>
>
> Has anyone ever placed an application and its content on a redundant DFS
> solution?
> So as when one DFS server fails, another takes over.
> Does anyone see possible problems with this setup?
> ie. when dfs server fails does tomcat loose connection to the app or is the
> failover fast enough.
>
> At best, the failover takes several seconds, during which your app will
fail to respond.  Depending on your load and application design, the queued
requests may be sufficient to run you out of heap memory, database handles
and similar.

I assume your goal is to improve reliability of end-user access to your
application.  If you have to use Windows, why would you take a DFS approach
rather than using Windows' file replication to replicate files to multiple
servers?  The probability of network failure or poor performance is orders
of magnitude higher than the probability of HDD subsystem failure or poor
performance, so I would expect accessing apps from a remote network drive to
worsen your reliability rather than improve it.

- Peter


Re: Does GC Really Matter (Is This Situation)?

2010-06-22 Thread Peter Crowther
On 22 June 2010 17:55, Robinson, Eric  wrote:

> Sorry, I wasn't referring specifically your comments. Over the years
> I've heard the same thing a few times from different sources. It seems
> to be the conventional wisdom on the subject.
>
>
> Fifteen years ago, it was right.  Memory management and GC algorithms (and
processor-memory interfaces) have come on a lot since then, and advice is
sometimes slow to change and adapt to new realities.

- Peter


Re: Setting the Right Amount of Memory

2010-06-20 Thread Peter Crowther
On 20 June 2010 16:01, Caldarale, Charles R wrote:

> All modern GC algorithms are variations of mark-sweep-compact.  The
> basic operation consists of following the object reference graph from
> a set of known roots (eg, thread stack frames), marking each
> discovered object with a found flag, and copying the found objects to
> an unoccupied area.  Unreachable (dead) objects are never encountered,
> so their number or size does not come into play.  The space occupied
> by dead objects is automatically reclaimed as live objects are copied
> over them.
>
> Note that in some variants, the cost of a compact *does* vary with the
number of dead objects.  In Squeak (Smalltalk), for example, each object
header contains the object size, and hence by implication the address of the
next object header.  Squeak's GC compacts (after the mark phase) by starting
at the bottom of object memory and iterating through each object, copying
down the live ones and updating pointers on the way. In Java, this would
only ever be necessary in OldSpace - with a generational GC where you're
collecting anything other than the oldest generation, you just copy the live
objects out as you encounter them and update any pointers to other objects
in the same generation, after which you know the space is empty.  Typically,
the speed of such a compact is limited by the speed of access to memory.
Most modern memory architectures will treat such sequential read access
specially and start to read-ahead, so the memory overhead isn't as bad as it
might be.

My GC knowledge is a little out of date, so if any of the current GC experts
wish to correct me I'll be interested!

- Peter


Re: Thread Dump

2010-06-04 Thread Peter Crowther
On 4 June 2010 06:08, suchismitasuchi  wrote:
>
> Thanks a lot.
> What will be the workaround for this?

It looks like a bug in your application, so the solution is to fix the
bug in your application.

Asking the Tomcat list how to fix your web application just because
it's hosted in Tomcat is rather like asking Microsoft how to fix the
program you've written just because it runs on Windows - in both
cases, you're likely to get the answer "Well, we can sell you some
consultancy services..." ;-).

Having said all of that, my guess is that either a) you're overloading
your MySQL database with queries or b) you have code that causes a
deadlock somewhere in the database.  In either case, I suggest
monitoring MySQL.  If it's very busy, it's probably overloaded; if
it's very quiet, you probably have a deadlock.

Good luck hunting down the problem!

- Peter

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



Re: Problems after upgrading to Tomcat6

2010-06-02 Thread Peter Crowther
On 2 June 2010 09:13, David Karlsen  wrote:

> Caldarale, Charles R Wrote:
>
> >> parent=gnu.gcj.runtime.SystemClassLoader
> >You need to use a real JVM (HotSpot, JRockit, IBM), not a toy one.
> Remove gcj from your system as quickly as possible.
>
> It seems like jpackage.org packages is having dependency towards gcj. Do
> you know perhaps about another repertory that contains prebuilt packages
> for Centos 5?
>
> It seems strange dough, that jpackage.org should build packages that is
> designed not to work on the system the packages is build for. Are you
> certain that it isn't any more convenience way to do this than changing
> the JVM?
>
> If you read jpackage.org's mission, it is to use FOSS packages wherever
possible.  Unfortunately, this means that they prefer GCJ (a toy, as Chuck
says) over software that is available for $0 but not free-as-in-speech.
This is an ideological choice, not a technical one.

And, no, there's no more convenient way to fix this than to change the JVM
to a real one.  You don't have to use the Sun JVM; it looks like jpackage
has details for both the BEA and IBM ones.

- Peter


Re: Javamelody

2010-05-24 Thread Peter Crowther
On 24 May 2010 12:48, Ozgur Ozdemircili  wrote:

> I have installed  Javamelody version 1.15. In my catalina.out there appears
> error messages:
>
> [...]



> GRAVE: A web application appears to have started a TimerThread named
> [javamelody javamelody] via the java.util.Timer API but has failed to stop
> it. To prevent a memory leak, the timer (and hence the associated thread)
> has been forcibly cancelled.
>
[...]

> Code so clean you could eat off it
>

Your code may be clean, Javamelody's isn't ;-).  Somewhere, it starts a
timer thread and doesn't clear it up.  Tomcat detects this case and cancels
the timer, issuing a warning.  You *could* leave this as-is, but it's
difficult to know what else might be leaking within Javamelody.

You might want to find out how to cancel Javamelody's timer thread, then use
a lifecycle listener in your webapp to cancel the timer on appropriate
lifecycle events.  Or talk to the Javamelody team to find out how to cancel
the timer at the appropriate time.

- Peter


Re: jsessionid problem

2010-05-21 Thread Peter Crowther
On 21 May 2010 16:16, Caldarale, Charles R wrote:

> > From: Richard Nduka [mailto:richies4...@gmail.com]
> > Subject: jsessionid problem
> >
> > I have a few quesations i want to ask about jessionid in tomcat.
>
> Thanks for asking twice - two minutes apart.  A tad impatient, are we?
>
> Also too impatient to mention the Tomcat version, JVM you're using,
> platform you're running on, and whether or not you're front-ending Tomcat
> with something like httpd or IIS?
>

*chuckle* The second one of the two had versions appended, Chuck - so there
was extra information there.

- Peter


Re: jsessionid problem

2010-05-21 Thread Peter Crowther
Richard, there are two ways of maitaining sessions:
1) Using cookies (generally Tomcat's preferred way);
2) Using URL rewriting (generally Tomcat's less preferred way, used where a
client has turned off cookies).

There are no other ways of sending session IDs that are supported by all Web
browsers across all content types, though I could conceive of some extra
ones if you were using AJAX.  Remember that the browser has to know to send
the session ID back to the server with the next request; this can only be
done using cookies or some feature of the URL.

All that said, I'm surprised Tomcat isn't using cookies in your case.  Have
you turned them off in the browser?  Have you turned on the use of URL
rewriting in the webapp's config?

- Peter

On 21 May 2010 16:06, Richard Nduka  wrote:

> Hi,
>
> I have a few quesations i want to ask about jessionid in tomcat.
>
> 1. In our web based application which runs on HTTPS, we have observed that
> the jsessionid is being appended to the URL. On close examination, we have
> observed that this is being added by tomcat to the url (Handled by the
> encodeRedirectURL method in Response.java object in the tomcat sources).
> Why
> does tomcat do this?
>
> 2. Is it possible for this to be included in the response headers rather
> than in the URL? If possible, how can one go about doing this?
>
> Thanks in advance.
>


Re: Tomcat 6.0.20 "unable to create new native thread"

2010-05-19 Thread Peter Crowther
On 19 May 2010 13:26,   wrote:
> java.lang.OutOfMemoryError: unable to create new native thread

OK, so one possibility is that the Windows thread table is full.

>   - maxThreads for HTTP: 450
>   - maxThreads for jk: 3000

That's a huge number of threads for one process.

>   - MaxThreads for HTTP: 800
>   - MaxThreads for jk: 450

That's merely massive.

>   - all connections shown by netstat -an (not filtered): 4595
>   - connections in state close_wait: 3152

That has nothing to do with threads.

> On the other hand: Shouldn't  windows start to swap if the ram is full?

Yes.  But that's not the error you're getting.

> In which memory-area does windows handle the memory which is used for the 
> threads? Is it shown in the taskmanager?

Task manager, Processes tab, View, Select Columns..., tick "Thread Count".

> Can the OS take the mem which is still unused by the JVM (memMax-memTotal) 
> for handling threads or is it reserved for the JVM after starting tomcat?

You are reserving heap and permgen memory when the JVM starts.  Thread
memory, and kernel resources for threads, are outside of this total.

> Due to problems with one of our webapps which sometimes does not close the 
> threads completely (they stuck in close_wait-state) we increased the max 
> threads of windows:
>
> http://publib.boulder.ibm.com/infocenter/pvcvoice/51x/index.jsp?topic=/com.ibm.websphere.wvs.doc/wvs/tun_conwin.html

That has nothing to do with threads (and CLOSE_WAIT is a feature of
TCP, not of threads).  That link contains no information about
increasing the maximum number of threads in Windows.  It links to
TCP/IP tuning.  Wrong link, or wrong assumption?

> maxUserPorts have been set to about 30k if i remember correctly.

That has nothing to do with threads.

> Does anyone have an idea to get rid of the exception?

*Decrease* the number of threads in use in Tomcat 1.  If you set the
HTTP and JK maxima to the same as Tomcat 2 (which is still very
large), what happens?  Why?

- Peter

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



Re: MaxPermSize / Threads

2010-05-17 Thread Peter Crowther
On 17 May 2010 13:18, Mercy  wrote:

> Hi,
>
>Please take a look at this:
> http://java.sun.com/javase/6/docs/technotes/guides/vm/gc-ergonomics.html
>
> *maximum heap size:*
>
>   Smaller of 1/4th of the physical memory or 1GB. Before J2SE 5.0, the
>   default maximum heap size was 64MB. You can override this default
>   using the |-Xmx| command-line option.
>
>
>  It does not mean just only use 1/4th, it will increase overload to system
> if more than 1/4th of the physical memory.
>

That page describes the default settings of the Java memory system: it will
use 1/4 of the physical memory of the machine.


> If you had more practical setting , please tell me.
>
> It depends on your application and your physical architecture.  I've seen
16 Gbyte Windows machines with 12 Gbyte Java heaps - 4 Gbytes was enough for
the operating system, other processes, the disk cache, and Windows' crazy
insistence on keeping 10% "available".  I've also seen 8 Gbyte machines with
64M devoted to Java, as the big memory hog was a database server on the same
machine.

Monitor your current settings to see what performance problems you are
seeing.  If your JVM is not competing with anything else for resources, try
increasing heap memory to 50% or even 75% of RAM... but, each time you
change the setting, monitor the machine to see what performance problems you
have resolved and what new problems you have introduced.

"If you don't measure it, you can't fix it."

- Peter


[OT] Re: 100% CPU when Tomcat 5.5.20 is run on Windows Server 2003 on VM machine

2010-05-09 Thread Peter Crowther
On 9 May 2010 20:51, André Warnier  wrote:
> Alternatively, you could make a donation to the forum so that we could buy a
> crystal ball.  Pid is not lending his.

... but then we'd have to answer the questions...

Besides, I *have* a crystal ball.  But I think I need to re-tune its
chronos circuitry, all it's showing is re-runs of '70s American cop
shows.  I really hope it's mis-tuned, as that would be a horrible
vision of the future.

- Peter

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



Re: Re : Tomcat 5.5.29 does not accept connections from outside

2010-05-07 Thread Peter Crowther
Marc, if you start up a command prompt and run:

netstat -an | find "8080"

... what do you get?  In particular, I'm interested to know whether the port
that's listening is bound to "*:8080" or to something like "127.0.0.1:8080".

- Peter

On 7 May 2010 11:56, Eyrignoux Marc  wrote:

>
> Thank you for the answer, but I think it is not a network problem:
>
> "nslookup epigonesrv11" answers correctly on my computer:
> Nom :epigonesrv11.epigonedom.dom
> Address:  192.168.0.6
>
>
> "ping epigonesrv11" answers also correctly (with some french in it):
> Envoi d'une requête 'ping' sur EPIGONESRV11.epigonedom.dom [192.168.0.6]
> avec 32 octets de données :
>
>
> Réponse de 192.168.0.6 : octets=32 temps<1ms TTL=128
> Réponse de 192.168.0.6 : octets=32 temps<1ms TTL=128
> Réponse de 192.168.0.6 : octets=32 temps=1 ms TTL=128
> Réponse de 192.168.0.6 : octets=32 temps<1ms TTL=128
>
> Statistiques Ping pour 192.168.0.6:
>Paquets : envoyés = 4, reçus = 4, perdus = 0 (perte 0%),
> Durée approximative des boucles en millisecondes :
>Minimum = 0ms, Maximum = 1ms, Moyenne = 0ms
>
>
>
> But "telnet epigonesrv11 8080" answers that connection on port 8080 is
> impossible:
> Connexion à epigonesrv11...Impossible d'ouvrir une connexion à l'hôte, sur
> le port 8080: Échec lors de la connexion
>
>
>
>
> As I explained anyway, all the firewalls are inactive, AND I can establish
> a connection with Tomcat 5.5.17 BUT not with Tomcat 5.5.29.
> All my installs are the simplest ever (always "next" in .exe installer;
> only unzip and launch startup.bat with zip distrib). I tried the windows
> .exe installers of Tomcat 5.5.17 and Tomcat 5.5.29, and the zip
> distributions of Tomcat 5.5.17 and Tomcat 5.5.29, and:
> - my computer contacts Tomcat 5.5.17 on port 8080 (either when installed by
> a zip or an exe)
> - my computer does not contact Tomcat 5.5.29 on port 8080
> - Tomcat 5.5.29 is running, since it is accessible from the local server (I
> log on the server, and call http://localhost:8080, and I get the admin
> console)
>
>
>
>
>
>
> 
>
>
> > Hi all,
> >
> > I have installed Tomcat 5.5.29 on Windows 2008 as a service.
> > It works fine on the computer where I installed it:
> http://localhost:8080/, http://localhost:8080/admin,
> http://localhost:8080/manager/html, http://localhost:8080/myWebApp answer
> well.
> >
> > But when I try to access it from any other computer of the local private
> network, I get a "Connection failed" error, ie. the URLs
> http://myServer:8080/, http://myServer:8080/admin, etc... do not respond.
> >
> > NB:
> > - the firewall is inactive on the server and on the clients
> > - my configuration is basic: no AJP, no proxy, no cluster, I call Tomcat
> directly on the default ports
>
> This :
> > - I tried a "telnet myServer 8080", which did not work
>
> That would tend to indicate that you have a problem which has nothing to do
> with Tomcat, but has to do with either
> - the DNS (name resolving of "myServer" does not give the IP address of
> your host)
> OR
> - something is blocking remote access to your host on port 8080
>
> and this :
> > - I tried to install Tomcat 5.5.17 instead of Tomcat 5.5.29, and it
> worked !! ie. the URLs http://myServer:8080/, http://myServer:8080/admin,
> etc... DO  respond !!
> >
> contradicts the above.
> There is a puzzle there..
>
> To find out if there is a problem with name resolution, do this :
> on the same workstation where you tried the telnet command, enter
> nslookup myServer
>
> it should tell you the IP address of that host.  If it does not, you have a
> DNS issue.
>
> To find out if there is a general network issue between the workstation and
> the server, do
> ping myServer
>
>
> In general however, instead of saying "it did not work", try to be a bit
> more specific.  What exactly happens when you do
> telnet myServer 8080
>
> Don't be afraid to paste the original error message here, we're polyglots.
>  We even have mind-readers, but they appear to be on vacation right now.
>
>
> -
> 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 5.5 won't do TLS

2010-05-04 Thread Peter Crowther
On 4 May 2010 14:22, Looijmans, Mike  wrote:
> I'm trying to enable TLS (or SSL) in a Tomcat 5.5.29 server, on a
> Windows XP machine.
>
> Whatever I do, I always end up with a server that just delivers plain
> HTML on port 443, and it doesn't even try to use TLS.
[...]
>    
>                   maxThreads="150" minSpareThreads="2" maxSpareThreads="75"
>               enableLookups="false" disableUploadTimeout="true"
>               acceptCount="10" scheme="https" secure="true"
>               clientAuth="false" sslProtocol="TLS"
>               keystoreFile="conf/server.ks"
>               keystorePass="tomcat"
>                />

See http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html .  I
suspect you're missing:
SSLEnabled="true"

- Peter

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



Re: Updating webapps classes

2010-04-30 Thread Peter Crowther
It's very hard to do this using one Tomcat instance.  It's very easy to do
this using two Tomcat instances (call them Tomcat1 and Tomcat2) and a load
balancer (Apache httpd should be fine for this job).

In normal use, Tomcat1 is running.  The load balancer directs all users to
Tomcat1.  Tomcat2 could even be stopped.
To upgrade, you upgrade Tomcat2 (and start it if needed) and tell the load
balancer that new sessions should be sent to Tomcat2.
Once all user sessions are off Tomcat1, you upgrade it and tell the load
balancer to direct new sessions to Tomcat1.
Once all user sessions are off Tomcat2, you can shut it down again or leave
it running for fault tolerance.

If you have enough RAM on your server (and the load is low enough), you
could even run all three of Tomcat1, Tomcat2 and httpd on the same server.

Does this help?

- Peter

On 30 April 2010 14:46, Gabriele Bulfon  wrote:

> Hello,
> I don't know if I'm asking something stupid, but I'm investigating this for
> days, and found
> nothing around.
>
> Updating a java webapp can be a problem when this java webapp is being ised
> 24/7 by users,
> and many of them have sessions running for all the working hours.
> Consider that this webapp consists of many instance classes being created
> during session startup.
> How can I manage updates of the webapp classes without having to reload the
> webapp?
> What I would like is that users inside the application to continue to see
> the old version,
> while new ones logging in would see the latest one.
>
> I don't know if there is any way for this
> Thanks
> Gabriele.
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>


Re: tomcat 6.0.26 can't start server - - can't read server.xml

2010-04-21 Thread Peter Crowther
The + in that listing is saying that server.xml.orig has some extra
permissions that server.xml hasn't.

Windows permissions are not the same as Cygwin permissions.  Use Windows
tools to inspect the permissions on both files, and use Windows tools to fix
the permissions on server.xml.  Also, get used to using Windows tools to
create files ;-).

- Peter

On 21 April 2010 15:15, Christoph Kukulies  wrote:

> Has there something changed in the access rights of files tomcat is
> sensitive about under Windows XP or something? I'm using to move around some
> config files using cygwin tools like cp or mv. I have to idea why tomcat
> 6.0.26 suddenly says:
>
> [...]
> This suddenly happened after I mv'ed the original server.xml to
> server.xml.orig and copied back the saved server.xml into the conf
> directory.
>
> C:\Programme\Apache_Group\Tomcat_6.0\conf>ls -l
> insgesamt 96
> drwxrwx---+ 3 Administratoren SYSTEM 0 Apr 21 15:22 Catalina
> -rwx--+ 1 kukuKein9125 Mar  9 17:06 catalina.policy
> -rwx--+ 1 kukuKein3794 Mar  9 17:06 catalina.properties
> -rwx--+ 1 kukuKein1429 Mar  9 17:06 context.xml
> -rwx--+ 1 kukuKein3321 Mar  9 17:06 logging.properties
> -rwx--  1 kukuKein6971 Apr 21 16:03 server.xml
> -rwx--+ 1 kukuKein6764 Mar  9 17:06 server.xml.orig
> -rwx--+ 1 kukuKein1557 Mar  9 17:06 tomcat-users.xml
> -rwx--+ 1 kukuKein   52068 Mar  9 17:06 web.xml
>
> C:\Programme\Apache_Group\Tomcat_6.0\conf>
>
> Any ideas?
>
> --
> Christoph Kukulies
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: How to run second instance of Tomcat 6.0.20 on separate port

2010-04-21 Thread Peter Crowther
On 21 April 2010 13:04, Kapil Godara  wrote:

> (I installed tomcat 6.0.20 using apache-tomcat-6.0.20.exe, it does not
> create any startup.bat or shutdown.bat file in bin folder. this
> installation
> creates window service. tomcat6w.exe in turn calls tomcat6.exe)
>
> That's your issue.  For no good reason that anyone on this list has been
able to fathom, the .exe doesn't contain the batch files; the .zip download
does.

To get this running, I suggest you:
1) Download the .zip version of 6.0.20;
2) Unzip it somewhere safe;
3) Copy the missing .bat files to your second installation;
4) Carry on with what you were doing now that you have the files.

If you later want to install the second instance as a second service, you
can do that - but I'd get it running standalone first.  It's far easier to
debug startup errors on a standalone Tomcat, in my experience.

- Peter


Re: gc new capacity of JVM is gradually reducing when webapp(tomcat) started

2010-04-21 Thread Peter Crowther
This says that the JVM is tuning its memory boundaries to best suit your
application.

Do you have any evidence that this is bad for your application?  Or are you
simply trying to find out why it is happening?

- Peter

2010/4/21 塗 

>
> hi,all
>
> there is a problem with my webapp.
>
> by manual configuration, i allocated 1G(1024M) memory for webapp.
> where the gc new capacity automatically is 262M, the gc old capacity
> automatically is 699M, S0/S1 automatically is 43.6M/43.6M.
>
> When my webapp is started, I use the jvm's own tools(jstat) to trace the
> garbage collections.
> when the 6th Young garbage collection has happened, gc new capacity(262M)
> is gradually reducing.
> About 10 hours after, gc new capacity is only 40.6M.
>
>
> ##web operating environment:
>  tomcat5.5.27 + Apache/2.2.3 + jdk1.5.0_13 + Linux_x86_64
>
> ##blow is my manual configurations for tomcat JVM
>  CATALINA_OPTS="-Xms1024M -Xmx1024M
> -Dorg.apache.jasper.compiler.Parser.STRICT_QUOTE_ESCAPING=false"
>
>
> ##Jstat Tracking data (unit/k)
>  systemTime --- S0C   ---  S1C  --- S0U --- S1U--- EC ---
>  --- OC --- OU   --- YGC --- YGCT  --- FGC --- FGCT --- GCT
>  10:03:10   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---
>  217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132
> ##webpp startup
>  10:03:13   --- 43648 --- 43648 --- 22444.3 --- 0  --- 262208 ---
>  217735.7 --- 699072 --- 163.6 --- 4  --- 0.126 --- 1   --- 0.007 --- 0.132
>  :
>  10:11:35   --- 43648 --- 43648 --- 0   --- 22445.1--- 262208 ---
>  261516.6 --- 699072 --- 163.6 --- 5  --- 0.161 --- 1   --- 0.007 --- 0.168
> ##5th YGC
>  10:11:38   --- 20800 --- 33984 --- 19898   --- 0  --- 258688 ---
>  4845.1   --- 699072 --- 163.6 --- 6  --- 0.192 --- 1   --- 0.007 --- 0.199
> ##6th YGC, EC is reduced.
>  :
>  10:18:41   --- 33152 --- 19968 --- 0   --- 19949.1--- 255232 ---
>  --- 699072 --- 163.6 --- 7  --- 0.221 --- 1   --- 0.007 --- 0.228 ##7th
> YGC, EC is reduced.
>  :
>  18:34:43   --- 640   --- 704   --- 608 --- 0  --- 40832  ---  58
>  --- 699072 --- 87896 --- 380--- 5.413 --- 1   --- 0.007 --- 5.419 ##380th
> YGC, EC is reduced.
>
>
> this problem has been troubling me. please help !
>
>
>
> --
> Get the new Internet Explorer 8 optimized for Yahoo! JAPAN
> http://pr.mail.yahoo.co.jp/ie8/
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Way to generate a "localhost.log" instead of "localhost-4-20-2010.log"?

2010-04-19 Thread Peter Crowther
Hmm.  As the log files will alpha-sort by date, something like vim `ls
~/localhost.log* | tail -1` might do it.  Beware - my shell script is rusty
at best.

- Peter

On 19 April 2010 15:29, laredotornado  wrote:

>
> Hi,
>
> I'm using Tomcat 6.0.26 on Mac 10.6.3.  Currently, in my
> $CATALINA_HOME/logs
> directory, Tomcat produces a localhost*log file with the date in the file
> name for each day, for example -- localhost.2010-04-19.  Is there a way to
> get Tomcat to generate simply "localhost.log" for whatever day today is?
>  If
> not, does anyone know a shell short cut where I can just type in something
> like "vim ~/localhost.log" and see the most current log without having to
> specify today's date?
>
> Thanks, - Dave
> --
> View this message in context:
> http://old.nabble.com/Way-to-generate-a-%22localhost.log%22-instead-of-%22localhost-4-20-2010.log%22--tp28287685p28287685.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: Apache Tomcat 5 does not work on port 80

2010-04-08 Thread Peter Crowther
On 8 April 2010 16:52, Caldarale, Charles R wrote:

> Use netstat -ano, note the pid, and look it up in Task Manager.
>
> tcpview (http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx)
should give you the process directly, but Chuck's suggestion is less
invasive :-).

- Peter


Re: Apache Tomcat 5 does not work on port 80

2010-04-08 Thread Peter Crowther
Check you don't already have IIS running on port 80.  If you look in
Tomcat's logs, there should be a bind exception if that's the case.

Is there any reason you're using 5.0?  It's very old, and is no longer
supported.  This means that, for example, it has known security holes and
they will never be fixed.

- Peter

On 8 April 2010 16:33, Sulaiman Paperwalla  wrote:

> Hi,
>
>
>
> I have tomcat 5.0 installed on a windows server 2008 machine.  Tomcat is
> the
> only web server installed.  When I change the port to anything other than
> port 80, for example 8080, I can successfully access the website, but it
> does not work for Port 80.  I have made sure the port is open in the
> firewall and I can remotely telnet to port 80 with not problems.  Any
> suggestions on what I should be testing to resolve this problem?  I am a
> newbie to Tomcat.  Thanks!!  Here is the server.xml:
>
>
>
> 
>
>
>
>  
>
>  
>
>
>
>
>
>
>
>
>   maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
>
>   enableLookups="true" redirectPort="8443" acceptCount="100"
>
>   debug="0" connectionTimeout="2" URIEncoding="utf-8"
>
>   disableUploadTimeout="true" />
>
>
>
>
>
>
>   enableLookups="true" debug="0"
>
>   protocol="AJP/1.3" URIEncoding="utf-8" />
>
>
>
>
>
>
>
>
>
>  
>  prefix="catalina_log." suffix=".txt"
>
>  timestamp="true"/>
>
>
>
> 
>
> directory="D:\Program Files (x86)\NetXposure\ImagePortal\WEB-INF\logs"
> prefix="access." suffix=".txt" pattern="combined" resolveHosts="true" />
>
> directory="D:\Program Files (x86)\NetXposure\ImagePortal\WEB-INF\logs"
> prefix="debug." suffix=".txt" timestamp="true"/>
>
> "true"/>
>
>
>
>
>
>   
>
>  
>
> 
>
>
>
>
>
>


Re: Tomcat 7 and securityfilter [or A Love Letter to markt]

2010-03-30 Thread Peter Crowther
On 30 March 2010 23:50, Mark Thomas  wrote:

> I feel a Baldrick[1] moment coming on.
>

"Baldrick, what starts with 'Come here!' and ends with 'Ouch'?"
   "Dunno"
"Baldrick, come here!"

   "Ouch!"

... or was there a different moment you had in mind, Mark? :-)

- Peter


Re: Virtualization (Xen, vmware) + Tomcat

2010-03-30 Thread Peter Crowther
On 30 March 2010 16:45, Caldarale, Charles R wrote:

> > From: peter.crowth...@googlemail.com
> > [mailto:peter.crowth...@googlemail.com] On Behalf Of Peter Crowther
> > Subject: Re: Virtualization (Xen, vmware) + Tomcat
> >
> > > Error occurred during initialization of VM
> > > Could not reserve enough space for object heap
> >
> > OK, so that's the Java virtual machine running Tomcat not
> > being able to extend its heap.
>
> Actually, that's the JVM trying to allocate the *initial* space for the
> heap, not extend it.  There hasn't been any attempt to load and run Tomcat
> yet.
>
>
> My mistake.  In that case, if Eric's seeing lots of those in the log files,
it implies that the JVM intended to host Tomcat is repeatedly failing to
start and some other process is repeatedly trying to start Tomcat.

Eric, could you tell us more about your statement that "Tomcat is running
inside the VM and is, by the way, a cPanel"?
- What operating system?
- What version of Tomcat?
- Did you download the Tomcat directly from http://tomcat.apache.org, or was
it packaged with some third-party software?

In particular, if it's a version of Tomcat that was packaged with cPanel,
you may well be better asking them about the issue.

- Peter


Re: Virtualization (Xen, vmware) + Tomcat

2010-03-30 Thread Peter Crowther
There are two uses of "virtual machine" here.  I'll distinguish the Java
virtual machine and the Xen virtual machine.

On 30 March 2010 16:29, Eric Laflamme  wrote:

> We have a lot of server using virtualization (xen source) and we have a lot
> of problem with tomcat. Tomcat process seems to stop responding after
> undetermined time and write in loop this in the catalina.out:
>
> Error occurred during initialization of VM
> Could not reserve enough space for object heap
>

OK, so that's the Java virtual machine running Tomcat not being able to
extend its heap.

Is Tomcat running inside a Xen VM?  If so, how much memory is allocated to
the Xen VM?

>
> The servers has 32 gig of ram so it's not the ram that is in need.


*Which* server?  The host for your Xen virtual machines, or a particular Xen
virtual machine?


> We tried to specifiy the memory for tomcat like:
>
> -Xmx1024M
> -Xms512M
>
> But nothing seems to help. Does anybody have any ideas for this behaviour?
>
> Keep -Xms and -Xmx the same.  If you do that, Java will allocate all the
heap as it starts.  You will either get a failure at startup (which is
easier to deal with) or the heap memory will be allocated.

As you have found, allowing Java to grow its heap while it is running causes
problems when another process is using memory.

- Peter


Re: jvm exits without trace

2010-03-27 Thread Peter Crowther
On 27 March 2010 00:22, David Kerber  wrote:

> BTW, after looking back at my development notes, the jdbc-odbc bridges,
> while a pain to set up, have better performance than the type 4 drivers that
> Sybase also offers.
>
> That's frightening, given the extra layers of code for the ODBC bridge.  If
I were Sybase, I'd be ashamed of my code quality - or trying to implement
the missing features that cause your application to behave better with the
ODBC bridge.

- Peter


Re: Problem with different protocols and ports

2010-03-25 Thread Peter Crowther
This is a feature of the protocol; there's nothing you can do about idiot
users who type strange things into their browsers' address bars.

What you *can* do is run your services on the standard ports - 80 and 443 -
so that your users don't have to type in port numbers.  Is there any reason
you're not using the standard ports for this application?

- Peter

On 25 March 2010 14:47, Hagenlocher-Wemssen, Andreas <
andreas.hagenlocher-wems...@siemens.com> wrote:

> Hi all,
>
> I got a peculiar problem on a apache tomcat 5.5 server:
>
> Several clients, which could use the wrong port for their protocol.
>
> On the server there is a http port on 8080, and a https port on 8443 as
> default.
>
> Unfortunately, on the clients there are possibilities to combine the
> protocol freely with a port, so It could be that they try to connect with
> https to 8080 (which results in a timeout on the client, triggering a error
> message),
>
> Or with http to 8443, which gets a rather unpleasant surprise, they get a
> page, without an error message, with some cryptic characters:
>
> 
>
> [1][1]
>
> I would like to get a error message back ... can anyone help me?
>
>
>
> Andreas Hagenlocher-Wemßen
>
>


Re: need help

2010-03-24 Thread Peter Crowther
It depends entirely on your application.  500 users each asking for one
static HTML page every 10 minutes?  Sure, no problem.  500 concurrent users
requesting 1 page every 10 seconds that takes 8 seconds to generate?  Ah,
now you're going to have to do some tuning.

Have you profiled your application?  Do you know what load you expect?

- Peter

On 24 March 2010 17:38, Muralidhar Yaragalla wrote:

> Hi, I have to run tomcat against 500 concurrent users. I am using tomcat6,
> Java1.6 and tomcat running on windows2003 OS. Do I have to do any
> additional
> configuration for this in tomcat or no configuration required?  Kindly help
> me. Do I have to specify any maximum threads allowed or kind of things? Pls
> help me guys.
>
>


Re: can't seem to migrate this app over to a new server

2010-03-24 Thread Peter Crowther
The SSL configuration for a Tomcat 5.5 server is described at
http://tomcat.apache.org/tomcat-5.5-doc/ssl-howto.html.  To quote from the
top of that file, this assumes you're not using APR (Apache Portable
Runtime).  APR is not the default configuration as I recall - if you don't
know that you are using APR, you're probably not!

I'll leave someone who knows more about the crypto side to answer your
question about the JKS file.

Can you set this up and test it in two stages?  In the first stage, set up
Tomcat and the webapp and see whether you can get to the app through normal
HTTP.  In the second stage, set up SSL.  The main thing that might prevent
this is if there's a transport guarantee of CONFIDENTIAL in your
application's WEB-INF/web.xml file - if there is, you might want to comment
that out while testing over HTTP, then put it back after you've got SSL
working!  A google for something like "web-inf web.xml transport-guarantee"
will give you more details.

Good luck with the configuration.

- Peter

On 24 March 2010 06:22, joon yoo  wrote:

> We're in the process of extricating ourselves from a host who developed and
> managed our app through their own hosted server.
>
> In attempting to move the app over to a server under our control:
>
> Tomcat 5.5.28 w/ admin package
> java 1.5.0_28
> Windows 2003 R2
>
> all they gave me was a zipped up directory under their "webapps" dir and
> the
> JKS file for SSL.
>
> Do I need anything other than the JKS file to transfer the SSL cert over to
> our new tomcat server?
>
> Also, in trying to setup the app, I installed tomcat and unzipped it under
> webapps. and subsequently when i try to connect to the app through
> localhost/ourapp it gives up an error:
>
> "Firefox can't establish a connection to the server at localhost:8443"
>
> I know very little about tomcat and java, so please at the very least, any
> answers that can be fully googleable, I would greatly appreciate.
>
> Thanks,
>
> John
>


Re: Portable

2010-03-18 Thread Peter Crowther
On 18 March 2010 16:59, Christopher Schultz wrote:

> If, as Todd reports, the JVM can be installed to a USB stick, Id just go
> with that: pick a port that's unlikely to be used by the host machine
> (like 80801) and use that for your setup. Avoid using anything other
> than Tomcat and I think you can get Tomcat to auto-adjust the port
> number by finding the next-highest available port if the one you specify
> if already taken: your demo-launch procedure should take care to detect
> the port number chosen, and configure itself accordingly.
>
> The hard part then is MySQL.  Is there any way you can go for a pure Java
database that runs in the same JVM?

- Peter


Re: Tomcat not able to access folder which is in virtual drive

2010-03-18 Thread Peter Crowther
On 18 March 2010 08:58, Ganesh Sabbani  wrote:

> I have created the project in eclipse and it is working perfectly fine
> using tomcat and reads the log files, but the issue which i am facing is
> when i create a WAR file and deploy it on tomcat it is unable to access the
> virtual drive!
>

What user is the deployed Tomcat running as?

Can that user see the mapped drive?

Remember that if you're starting Tomcat as a Windows service, Windows only
does a partial profile load - it doesn't re-create mapped drives for the
service.


> Please reply as soon as possible.
>
> As a friendly note... if you include this at the bottom of requests for
free support on mailing lists, you are more likely to annoy people who might
reply and *less* likely to get a fast answer.  We do this out of kindness,
not because we're paid.

- Peter


Re: Tomcat-Spring-Eclipse/Flex Classpath Issue

2010-03-17 Thread Peter Crowther
On 17 March 2010 14:50, Goldberg, Michael1 wrote:

> Hello
>
> I am using Tomcat version 6.0.x, Spring 2.5 in eclipse 3.4.2.  Trying to
> configure a tomcat webserver which hosts the backend for a flex web app.
>
> Now on startup tomcat is having an issue resolving some spring dependancies
> which appears to be a classpath issue.  As far as I can tell the classpath
> is set correctly.


How are you testing this?


> What can be the issue?
>
> Usually, the issue is relying on the class path rather than including *all*
the jars you need with the webapp.  Webapps are intended to be
self-contained, and servlet containers such as Tomcat can modify the
classpath, use their own classloaders that load classes in a well-defined
order that is not what a Java developer expects, and other oddities.

- Peter


Re: [OT] Re: jvm exits without trace

2010-03-17 Thread Peter Crowther
On 17 March 2010 10:22, Taylan Develioglu  wrote:

> Ofcourse this works better if I really attach the file.
>
> [...]

> Java Threads: ( => current thread )
>  0x7f3d3c174000 JavaThread "MSN-6488" daemon [_thread_in_native,
> id=28966, stack(0x42a4f000,0x42a7)]
>
[...]

Are you *absolutely sure* you pin down or copy *everything* you access from
all of your native code so that the Java garbage collector cannot move it?

- Peter


Re: [OT] Re: jvm exits without trace

2010-03-17 Thread Peter Crowther
On 17 March 2010 10:16, Taylan Develioglu  wrote:

> Here's a hs_err file after a crash I had yesterday.


The list usually strips attachments; could you paste it?


> It's a sigsegv in GCTaskThread. From the occupation in eden it looks
> like it happened during a scavenge (ParNew).
>
> Ick.  To roughly quote Dan Ingalls (who wrote several of the Smalltalk VMs,
including their garbage collectors): "studying the behaviour of objects in
the garbage collector is like studying frogs using a blender".  I've tried
modifying Squeak's GC algorithm, and that pretty much sums up my
experiences!

I'd expect seg faults in a GC thread to occur if, for some reason, pointers
were getting corrupted on the stack or in the heap, or if a concurrency
issue caused a read or write to the "old" location of an object after it had
been moved.  The GC is very sensitive to such things as it traces large
portions of object memory, so may well stumble across corruption before any
other thread does so.

- Peter


Re: Tomcat 6 on RHEL3

2010-03-17 Thread Peter Crowther
On 17 March 2010 07:23, Ningappa Koneri  wrote:

> It took abt 1328 seconds to startup the applications. Please help.
>
> Did you see my response yesterday?

-- snip --
What's the spec of the machine on which you're running Tomcat?  How much
heap and permspace have you allocated to the Java virtual machine in which
Tomcat is running, and how much memory is it using?  (top will tell you how
much memory it's using; it will be more than heap+permspace due to other
operating system structures)

Is the machine busy during all this time?  If so, what is the limiting
factor - disk i/o, memory or CPU?  Run top to get an idea of CPU usage,
vmstat (I use "vmstat 5" until I have a better idea) to get an idea of disk
i/o.

How large is the war file?  If you unzip the war files (a war file is just a
zip file with a different extension) on the same machine, how long does it
take?
-- snip --

- Peter


Re: apache responds with 413 for duplicate http header

2010-03-16 Thread Peter Crowther
There are lots of Apache projects.  You want the mailing list for Apache
httpd; this is the mailing list for Apache Tomcat.  Try re-posting on a more
appropriate list :-)

- Peter

On 16 March 2010 18:30, Prabhat Karki  wrote:

> Hello,
> I have apache installed on redhat linux. The version is below
> Server version: Apache/2.2.11 (Unix)
> This server is basically accepting requests on port 80. However if the
> incoming requests has duplicate http headers for the same requests the
> apache responds with a 413 error. In the example below the client has two
> Content-Length headers and as shown the response from apache is 413. All the
> header information is not included below for obvious reasons. Is there any
> config changes that can be applied to apache to ignore the duplicate headers
>
> POST http://example.com HTTP/1.1
> Host:example.net.net:80
> User-Agent: .1
> Content-Length: 70
> Content-length: 70
> Content-Type: application/x-www-form-urlencoded
>
>
>
> ACTION=search&CUID=7QCJVqZNuujgdluDNZTXTA%3d%3d&CATALOG=HOME&GCLIENT=PHTTP/1.1
> 413 Request Entity Too Large
> Date: Tue, 16 Mar 2010 15:39:37 GMT
> Connection: close
> Content-Type: text/html; charset=iso-8859-1
> 
> 
> 413 Reques
>
> Thanks in Advance
> Prabhat
>
>
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Sporadic errors during high load

2010-03-16 Thread Peter Crowther
Thanks for a comprehensive statement of the problem - so many people don't
include the basics, let alone the details!

A few thoughts inline.

On 16 March 2010 13:58, Patrik Kudo  wrote:

> We run a load test scenario using the Proxysniffer load testing tool on a
> machine connected to the same switch as the server under load. The load test
> simulates 3100 users


Why this number?  What happens if you increase it - does the incidence of
the problem increase?  This might make it easier to track down.


> looping over 27 pages of varying complexity.


Again, can you force the issue by tuning which pages are requested?


> Proxysniffer reports all errors as "Network Connection aborted by Server"
> but when we look at each error in detail we can see that they don't all
> occur at the same stage in the request cycle. Some occur on "transmit http
> request", some on "open network connection", some on "wait for server
> response", but all within the same second.
>

It'd be interesting to run (say) Wireshark and sniff the TCP connections.
In particular, that sounds like TCP RSTs coming off the server but it would
be good to verify that and to see at which points in the negotiation they
happen.

>
> The application logs show nothing unusual. The access logs show nothing
> unusual. We've included the session ids in the tomcat logs and the failing
> urls doesn't show up in the access log at all for the given session id
> (cookies are shown in the error report).
>

That's interesting; I'll leave better-qualified people to comment on what
code paths this eliminates.


> We've been able to match some of the errors with full collections reported
> by the flags "-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps" but
> some errors occur where there are no full GC occuring.
>

How long do your full GCs take?


> # Memory limits (we've tried both higher and lower values here)
> JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=192m -Xmx1800m -Xms1800m"
>

That's a small part of a 32G machine, but you're seeing no out of memory
errors so it's a sign of good design and coding ;-).

FreeBSD 8.0-RELEASE-p2 with diablo-jdk1.6.0 (we also tried openjdk6).


Can you tell us *exactly* which versions of the JDKs?
http://www.freebsd.org/java/ tells me 1.6.0-7 is current - sorry, I'm not as
well up on FreeBSD Java versions as some other OSs.

- Peter


Re: Tomcat 6 on RHEL3

2010-03-16 Thread Peter Crowther
On 16 March 2010 10:02, Ningappa Koneri  wrote:

> Dear All,
>
> I have an issue with tomcat 6


Version?


> which is deployed under RHEL3 with JDK5


Version?


> , the problem is tomcat is taking hell lot of time in deploying the war
> files when started.
> It's so busy that not responding back with home page also, what could be
> the problem ?
>
> How long is "hell lot"?  The log message should tell you "Tomcat started in
ms".

What's the spec of the machine on which you're running Tomcat?  How much
heap and permspace have you allocated to the Java virtual machine in which
Tomcat is running, and how much memory is it using?  (top will tell you how
much memory it's using; it will be more than heap+permspace due to other
operating system structures)

Is the machine busy during all this time?  If so, what is the limiting
factor - disk i/o, memory or CPU?  Run top to get an idea of CPU usage,
vmstat (I use "vmstat 5" until I have a better idea) to get an idea of disk
i/o.

How large is the war file?  If you unzip the war files (a war file is just a
zip file with a different extension) on the same machine, how long does it
take?

Lots of questions, but we need more information to be able to answer.

- Peter


Re: Tomcat doent run on Vista

2010-03-14 Thread Peter Crowther
On 14 March 2010 06:29, Cummins College  wrote:

> Does tomcat have a problem running on Windows Vista?


No.


> I cannot run my web
> application with vista as OS and jdk1.5
> What changes do I need to make?
>
> You have given us no details of "cannot run", no log messages and no
details of the configuration.  We cannot help you without those details.

- Peter


Re: Disabling http connector

2010-03-11 Thread Peter Crowther
On 11 March 2010 12:24, Cummins College  wrote:

> We know most of you dont exactly agree or approve of our idea about
> fiddling
> with the http connector, but please do help!
>
> I don't have enough information to agree, disagree or help.  I've never
seen a sufficiently clear message about what - from a human point of view -
you are trying to achieve.  How does what you are trying to do help any of
the following people?  Be specific!

- The end-user of the application (there may be several kinds);
- The system administrator of the application;
- The developer of the application;
- The person who is paying for development of the application;
- The person who is auditing the application for compliance with policies.

At the moment, I don't know how any of these people - or anyone else -
benefits from what you are trying to do, whereas I can see how it causes
trouble for them.  So I don't know how to help you!

- Peter


Re: Secured photo rendering

2010-03-10 Thread Peter Crowther
On 10 March 2010 15:30, János Löbb  wrote:

> When I use the DVD Player from Apple, I cannot take a screenshot even if I
> click myself to the Finder first.  So there is something already in practice
> that prevents from taking a screenshot :-)
>
> Yes - for an application that runs as a process on a particular operating
system, and generates the images within that application.  Even then, I
suspect there are ways of scraping the pixels from the video card's frame
buffer.

However, showing an image from a web server in a web browser does not give
you operating system protection.

- Peter


Re: Apps deployed with tomcat manager: No +w to group.Why?

2010-03-10 Thread Peter Crowther
On 10 March 2010 10:51, André Warnier  wrote:

> Jimmy Spam wrote:
>
>>
>> Please, excuse my poor english.
>>
> It sounds fine.
>
>>
>> When I deploy an java app (.war file) with tomcat manager, it create the
>> folder of this app inside of webapps with user: tomcat, group: tomcat  and
>> permissions 750. I need, at least, have write privilege for group (770),
>> since some user of my system (wich are inside of tomcat group), need can
>> modify files of the apps.
>>
>> Can I change this behavior?
>>
>>  Hi.
>
> Maybe not directly in Tomcat (although since it is open-source, you could
> modify the Manager application yourself).
>
> Check the umask at the instant Tomcat starts.  If you're starting it as a
service, it may well be starting with umask 027.  You should be able to
override that in the startup script and start Tomcat with umask 007 -
although this would cause *any* file Tomcat writes to be group-writable.

I can't think of a way of doing this on a per-webapp basis.

- Peter


Re: SSL with IBM JVM

2010-03-08 Thread Peter Crowther
On 8 March 2010 12:53, Carl  wrote:

> Switched to the latest IBM JVM last Friday.  We run https for all
> applications as we deal mostly with children's data.  About 10% of the users
> experienced problems with accessing the site.  Both IE and Firefox caused
> problems.  Switching them to http eliminated the problem but we can not run
> that way on a regular basis.
>
> Here is what we have done:
>
> IE - IE 6 simply doesn't work.  If IE 8 is installed, removing it and
> reinstalling it seems to allow it to work.  If both IE and Firefox are
> installed, both must be removed and IE 8 installed first followed by Firefox
> seems to allow IE 8 to work.
>
> Firefox - The 'Use TLS 1.0' must be selected but it still doesn't always
> seem to work.  Sometimes (I can't tell you the characteristics), the
> customer must go through the remove and re-install process described above.
>
> I believe the remove and re-install process is likely setting some value to
> the one that allows the browser to work.  Does anyone have any idea what
> that setting would be to avoid all this removing/re-installing?
>
> There are a number of possibilities.  Could you give us any more detail on
which particular "doesn't work" you're getting?  Browser hangs?  Blank pages
returned?  Certificate errors?  Error messages from browsers or server?

- Peter


Re: Best practise very secure system without any password in cleartext

2010-03-08 Thread Peter Crowther
On 8 March 2010 09:55, Alexander Diedler  wrote:

> We have to create an Application with an Offline Client based on Tomcat and
> SQL Server on Laptops. That means, that the Laptops has an local installed
> Webserver with Tomcat and a local installed SQL Server (Full oder Express
> Edition 2005). Now, in case to stolen laptops it is very unsecure to wrote
> the sa user with uncrypted password in some properties files. My idea was,
> to manage the whole communication direct with the SQL database instead of
> tomcat-users.xml. It is possible to make a full working system without any
> local stored password in the properties file? It is possible to use Windows
> internal Kerberos (etc) authentication with domain users etc and start the
> SQL Server and Tomcat Server with Serviceaccounts?
>
> You can certainly start both using service accounts and use Windows
authentication - both the jTDS and Microsoft JDBC drivers support Windows
authentication into SQL Server.

However, I'm not sure what this buys you, as a cracker who knew what they
were doing could simply add their own code to a webapp to extract whatever
details they wished from the database, with the same credentials as the
webapp.  Of course, that webapp should not connect to SQL Server using sa,
or in fact anything in the sysadmin or dbo roles.  At this point, assuming
you keep a different password for each machine, I cannot see why Windows
authentication is significantly more secure than storing the account's
password in cleartext.

Also, if you are taking the laptops offline, I would be *very* cautious
about using domain accounts as service accounts.  Windows will cache domain
credentials for some time, but not for ever.  You do not want the
application to fail due to losing the cached credentials.

- Peter


Re: 2 windows services on the same tomcat 5.5 instance

2010-03-05 Thread Peter Crowther
One Tomcat "instance" = one process = one service.

But you can create two or more copies of Tomcat.  They can be the same or
different versions.  If you want, they can share binaries and just have
different working, config and webapps directories.  You can register each of
them as a service, and start or stop each of them independently.

Is this what you want to do?  If not, please tell us more about what you
mean by "working on the same tomcat instance".

- Peter

On 5 March 2010 10:20, gasp_marino  wrote:

> Hi,
>
> i am a new tomcat user...i have read that i can install 2 tomcat instance
> on the same machine...
>
> But what about to have 2 windows services on the same tomcat
> instance/home??
>
> I'm working on windows server (2003-2008) and Tomcat 5.5.28
>
> Can I create another service, may be listen on another port, working on the
> same tomcat instance??
>
> Thanks a lot
>
> best regards
>
> Gaspare
>
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Creating a directory from a webapp

2010-03-04 Thread Peter Crowther
On 4 March 2010 15:43, Florent Georges  wrote:

> In the meantime, using strace, I figured out what the problem
> was: as simple as a wrong owner of one of the parent directories.
> I must admit I am not really proud of this, but well, there is no
> diagnostic at all with mkdir() :-(
>
> Glad you found it - that's what the diagnostic tools are for!

- Peter


Re: Creating a directory from a webapp

2010-03-04 Thread Peter Crowther
On 4 March 2010 10:40, Florent Georges  wrote:

>  Hi,
>
>  Within my webapp, I try to create a new directory on the file
> system by using File.mkdir().  This webapp has the permissions
> read & write on the parent directory:
>
>grant codeBase "file:${catalina.base}/webapps/myapp/-" {
>  permission java.io.FilePermission "/somewhere/-", "read,write";
>}
>
>  The creation fails, but of course, I do not have any info
> (because mkdir returns true or false instead of throwing an
> exception).
>
> Can you run Tomcat with something that traces system calls?  strace(1) on
most UNIXes, Process Explorer on Windows.  Then you can see exactly what
mkdir call is being issued - or, if none is issued, you can see that and
chase down why.

- Peter


Re: Tomcat threads

2010-03-03 Thread Peter Crowther
On 3 March 2010 18:24, Bharath Vasudevan  wrote:

> Hmmm...
>
> "No, the server will allocate maxThreads request handlers; the other
> requests would sit in the TCP stack's queue (not in the JVM), up to the
> configured acceptCount value - which you can set as high as your OS
> allows."
>
> I was assuming that the tomcat main thread is going to pick it up from the
> TCP stack and let the web server thread handle the request. Wont tomcat
> reject the request when max threads have been reached (since it would have
> already picked up tcp layer)?
>
> No, because the container doesn't know when a thread might become
available.  Serving content after a delay is considered better than not
serving content at all, so the requests are simply queued in the TCP stack.

- Peter


Re: getServerName returns 'localhost'

2010-03-03 Thread Peter Crowther
On 3 March 2010 13:47, André Warnier  wrote:
> André Warnier wrote:
>> vgud wrote:
>>> My server responds to different domain names, and I want to know which
>>> one users use.
[...]
> More precisely :
>
> getRemoteAddr
>
> public java.lang.String getRemoteAddr()
>
>    Returns the Internet Protocol (IP) address of the client or last proxy
> that sent the request. For HTTP servlets, same as the value of the CGI
> variable REMOTE_ADDR.

Andre, you're answering the question of "which client sent this request?"

The OP is asking a different question: "What hostname did the client
send this request to?"

I'd parse the host header in the request to find out, but that's just me!

- Peter

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



Re: Apache Tomcat v5.5.20 - Revision 902650 Question

2010-03-02 Thread Peter Crowther
On 2 March 2010 14:08, Hoang, Phong T CTR Navy ERP
 wrote:
> Environment:  Apache Tomcat version 5.5.20, Windows Server 2003 R2 Enterprise 
> Edition x64
>
> Apache Tomcat is embedded with the Business Objects software install and not 
> a standalone install.
>
> Attempted to apply fixes from Revision 902650 for the vulnerabilities 
> identified but the following files are not found in the Tomcat home folder:
>
> tomcat/tc5.5.x/trunk/container/catalina/src/share/org/apache/catalina/loader/LocalStrings.properties
[...]>
> What does this mean and how do I apply the revision if those files are not 
> found.  Please advise.

It means that you should talk to SAP's tech support to get an updated
version of the embedded Tomcat that they've customised for Business
Objects.

- Peter

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



Re: GC(JVM Heap usage) tool

2010-03-01 Thread Peter Crowther
On 1 March 2010 08:30, Paulwintech  wrote:
>  I need to check how many threads are running and its memory utilization in
> tomcat6, I used jstack command to get thread details - but not able to get
> memory usage details.
>
>  Recently i get free memory critical for the particular time from tomcat6
> and automatically get resolve after some time.I am not able to troubleshoot
> the exact issue causing free memory critical - So to troubleshoot and to
> find the exact reason - i wanted to know how to check the number of threads
> are currently running and its memory usage.
>
>   After knowing the exact thread - i can check why that particular thread
> occupies more memory. If im wrong please let me know any other ways to check
> the issue.

Much of the memory use is not thread-specific.  For example, Session
objects that are held for sessions that don't currently have a request
are not associated with any thread.  So I think you will have problems
checking why particular threads occupy more memory.

Also... how do you know your monitoring system isn't giving false
alarms?  A garbage collector should only run when it needs to - when
the JVM doesn't have enough free memory to satisfy the memory it
expects to use before the GC completes.  So I would expect free memory
to decrease to a very low amount, then the GC will run and free memory
will increase again.  Are you sure you understand what your monitoring
system is telling you, and once you know you understand it are you
sure you want to respond to that particular alert?

- Peter

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



Re: possible memory leak tomcat 6?

2010-03-01 Thread Peter Crowther
On 27 February 2010 20:26, Sander de Boer  wrote:
> Hi,
>
> My tomcat server gives often a out of mem.
> When dumping the heap I found much instances of these objects:
>
> Class InstanceCount TotalSize
> class org.apache.tomcat.util.buf.ByteChunk 439493 20656171
> class org.apache.tomcat.util.buf.CharChunk 432383 16862937
> class org.apache.tomcat.util.buf.MessageBytes 414753 24055674
>
> My configuration:
> Tomcat: 6.0.16
> Java: 1.6.0_14
> OS: Solaris 10
>
> Can this be a memory leak in Tomcat?

It's not impossible that you've found an edge case in Tomcat, but
Tomcat has been tested very heavily in high-traffic sites for many
years and memory leaks have been removed as they're found.  The
experience on the list is that it's far more likely to be something in
your application that's holding on to Tomcat objects.

I'd suggest analysing that heap dump in more detail with one of the
heap analysis tools.  Find a few of the objects that you think are
causing the problem and trace back their references - what's holding
on to them?

Also, Pid makes a very important point.  Are you sure you have the
right objects?  You've chosen these classes, presumably because they
have the highest total byte count?  Or the highest total number of
instances?  I'd be looking down the list to see what other classes
have unexpectedly high instance counts, and seeing what they hold on
to.

- Peter

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



Re: [OT] Batch-processing of emailed log4j log messages

2010-02-24 Thread Peter Crowther
On 24 February 2010 18:38, André Warnier  wrote:
> Come to think of it, the whole thing in perl is probably a 10-liner, using a
> hundreth of the memory you'd need with Java.

Yep, absolutely - the kind of processing that perl was designed for,
and is very good at.

I'd make other comments about perl's ancestry and its use as a
general-purpose programming language, but then I'd be responding to
the troll with a flame ;-).

- Peter

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



Re: Webapp slow down after idle - 5.5.x

2010-02-22 Thread Peter Crowther
On 22 February 2010 19:07, Caldarale, Charles R
 wrote:
> Sounds like the OS might be paging out Tomcat, and taking a long time to get 
> all the necessary pages back in when a request is made.  I'm not familiar 
> with operational details of AIX, but I would suspect there are some 
> system-level monitoring tools available to see if there is a paging spike in 
> this situation.

vmstat 
(http://publib.boulder.ibm.com/infocenter/aix/v6r1/index.jsp?topic=/com.ibm.aix.cmds/doc/aixcmds6/vmstat.htm)
would do the job.  No finesse, but sufficient information :-).

- Peter

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



Re: Why does Tomcat try to use the cache when compilation failed?

2010-02-18 Thread Peter Crowther
On 18 February 2010 14:14, Eric Bauman  wrote:
> For some reason, it appears Tomcat is trying to hit its compilation cache
> when compilation failed.
[Details elided]

Which version of Tomcat's this on, Eric?

- Peter

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



Re: sending request to tomcat failed.....

2010-02-18 Thread Peter Crowther
On 18 February 2010 13:55, Munirathinavel  wrote:
> I'm using apache2.2 + tomcat6.0.18 + mod_jk1.2.28 for my portal.While doing
> load test with 20 & more users i'm getting the following message in
> mod_jk.logand in browser also page is not getting loaded...
[...]
> [Thu Feb 18 18:35:07 2010][1528:2244] [info] jk_ajp_common.c (1788): Writing
> to client aborted or client network problems
> [Thu Feb 18 18:35:07 2010][1528:2244] [info] jk_ajp_common.c (2447):
> (worker1) sending request to tomcat failed (unrecoverable), because of
> client write error (attempt=1)
> [Thu Feb 18 18:35:07 2010]worker1 216.205.107.50 30.25
> [Thu Feb 18 18:35:07 2010][1528:2244] [info] mod_jk.c (2608): Aborting
> connection for worker=worker1
>
>
>  I'm suspecting this due to some improper configuration of
> workers.properties & virtual host settings.
> can you please help me to proceed further.

We probably could, but we are not telepaths.  We cannot analyse your
configuration given the information you have posted.  If you suspect
the error is somewhere in workers.properties and virtual host
settings, then why not post them plus your server.xml (with any
sensitive bits replaced)?

- Peter

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



  1   2   3   4   5   6   7   8   9   10   >