Re: Tomcat 6.0.24 - Should send body As Chunked Response but sometimes sends it back Un-Chunked

2010-11-26 Thread declan harrison
On Thu, Nov 25, 2010 at 6:48 PM, Pid p...@pidster.com wrote:
 On 25/11/2010 17:49, declan harrison wrote:
  So far you've shown me that you wrap the output stream, and how the
  write method works.
 
  You haven't actually posted the part of the code where you write your
  bit of the data to the wrapped output stream.
 
 
  p
 I just call wrapper.write(buf, 0, bug.lenght).  Are you looking more
 source code here?

 You are reporting a problem with the response.

 You are writing to the output stream, and maybe setting headers on the
 response object.

 If you can post each bit of code that interacts with the response object
 we can stop guessing what's wrong and start trying to resolve it.


 p

Apologises about not posting enough of the code, see below for the
methods that sets the respos headers etc

In the method writeResponseHdrs (shown below)  we end up reject the
request as bit rate too low and end up executing this code

Log.AdaptVideoError(Video bitrate 
[+inputBitRate+] is
not within range, Will not encode this video.);
throw new InitialisationException(Video bitrate
[+inputBitRate+] is not within range. Will not encode this video);

This exception is caught higher up the stack in doPost method which we
then set the status with the following

bufInStream = new 
AcceleratorInputStream(request.getInputStream(), 20480);
bufInStream.setHeaderRead();
bufOutStream = new 
AcceleratorOutputStream(response.getOutputStream(),20480);
try {
converter = createVideoAdapter(request, 
response,
bufInStream,bufOutStream,
request.getContentType(), true,
qualityPolicy);
} catch (Exception ex) {
// caught the exception ok, make sure we have 
commited the response

response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR );
   == status code set here and sent in do Post
return;
}


So this is the request that I terminate on the client end before the
respone is actually sent by Tomcat, Im not exactly sure were in Tomcat
the code is when I terminate client request. If I terminate at the
correct point then the next request that re-uses that thread is wrong.

/**
 * Write the initial response to the client.
 *
 * Must write headers before ressponse is committed.
 * @throws InitialisationException
 * @throws IOException
 *
 */
private void writeResponseHdrs() throws InitialisationException,
IOException {
//
// Lets iterate thru the hdrs in the response and
if (responseSet == false) {
setResponseHeaders();
// lets set flag to indicate that hdr have been set
responseSet  = true;
//inputStream.setHeaderRead();
outputStream.setHeaderWritten();

// set the status code as well
//
//
if (validateVideoBitate(inputBitRate) == false ) {
//Bitrate check failed - return duration to VR to 
facilitate JIT

if (writeResponseHdrs == true) {
streamDuration = mIContainer.getDuration();
response.setContentType( mimeType );

if (metaDuration  0.0d) {
response.addHeader(x-duration,
String.valueOf(metaDuration));
Log.AdaptVideo(Adding video duration 
header on
BR failure [x-duration: +
String.valueOf(metaDuration)+]
extracted from onMetaDataTag.);
} else {
// in microseconds
response.addHeader(x-duration,
String.valueOf(streamDuration/100));
Log.AdaptVideo(Adding video duration 
header on
BR failure [x-duration: +

String.valueOf(streamDuration/100)+] extracted from container
API.);
}

outputStream.setHeaderWritten();
}

Log.AdaptVideoError(Video bitrate 
[+inputBitRate+] is
not within range, Will not encode this video.);
throw new InitialisationException(Video bitrate
[+inputBitRate+] is not within range. Will not encode this video);
}
}
}

private void setResponseHeaders() throws InitialisationException {

Re: Tomcat 6 / Mysql / connection Pool isValid Method Error

2010-11-26 Thread Mark Thomas
On 26/11/2010 06:21, EmCpam wrote:
 
 Hi,
 
 I've a problem to use the 'isValid' method of Connection class with a
 connection pool.

snip/

 I'm using tomcat 6.0.29 with java jdk 1.6 and netbeans 6.9.

Connection.isValid() is a JDBC4 method and hence is only available in
Java 6.

Tomcat 6 has to work with Java 5 and therefore ships with a database
connection pooling implementation for Java 5 that implements JBDC 3, not
JDBC 4.

To use JDBC 4 methods, you'll need to do the following:
- Add commons-dbcp 1.4 to $CATALINA_HOME/lib
- Add commons-pool 1.5.5 to $CATALINA_HOME/lib
- Change your resource definition to include the following attribute:
  factory=org.apache.commons.dbcp.BasicDataSourceFactory

Mark

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



reload Tomcat applicaion via command line

2010-11-26 Thread terry . mcbride

Hi there

We are running Tomcat 6.0.29 on a Windows server.
We would like to write a batch file that would allow us to schedule
stopping and starting a web application.

I can see how to start and stop Tomcat itself this way, but this is not
what we want. We only want to start or stop a specific web app.

Any advice is greatly appreciated

Thanks so much






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



Re: reload Tomcat applicaion via command line

2010-11-26 Thread Pid
On 26/11/2010 11:38, terry.mcbr...@aero.bombardier.com wrote:
 
 Hi there
 
 We are running Tomcat 6.0.29 on a Windows server.
 We would like to write a batch file that would allow us to schedule
 stopping and starting a web application.
 
 I can see how to start and stop Tomcat itself this way, but this is not
 what we want. We only want to start or stop a specific web app.
 
 Any advice is greatly appreciated
 
 Thanks so much

You can use the supplied Ant tasks, find catalina-tasks.xml in the bin
directory.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Session replication with multicast

2010-11-26 Thread Guillaume HERAIL
Hi,

OS : Debian lenny
Tomcat : 7.0.2
JRE : 1.6.0_21

I have a problem trying to clusterize two tomcat on two different
boxes. I want to use the MemberShip's argument bind to tell to tomcat
wich interface to use but i get an exception :
http://paste.geeknode.org/22a07ecb (where bind=192.168.0.1 and
192.168.0.2 respectively).

Here is my Cluster block : http://paste.geeknode.org/4cf7af8f

If anyone has a clue...

Thanks,

-- 
Guillaume

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



Tomcat6 fails deploying on the cloud server

2010-11-26 Thread Albert Mascarell
Hi,
Info:
uname -a: Linux external 2.6.35.4-rscloud #8 SMP Mon Sep 20 15:54:33 UTC
2010 x86_64 GNU/Linux
Ubuntu 10.10
Tomcat 6.0.26
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)


I would like to ask for a situation. I have a WAR (Taverna Server 2) that I
want to deploy into Tomcat. I managed to have it deployed and running
properly into my laptop, however when trying into the cloud server I am
having a lot of problems. I have installed and run Tomcat as default
configurations, and it runs since I can see the tomcat welcome home. However
when I browse to the manager/html (i.e.
http://174.XXX.XXX.XXX:8081/manager/html) and try to deploy it exactly, it
fails : context fail.

Some logs lines:
INFO: about to look up resource called
ForkRunFactory.bb55e1ca-28a8-4e8b-a40c-56fa8fa09a48
Nov 26, 2010 1:39:00 PM org.taverna.server.master.localworker.ForkRunFactory
initFactory

INFO: ForkRunFactory.bb55e1ca-28a8-4e8b-a40c-56fa8fa09a48 subprocess output:
Exception in thread main java.rmi.ConnectException: Connection refused to
host: 174.143.170.163; nested exception is:
Nov 26, 2010 1:39:00 PM
org.taverna.server.master.localworker.ForkRunFactory$OutputLogger run
INFO: ForkRunFactory.bb55e1ca-28a8-4e8b-a40c-56fa8fa09a48 subprocess output:
java.net.ConnectException: Connection timed out

SEVERE: Context initialization failed

What do you think that can be happening?

Regards,

Albert Mascarell Creus
www.o2hlink.com


Tomcat website unreachable on the internet

2010-11-26 Thread Nathaniel Thalluri
Hi,
 I deployed a public website to Tomcat 7, Windows 2008 server with the
following server.xml.

 Service name=Catalina
Connector port=8443
protocol=org.apache.coyote.http11.Http11NioProtocol SSLEnabled=true
   maxThreads=200 scheme=https secure=true debug=0
 keystoreFile=keystore keystorePass=kspwd
   clientAuth=false sslProtocol=TLS address=ipaddress/

Engine name=Catalina defaultHost=portal.company.com

  Host name=portal.company.com debug=0 appBase=webapps

unpackWARs=true autoDeploy=true
Context path=/app docBase=app reloadable=true
crossContext=true/
Aliasportal.company.com/Alias
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs
   prefix=localhost_access_log. suffix=.txt
   pattern=%h %l %u %t %r %s %b resolveHosts=true/
  /Host

/Engine
  /Service

The website is however unreachable on the internet. When the url is
accessed, a page cannot be displayed error is shown.

The windows hosts file has the following entry:
ipaddress   portal.company.com

 Am I missing something?

Thanks.


Re: Tomcat website unreachable on the internet

2010-11-26 Thread André Warnier

Nathaniel Thalluri wrote:

Hi,
 I deployed a public website to Tomcat 7, Windows 2008 server with the
following server.xml.

 Service name=Catalina
Connector port=8443
protocol=org.apache.coyote.http11.Http11NioProtocol SSLEnabled=true
   maxThreads=200 scheme=https secure=true debug=0
 keystoreFile=keystore keystorePass=kspwd
   clientAuth=false sslProtocol=TLS address=ipaddress/

Engine name=Catalina defaultHost=portal.company.com

  Host name=portal.company.com debug=0 appBase=webapps

unpackWARs=true autoDeploy=true
Context path=/app docBase=app reloadable=true
crossContext=true/
Aliasportal.company.com/Alias
Valve className=org.apache.catalina.valves.AccessLogValve
directory=logs
   prefix=localhost_access_log. suffix=.txt
   pattern=%h %l %u %t %r %s %b resolveHosts=true/
  /Host

/Engine
  /Service

The website is however unreachable on the internet. When the url is
accessed, a page cannot be displayed error is shown.

The windows hosts file has the following entry:
ipaddress   portal.company.com

 Am I missing something?



Yes.
How are the computers/workstations on the Internet supposed to read your Windows hosts 
file, to know the IP address ?

For that matter, how is that Windows server connected to the Internet ?

Also (but this is much less important for now), this line :

 Aliasportal.company.com/Alias

is really not necessary, since your Host already has that name.

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



RE: Tomcat website unreachable on the internet

2010-11-26 Thread Caldarale, Charles R
 From: Nathaniel Thalluri [mailto:nathaniel.thall...@gmail.com] 
 Subject: Tomcat website unreachable on the internet

 Service name=Catalina

(configuration snipped)

You appear to be using some very old and inaccurate Tomcat reference.  Please 
throw it away and use the real Tomcat documentation.  For example, there hasn't 
been a debug attribute in Tomcat configuration elements for a long, long 
time.  Also, you should not be putting Context elements in server.xml, but 
rather in the webapp's META-INF/context.xml file.  Next, having an Alias with 
the same value as the Host name is clearly unnecessary.

 The website is however unreachable on the internet.

Why do you think it should be?

 The windows hosts file has the following entry:
 ipaddress   portal.company.com

Which has nothing to do with exposing the name portal.company.com to the 
Internet.  Have you registered portal.company.com with a DNS service?  

 - Chuck


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


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



Re: Tomcat website unreachable on the internet

2010-11-26 Thread Nathaniel Thalluri
Andre,

*How are the computers/workstations on the Internet supposed to read your
Windows hosts file, to know the IP address ?
For that matter, how is that Windows server connected to the Internet ?*


This is something I will have to ask my network admin.
You also mention that the Alias tag is superfluous. My intention in adding
it was to get to the site by typing https://portal.plugpower.com not
https://portal.plugpower.com:8443/SRA/. But this is not the case, using the
Alias URL on the server machine gives me a 'page under construction' page.

Thanks.


Re: Tomcat website unreachable on the internet

2010-11-26 Thread Electronjockey
unfortunately you cannot use the alias directive to avoid specifying the 
port in the url. Is there a reason you are using IIS on that machine also?


-Original Message-
From: Nathaniel Thalluri nathaniel.thall...@gmail.com
To : Tomcat Users List users@tomcat.apache.org
Sent: Fri Nov 26 14:55:47 2010
Subject: Re: Tomcat website unreachable on the internet

Andre,

*How are the computers/workstations on the Internet supposed to read your
Windows hosts file, to know the IP address ?
For that matter, how is that Windows server connected to the Internet ?*


This is something I will have to ask my network admin.
You also mention that the Alias tag is superfluous. My intention in adding
it was to get to the site by typing https://portal.plugpower.com not
https://portal.plugpower.com:8443/SRA/. But this is not the case, using the
Alias URL on the server machine gives me a 'page under construction' page.

Thanks.


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



Re: Tomcat website unreachable on the internet

2010-11-26 Thread Hassan Schroeder
On Fri, Nov 26, 2010 at 11:55 AM, Nathaniel Thalluri
nathaniel.thall...@gmail.com wrote:

 You also mention that the Alias tag is superfluous. My intention in adding
 it was to get to the site by typing https://portal.plugpower.com not
 https://portal.plugpower.com:8443/SRA/. But this is not the case, using the
 Alias URL on the server machine gives me a 'page under construction' page.

under construction? If that's the real URL, I'd say you have other,
more immediate problems:

ripple:~$ host portal.plugpower.com
portal.plugpower.com has address 66.195.66.56
ripple:~$ ping portal.plugpower.com
PING portal.plugpower.com (66.195.66.56): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
Request timeout for icmp_seq 4
Request timeout for icmp_seq 5
^C
--- portal.plugpower.com ping statistics ---
7 packets transmitted, 0 packets received, 100.0% packet loss
ripple:~$

HTH,
-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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



Re: Tomcat website unreachable on the internet

2010-11-26 Thread Electronjockey
You might try configuring tomcat to use port 443 and register your 
server cert with tomcat instead of IIS and then disabling IIS. that 
should get you what you are looking for




-Original Message-
From: Nathaniel Thalluri nathaniel.thall...@gmail.com
To : Tomcat Users List users@tomcat.apache.org
Sent: Fri Nov 26 14:55:47 2010
Subject: Re: Tomcat website unreachable on the internet

Andre,

*How are the computers/workstations on the Internet supposed to read your
Windows hosts file, to know the IP address ?
For that matter, how is that Windows server connected to the Internet ?*


This is something I will have to ask my network admin.
You also mention that the Alias tag is superfluous. My intention in adding
it was to get to the site by typing https://portal.plugpower.com not
https://portal.plugpower.com:8443/SRA/. But this is not the case, using the
Alias URL on the server machine gives me a 'page under construction' page.

Thanks.


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



[OT] Possible ThreadLocal memory leak in Apache Cocoon 2.1.11

2010-11-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

All,

I've just started using versions of Tomcat 6 that have the memory leak
prevention listener available and enabled in development, and I just saw
this message in catalina.out when I shut down my Cocoon webapp:

SEVERE: The web application [/cocoon] created a ThreadLocal with key of
type [java.lang.ThreadLocal] (value [java.lang.threadlo...@d2efa1]) and
a value of type [org.apache.xerces.parsers.SAXParser] (value
[org.apache.xerces.parsers.saxpar...@15d4273]) but failed to remove it
when the web application was stopped. This is very likely to create a
memory leak.

So, it looks like Cocoon is sticking SAXParser objects into ThreadLocals
and not cleaning them up.

I'm going to be talking to the Cocoon folks about this to see if they
can look into fixing it, but I figured that the Tomcat community in
general would like to know that Cocoon is a component that is likely to
cause PermGen exhaustion when redeployments are common.

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

iEYEARECAAYFAkzwKGIACgkQ9CaO5/Lv0PB+AwCgnX0+dPXsQyNvj5oPwV6UZ8XX
Bc0AoLVkym6/B8YATpmpr7CXWpYxRlj6
=I9y+
-END PGP SIGNATURE-

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



Re: Tomcat6 fails deploying on the cloud server

2010-11-26 Thread Pid
On 26/11/2010 14:08, Albert Mascarell wrote:
 INFO: ForkRunFactory.bb55e1ca-28a8-4e8b-a40c-56fa8fa09a48 subprocess output:
 Exception in thread main java.rmi.ConnectException: Connection refused to
 host: 174.143.170.163; nested exception is:
 Nov 26, 2010 1:39:00 PM
 org.taverna.server.master.localworker.ForkRunFactory$OutputLogger run
 INFO: ForkRunFactory.bb55e1ca-28a8-4e8b-a40c-56fa8fa09a48 subprocess output:
 java.net.ConnectException: Connection timed out
 
 SEVERE: Context initialization failed
 
 What do you think that can be happening?


The application appears to be trying to connect to an IP address:
174.143.170.163 and is failing.


p


0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: [OT] Possible ThreadLocal memory leak in Apache Cocoon 2.1.11

2010-11-26 Thread Pid
On 26/11/2010 21:36, Christopher Schultz wrote:
 All,
 
 I've just started using versions of Tomcat 6 that have the memory leak
 prevention listener available and enabled in development, and I just saw
 this message in catalina.out when I shut down my Cocoon webapp:
 
 SEVERE: The web application [/cocoon] created a ThreadLocal with key of
 type [java.lang.ThreadLocal] (value [java.lang.threadlo...@d2efa1]) and
 a value of type [org.apache.xerces.parsers.SAXParser] (value
 [org.apache.xerces.parsers.saxpar...@15d4273]) but failed to remove it
 when the web application was stopped. This is very likely to create a
 memory leak.

Which version of Xerces is it?  I've been looking at that lib for a
similar issue this week.


p




0x62590808.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature


Re: Tomcat website unreachable on the internet

2010-11-26 Thread Nathaniel Thalluri
The IIS was setup to manage other previously existent websites on the
machine. I will have to get rid of it. BTW, the cert is registered with
Tomcat. I followed the instructions on Tomcat's website to setup SSL.

When you say 'page under construction' page points to a bigger problem, are
you saying the issue is with Tomcat, IIS or OS?


Re: Tomcat website unreachable on the internet

2010-11-26 Thread Hassan Schroeder
On Fri, Nov 26, 2010 at 1:58 PM, Nathaniel Thalluri
nathaniel.thall...@gmail.com wrote:

 When you say 'page under construction' page points to a bigger problem, are
 you saying the issue is with Tomcat, IIS or OS?

I'm saying that the system in question just plain ain't reachable, at
least from where I am. And that's a network issue that has nothing
to do with any of the above.

So I can't imagine where you're getting an under construction page
from, unless the system is actually on an intranet (while still having an
exposed public IP in DNS).

-- 
Hassan Schroeder  hassan.schroe...@gmail.com
twitter: @hassan

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