Re: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-30 Thread Pid
On 30/06/2011 02:10, Bob DeRemer wrote:
> Chris,
> 
> Thanks for the feedback.  I haven't come across squid yet, so I will take a 
> look.  With regard to HTTP proxying, no, I don't want to do HTTP proxying.  I 
> would like to insert a TCP-based NIO request router in place of Tomcat's 
> Connector.  Specifically, I would like to do something similar to the Netty 
> Port Unification sample, but with HTTP AND XMPP protocols.  Netty has the 
> ability to inspect the incoming request and then get outta the way - adding 
> the appropriate Channel for processing the request.  
> 
> The problem I'm facing is that we're using Tomcat as our App Server and we 
> can't easily replace that with a non-servlet based solution at this point.   
> As a result, I was trying to determine if there is a way to create some type 
> of Tomcat extension that where I could do the initial request routing and 
> pass HTTP request on to the Tomcat's plumbing without running the built-in 
> HTTP connector(s).

You'd have to write your own connector implementation, or hack an
existing one - in Tomcat 7.0 there's some work being done to consolidate
the connector code, so you'd be wise to start there.

Is XMPP over HTTP a possibility, and if so could the applicable code run
inside a Servlet?


Sounds like a 'square peg, round hole' type situation...


p



> Thanks,
> Bob
> 
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
> Sent: Wednesday, June 29, 2011 2:51 PM
> To: Tomcat Users List
> Subject: Re: HOW TO: create custom Tomcat 6 connector to do port sharing
> 
> Bob,
> 
> On 6/29/2011 1:10 PM, Bob DeRemer wrote:
>> I've scoured the net for information on how to do port sharing within 
>> the context of a Tomcat Servlet-based web application process.
>> While there's some discussion, there still doesn't appear to be any 
>> solutions [YET] - that I could find yet.
> 
>> What I need to do is the following:
> 
>> * receive both HTTP and XMPP traffic on a single port [either 80 or
>>   443 - depending on security configuration]
> 
>> * route the HTTP traffic to Tomcat's HTTP Connector [or
>>   sub-processing component] if possible
> 
>> * route the XMPP to an embedded Vysper server
> 
> All of the above should be doable using something like Squid. Does Squid do 
> pretty much everything?
> 
>> * ALL running in the context of a single Tomcat Server process
> 
> Oh.
> 
> You want Tomcat to do HTTP proxying? AFAIK, nobody has done that. Most people 
> who want HTTP proxying just use some other web server out in front of Tomcat 
> (like Apache httpd, Squid, Nginx, lighttpd, HTTP lb, etc.). I have to imagine 
> that at least one of those products can do content-detection to determine 
> where to route messages.
> 
> Does it /have to/ be Tomcat-based?
> 
>> This will enable us to leverage the power/investment in our servlet 
>> infrastructure and Vysper XMPP all together without having to open 
>> multiple ports.
> 
>> If this is possible in either Tomcat 6 or Tomcat 7, please let me know 
>> how I should go about this:
> 
>> * doing some custom extension in Tomcat (i.e. custom Tomcat
>>   connector that uses Netty for example)
> 
>> * or, some other approach ???
> 
> If you want to brute-force it, you could write a servlet Filter (or, better 
> yet, a Tomcat-specific Valve that runs before the request is mapped to a 
> webapp) to intercept the messages and proxy them over to your other 
> service(s). You'll have to do the HTTP proxying yourself, though.
> 
>> please advise on how you would recommend achieving our goal.
> 
> Honestly, I'd look for a non-Tomcat-centric solution because it's probably 
> already been built elsewhere.
> 
> -chris

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





signature.asc
Description: OpenPGP digital signature


RE: fail to download large static files in tomcat

2011-06-30 Thread Michal Singer
Hi, I also want to add that when I check the tomcat access log, I get:
10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET 
/bundles/vacc-AOS701b318-fl.tgz HTTP/1.0" 200 -
On the large file, the client receives error.
How can this be? Is this a problem with the client? Though I tried other 
clients and it didn't work as well. And also ftp works fine.

Thanks, Michal


-Original Message-
From: Michal Singer 
Sent: ה 30 יוני 2011 09:39
To: Tomcat Users List
Subject: RE: fail to download large static files in tomcat

Hi, 

I tried defining the useSendFile - it did not help in transferring a 500MB 
file. Any other ideas what can get wrong, which configuration I need for the 
big file to be loaded successfully?

Thanks, Michal

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: ג 28 יוני 2011 15:51
To: Tomcat Users List
Subject: RE: fail to download large static files in tomcat

> From: Michal Singer [mailto:michal.sin...@expand.com] 
> Subject: RE: fail to download large static files in tomcat

> From the tomcat documentation I read this useSendFile is default 
> to true and it is defined under nio.

This is correct; NIO does support sendfile, as does APR.

> As I mentioned before, I am defining the static context 
> under Engine->Host->Context:

Which is not recommended, since you're modifying server.xml for a specific 
webapp.  Better to place the  element in 
conf/Catalina/[host]/bundles.xml, with just a docBase attribute.  I'd recommend 
using an absolute path for docBase, since a relative one is dependent on how 
you start Tomcat.

> This does not correspond to a specific connector

Requests received over a  with useSendfile set will be processed 
with sendfile, those received on a  without sendfile capability 
won't use it.  If you use the NIO class for all of your HTTP or HTTPS 
 elements, you'll get sendfile by default.

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



Re: fail to download large static files in tomcat

2011-06-30 Thread Konstantin Kolinko
> Hi, I am working with apache-tomcat-6.0.18 and I want to use it to download 
> static files.
> I have clients which will contact tomcat using wget.

1) Try with an up-to-date version of Tomcat. It will be 3 years old in
a month. There were a lot of fixes since then.

E.g. 48843.

It might be that you are facing some timeout. There are better changes
with more recent versions.

2) What exactly connector implementation do you use?
Bio(Jio)/ Nio / Apr?

It should be visible in the logs when Tomcat starts.

> 10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET 
> /bundles/vacc-AOS701b318-fl.tgz HTTP/1.0" 200 -

3) It should not matter much, but most clients will use HTTP/1.1

(The last one that I encountered was old IE 6 with "Use HTTP/1.0
through proxy" flag).

4) There might be proxies between you and client that will close the connection.


2011/6/30 Michal Singer :
> Hi, I also want to add that when I check the tomcat access log, I get:
> 10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET 
> /bundles/vacc-AOS701b318-fl.tgz HTTP/1.0" 200 -
> On the large file, the client receives error.
> How can this be? Is this a problem with the client? Though I tried other 
> clients and it didn't work as well. And also ftp works fine.
>
> Thanks, Michal
>
>
> -Original Message-
> From: Michal Singer
> Sent: ה 30 יוני 2011 09:39
> To: Tomcat Users List
> Subject: RE: fail to download large static files in tomcat
>
> Hi,
>
> I tried defining the useSendFile - it did not help in transferring a 500MB 
> file. Any other ideas what can get wrong, which configuration I need for the 
> big file to be loaded successfully?
>
> Thanks, Michal
>
> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: ג 28 יוני 2011 15:51
> To: Tomcat Users List
> Subject: RE: fail to download large static files in tomcat
>
>> From: Michal Singer [mailto:michal.sin...@expand.com]
>> Subject: RE: fail to download large static files in tomcat
>
>> From the tomcat documentation I read this useSendFile is default
>> to true and it is defined under nio.
>
> This is correct; NIO does support sendfile, as does APR.
>
>> As I mentioned before, I am defining the static context
>> under Engine->Host->Context:
>
> Which is not recommended, since you're modifying server.xml for a specific 
> webapp.  Better to place the  element in 
> conf/Catalina/[host]/bundles.xml, with just a docBase attribute.  I'd 
> recommend using an absolute path for docBase, since a relative one is 
> dependent on how you start Tomcat.
>
>> This does not correspond to a specific connector
>
> Requests received over a  with useSendfile set will be processed 
> with sendfile, those received on a  without sendfile capability 
> won't use it.  If you use the NIO class for all of your HTTP or HTTPS 
>  elements, you'll get sendfile by default.
>
>  - 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: fail to download large static files in tomcat

2011-06-30 Thread Michal Singer
I didn't want to upgrade the tomcat yet, since I had some problems with the ssl 
certificate after upgrade, so it might take a while until I succeed. Do you 
mean to upgrade to 7 or to more advanced builds of 6? Which do you recommend?


I am using nio connector.
Actually this was a very good question. I changed the connector to HTTP/1.1 and 
now the download works !!!
Thank you very much.
I don't understand why the nio does not work.


-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: ה 30 יוני 2011 12:42
To: Tomcat Users List
Subject: Re: fail to download large static files in tomcat

> Hi, I am working with apache-tomcat-6.0.18 and I want to use it to download 
> static files.
> I have clients which will contact tomcat using wget.

1) Try with an up-to-date version of Tomcat. It will be 3 years old in
a month. There were a lot of fixes since then.

E.g. 48843.

It might be that you are facing some timeout. There are better changes
with more recent versions.

2) What exactly connector implementation do you use?
Bio(Jio)/ Nio / Apr?

It should be visible in the logs when Tomcat starts.

> 10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET 
> /bundles/vacc-AOS701b318-fl.tgz HTTP/1.0" 200 -

3) It should not matter much, but most clients will use HTTP/1.1

(The last one that I encountered was old IE 6 with "Use HTTP/1.0
through proxy" flag).

4) There might be proxies between you and client that will close the connection.


2011/6/30 Michal Singer :
> Hi, I also want to add that when I check the tomcat access log, I get:
> 10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET 
> /bundles/vacc-AOS701b318-fl.tgz HTTP/1.0" 200 -
> On the large file, the client receives error.
> How can this be? Is this a problem with the client? Though I tried other 
> clients and it didn't work as well. And also ftp works fine.
>
> Thanks, Michal
>
>
> -Original Message-
> From: Michal Singer
> Sent: ה 30 יוני 2011 09:39
> To: Tomcat Users List
> Subject: RE: fail to download large static files in tomcat
>
> Hi,
>
> I tried defining the useSendFile - it did not help in transferring a 500MB 
> file. Any other ideas what can get wrong, which configuration I need for the 
> big file to be loaded successfully?
>
> Thanks, Michal
>
> -Original Message-
> From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com]
> Sent: ג 28 יוני 2011 15:51
> To: Tomcat Users List
> Subject: RE: fail to download large static files in tomcat
>
>> From: Michal Singer [mailto:michal.sin...@expand.com]
>> Subject: RE: fail to download large static files in tomcat
>
>> From the tomcat documentation I read this useSendFile is default
>> to true and it is defined under nio.
>
> This is correct; NIO does support sendfile, as does APR.
>
>> As I mentioned before, I am defining the static context
>> under Engine->Host->Context:
>
> Which is not recommended, since you're modifying server.xml for a specific 
> webapp.  Better to place the  element in 
> conf/Catalina/[host]/bundles.xml, with just a docBase attribute.  I'd 
> recommend using an absolute path for docBase, since a relative one is 
> dependent on how you start Tomcat.
>
>> This does not correspond to a specific connector
>
> Requests received over a  with useSendfile set will be processed 
> with sendfile, those received on a  without sendfile capability 
> won't use it.  If you use the NIO class for all of your HTTP or HTTPS 
>  elements, you'll get sendfile by default.
>
>  - 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: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-30 Thread André Warnier

Hi.

To round up what I am trying to say :

Tomcat is a java servlet engine.  In the principle, there is nothing that says that it 
cannot handle protocols other than HTTP/HTTPS, and run servlets which handle other kinds 
of messages than HTTP/HTTPS messages.

However, my general impression is that
1) this is not being done very often
2) therefore, even apart from the Connectors, there may be quite a few aspects in Tomcat 
which are HTTP(S)-centric, and which have not really been investigated a lot with 
non-HTTP(S) messages.
For example, there was a discussion recently on this list, concerning "HTTP 100 Continue" 
 status codes, and if I remember correctly this implied that a Listener should be 
configured at the level of the Connector, and it also implied that this would trigger the 
immediate parsing of request headers as soon as a request came in.
Now I can quite easily imagine that this could be much more complicated if some requests 
which come in, are non-HTTP(S).


In summary, I have the feeling that creating a "discriminating Connector" which would 
dispatch HTTP(S)/XMPP requests as appropriate, could just be the tip of the iceberg, and 
that you could find yourself sucked into making many more changes than what you imagine at 
first.


Now take this with a grain of salt, since I am neither a java nor a Tomcat expert.  I just 
happen to remember the classic line which says that "90% of a software project is done in 
90% of the time; the remaining 10% also."




Bob DeRemer wrote:

Hi Andre,

Yes, XMPP typically uses port 5222, but is capable of using 80/443 as well.  If we're able to share a port, it solves various IT administration issues when deployed in corporate environments.  In addition, it will enable us to have a single server process and ultimately a simpler overall architecture because we won't have to configure/manage 2 separate server applications.  


I'm still not sure this is feasible or the best way to go, but it's worth the 
investigation.  Given a lot of work I've done on the Microsoft side of things, 
their WCF infrastructure provides a TCP port sharing service, which is somewhat 
similar in nature to what we're looking to do.  At the end of the day - both 
HTTP and XMPP are TCP-based.  So, if I can front a single port for the incoming 
TCP request and then route it to the appropriate protocol-specific endpoint, 
there would be some significant benefits to us architecturally because we are 
not forced to break the functionality into 2 separate applications - unless we 
wanted to.

That said, if I can find a solution, we'll have to validate the performance and 
stability - no doubt.

Thanks,
Bob

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Wednesday, June 29, 2011 3:30 PM

To: Tomcat Users List
Subject: Re: HOW TO: create custom Tomcat 6 connector to do port sharing

Pid wrote:

On 29/06/2011 19:51, Christopher Schultz wrote:
Honestly, I'd look for a non-Tomcat-centric solution because it's 
probably already been built elsewhere.


-chris

Why is opening another port a problem?



+1

I do not know XMPP, but from the original OP description it sounds like a 
protocol which uses its own transport protocol, and normally some other 
standard port than 80/443. (*)

Without even going into what kind of issues you may encounter at the Tomcat 
level when trying to process requests/responses which are not HTTP/HTTPS, I 
would also think that if you mix 2 different protocols on the same port, you 
will be forcing whatever equipment/software which separates and dispatches 
them, to look *inside* each TCP packet to determine which protocol this one is 
about.  That in itself will introduce quite a bit of overhead.

Then again, if the connection is (sometimes) over SSL, that would also probably 
mean that the packets have to be decrypted, even before their HTTP/XMPP nature 
can be discriminated.

Looking at XMPP in Wikipedia, it looks like there is something called "XMPP over 
HTTP transport".  Is that what the OP has in mind ?




-
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: fail to download large static files in tomcat

2011-06-30 Thread André Warnier

Michal Singer wrote:
...

I am using nio connector.
Actually this was a very good question. I changed the connector to HTTP/1.1 and 
now the download works !!!


Can you exlain *exactly* what you changed, where ?
e.g. what the  element looked like before, and what it looks like 
now ?



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



RE: fail to download large static files in tomcat

2011-06-30 Thread Michal Singer
This was the configuration I had in the server.xml which did not work for large 
files:



And I changed this to:


And now it does work for 500MB files, though when comparing the time it takes 
(for smaller files which work on both configurations),
the performance degraded with the HTTP/1.1 connector. So of course, I prefer it 
to work on nio.




-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: ה 30 יוני 2011 13:30
To: Tomcat Users List
Subject: Re: fail to download large static files in tomcat

Michal Singer wrote:
...
> I am using nio connector.
> Actually this was a very good question. I changed the connector to HTTP/1.1 
> and now the download works !!!

Can you exlain *exactly* what you changed, where ?
e.g. what the  element looked like before, and what it looks like 
now ?



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



Re: fail to download large static files in tomcat

2011-06-30 Thread Konstantin Kolinko
2011/6/30 Michal Singer :
> I didn't want to upgrade the tomcat yet, since I had some problems with the 
> ssl certificate after upgrade,

Most problems with ssl are when Tomcat (auto-)switches between Apr and
non-Apr implementation (see below),  because Apr and non-Apr SSL
implementations have different configuration.

> so it might take a while until I succeed. Do you mean to upgrade to 7 or to 
> more advanced builds of 6? Which do you recommend?

To 6.0.32.

> I am using nio connector.
> Actually this was a very good question. I changed the connector to HTTP/1.1 
> and now the download works !!!

> This was the configuration I had in the server.xml which did not work for 
> large files:
>
>  protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="false" 
> scheme="http" secure="false" redirectPort="8080" connectionTimeout="2000" 
> enableLookups="false" disableUploadTimeout="true" allowTrace="false" 
> maxKeepAliveRequests="1" processorCache="800" acceptorThreadCount="1" />
>
> And I changed this to:
>  SSLEnabled="false" scheme="http" secure="false" redirectPort="8080" 
> connectionTimeout="2000" enableLookups="false" disableUploadTimeout="true" 
> allowTrace="false" maxKeepAliveRequests="1" processorCache="800" 
> acceptorThreadCount="1" />

Your change to protocol="HTTP/1.1" means that it will auto-select HTTP
connector implementation.

That means it will choose Bio(Jio) when tcnative (dll/so) is absent
and Apr when tcnative (dll/so) library is present.  What connector
implementation is used can be seen in the logs when Tomcat starts.


> Thank you very much.
> I don't understand why the nio does not work.

Nio was considered experimental three years ago. There was a number of
fixes since then.

Best regards,
Konstantin Kolinko

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



Re: fail to download large static files in tomcat

2011-06-30 Thread André Warnier

Ok, so now can you remind us of
- on what platform you are (Windows, Linux,..)
- what version of Tomcat this is
- and paste the first few lines of the Tomcat startup messages, from the logfile
(to find out whether you are using APR or not)

Sorry if you already said all that, I'm too lazy to scroll back through the 
messages.


Michal Singer wrote:

This was the configuration I had in the server.xml which did not work for large 
files:



And I changed this to:


And now it does work for 500MB files, though when comparing the time it takes 
(for smaller files which work on both configurations),
the performance degraded with the HTTP/1.1 connector. So of course, I prefer it 
to work on nio.




-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: ה 30 יוני 2011 13:30

To: Tomcat Users List
Subject: Re: fail to download large static files in tomcat

Michal Singer wrote:
...

I am using nio connector.
Actually this was a very good question. I changed the connector to HTTP/1.1 and 
now the download works !!!


Can you exlain *exactly* what you changed, where ?
e.g. what the  element looked like before, and what it looks like 
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: fail to download large static files in tomcat

2011-06-30 Thread Michal Singer
1. Currently tomcat runs on windows XP (but production can be on other windows 
as well).
The client is on linux.

2. Tomcat version 6.0.18

3. These are the lines in log regarding connector. The lines concerning the 
connectors I am referring to are moved aside to the right (ports 8088 and 8089)


Jun 30, 2011 2:11:31 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-443
Jun 30, 2011 2:11:31 PM org.apache.tomcat.util.net.NioSelectorPool 
getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 30, 2011 2:11:31 PM org.apache.coyote.http11.Http11NioProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jun 30, 2011 2:11:31 PM org.apache.coyote.http11.Http11Protocol init

INFO: Initializing Coyote HTTP/1.1 on http-8088

Jun 30, 2011 2:11:31 PM 
org.apache.tomcat.util.net.NioSelectorPool  

getSharedSelector

INFO: Using a shared selector for servlet write/read

Jun 30, 2011 2:11:31 PM 
org.apache.coyote.http11.Http11NioProtocol init

INFO: Initializing Coyote HTTP/1.1 on http-8089

Jun 30, 2011 2:11:31 PM 
org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8443
Jun 30, 2011 2:11:31 PM org.apache.tomcat.util.net.NioSelectorPool 
getSharedSelector
INFO: Using a shared selector for servlet write/read
Jun 30, 2011 2:11:31 PM org.apache.coyote.http11.Http11NioProtocol init
INFO: Initializing Coyote HTTP/1.1 on http-9080
Jun 30, 2011 2:11:31 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-9443
Jun 30, 2011 2:11:31 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 34490 ms
Jun 30, 2011 2:11:32 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Set JAAS app name Catalina
Jun 30, 2011 2:11:32 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jun 30, 2011 2:11:32 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.18


-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: ה 30 יוני 2011 14:06
To: Tomcat Users List
Subject: Re: fail to download large static files in tomcat

Ok, so now can you remind us of
- on what platform you are (Windows, Linux,..)
- what version of Tomcat this is
- and paste the first few lines of the Tomcat startup messages, from the logfile
(to find out whether you are using APR or not)

Sorry if you already said all that, I'm too lazy to scroll back through the 
messages.


Michal Singer wrote:
> This was the configuration I had in the server.xml which did not work for 
> large files:
> 
>  protocol="org.apache.coyote.http11.Http11NioProtocol" SSLEnabled="false" 
> scheme="http" secure="false" redirectPort="8080" connectionTimeout="2000" 
> enableLookups="false" disableUploadTimeout="true" allowTrace="false" 
> maxKeepAliveRequests="1" processorCache="800" acceptorThreadCount="1" />
> 
> And I changed this to:
>  SSLEnabled="false" scheme="http" secure="false" redirectPort="8080" 
> connectionTimeout="2000" enableLookups="false" disableUploadTimeout="true" 
> allowTrace="false" maxKeepAliveRequests="1" processorCache="800" 
> acceptorThreadCount="1" />
> 
> And now it does work for 500MB files, though when comparing the time it takes 
> (for smaller files which work on both configurations),
> the performance degraded with the HTTP/1.1 connector. So of course, I prefer 
> it to work on nio.
> 
> 
> 
> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com] 
> Sent: ה 30 יוני 2011 13:30
> To: Tomcat Users List
> Subject: Re: fail to download large static files in tomcat
> 
> Michal Singer wrote:
> ...
>> I am using nio connector.
>> Actually this was a very good question. I changed the connector to HTTP/1.1 
>> and now the download works !!!
> 
> Can you exlain *exactly* what you changed, where ?
> e.g. what the  element looked like before, and what it looks like 
> 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-u

RE: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-30 Thread Bob DeRemer
I'm not sure on the XMPP over HTTP, since we require the real-time always-on 
connectivity provided by XMPP.  I'll have to see exactly what XMPP over HTTP 
does under the hood.  We can't afford to have our XMPP connections doing 
long-polling or anything.

-bob

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, June 30, 2011 3:45 AM
To: Tomcat Users List
Subject: Re: HOW TO: create custom Tomcat 6 connector to do port sharing

On 30/06/2011 02:10, Bob DeRemer wrote:
> Chris,
> 
> Thanks for the feedback.  I haven't come across squid yet, so I will take a 
> look.  With regard to HTTP proxying, no, I don't want to do HTTP proxying.  I 
> would like to insert a TCP-based NIO request router in place of Tomcat's 
> Connector.  Specifically, I would like to do something similar to the Netty 
> Port Unification sample, but with HTTP AND XMPP protocols.  Netty has the 
> ability to inspect the incoming request and then get outta the way - adding 
> the appropriate Channel for processing the request.  
> 
> The problem I'm facing is that we're using Tomcat as our App Server and we 
> can't easily replace that with a non-servlet based solution at this point.   
> As a result, I was trying to determine if there is a way to create some type 
> of Tomcat extension that where I could do the initial request routing and 
> pass HTTP request on to the Tomcat's plumbing without running the built-in 
> HTTP connector(s).

You'd have to write your own connector implementation, or hack an existing one 
- in Tomcat 7.0 there's some work being done to consolidate the connector code, 
so you'd be wise to start there.

Is XMPP over HTTP a possibility, and if so could the applicable code run inside 
a Servlet?


Sounds like a 'square peg, round hole' type situation...


p



> Thanks,
> Bob
> 
> -Original Message-
> From: Christopher Schultz [mailto:ch...@christopherschultz.net]
> Sent: Wednesday, June 29, 2011 2:51 PM
> To: Tomcat Users List
> Subject: Re: HOW TO: create custom Tomcat 6 connector to do port 
> sharing
> 
> Bob,
> 
> On 6/29/2011 1:10 PM, Bob DeRemer wrote:
>> I've scoured the net for information on how to do port sharing within 
>> the context of a Tomcat Servlet-based web application process.
>> While there's some discussion, there still doesn't appear to be any 
>> solutions [YET] - that I could find yet.
> 
>> What I need to do is the following:
> 
>> * receive both HTTP and XMPP traffic on a single port [either 80 or
>>   443 - depending on security configuration]
> 
>> * route the HTTP traffic to Tomcat's HTTP Connector [or
>>   sub-processing component] if possible
> 
>> * route the XMPP to an embedded Vysper server
> 
> All of the above should be doable using something like Squid. Does Squid do 
> pretty much everything?
> 
>> * ALL running in the context of a single Tomcat Server process
> 
> Oh.
> 
> You want Tomcat to do HTTP proxying? AFAIK, nobody has done that. Most people 
> who want HTTP proxying just use some other web server out in front of Tomcat 
> (like Apache httpd, Squid, Nginx, lighttpd, HTTP lb, etc.). I have to imagine 
> that at least one of those products can do content-detection to determine 
> where to route messages.
> 
> Does it /have to/ be Tomcat-based?
> 
>> This will enable us to leverage the power/investment in our servlet 
>> infrastructure and Vysper XMPP all together without having to open 
>> multiple ports.
> 
>> If this is possible in either Tomcat 6 or Tomcat 7, please let me 
>> know how I should go about this:
> 
>> * doing some custom extension in Tomcat (i.e. custom Tomcat
>>   connector that uses Netty for example)
> 
>> * or, some other approach ???
> 
> If you want to brute-force it, you could write a servlet Filter (or, better 
> yet, a Tomcat-specific Valve that runs before the request is mapped to a 
> webapp) to intercept the messages and proxy them over to your other 
> service(s). You'll have to do the HTTP proxying yourself, though.
> 
>> please advise on how you would recommend achieving our goal.
> 
> Honestly, I'd look for a non-Tomcat-centric solution because it's probably 
> already been built elsewhere.
> 
> -chris

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





RE: HOW TO: create custom Tomcat 6 connector to do port sharing

2011-06-30 Thread Bob DeRemer
Very well stated and completely understood.  My gut is already telling me that 
trying to customize/extend Tomcat in this way is way outside the scope of how 
Tomcat was designed or intended to be used.  And, I would bet you're right with 
regard to parts of the Tomcat architecture having certain "HTTP expectations".

Thanks again for your risk assessment - this will help in making our decision 
on how to move forward.

-bob 

-Original Message-
From: André Warnier [mailto:a...@ice-sa.com] 
Sent: Thursday, June 30, 2011 6:27 AM
To: Tomcat Users List
Subject: Re: HOW TO: create custom Tomcat 6 connector to do port sharing

Hi.

To round up what I am trying to say :

Tomcat is a java servlet engine.  In the principle, there is nothing that says 
that it cannot handle protocols other than HTTP/HTTPS, and run servlets which 
handle other kinds of messages than HTTP/HTTPS messages.
However, my general impression is that
1) this is not being done very often
2) therefore, even apart from the Connectors, there may be quite a few aspects 
in Tomcat which are HTTP(S)-centric, and which have not really been 
investigated a lot with
non-HTTP(S) messages.
For example, there was a discussion recently on this list, concerning "HTTP 100 
Continue" 
  status codes, and if I remember correctly this implied that a Listener should 
be configured at the level of the Connector, and it also implied that this 
would trigger the immediate parsing of request headers as soon as a request 
came in.
Now I can quite easily imagine that this could be much more complicated if some 
requests which come in, are non-HTTP(S).

In summary, I have the feeling that creating a "discriminating Connector" which 
would dispatch HTTP(S)/XMPP requests as appropriate, could just be the tip of 
the iceberg, and that you could find yourself sucked into making many more 
changes than what you imagine at first.

Now take this with a grain of salt, since I am neither a java nor a Tomcat 
expert.  I just happen to remember the classic line which says that "90% of a 
software project is done in 90% of the time; the remaining 10% also."



Bob DeRemer wrote:
> Hi Andre,
> 
> Yes, XMPP typically uses port 5222, but is capable of using 80/443 as well.  
> If we're able to share a port, it solves various IT administration issues 
> when deployed in corporate environments.  In addition, it will enable us to 
> have a single server process and ultimately a simpler overall architecture 
> because we won't have to configure/manage 2 separate server applications.  
> 
> I'm still not sure this is feasible or the best way to go, but it's worth the 
> investigation.  Given a lot of work I've done on the Microsoft side of 
> things, their WCF infrastructure provides a TCP port sharing service, which 
> is somewhat similar in nature to what we're looking to do.  At the end of the 
> day - both HTTP and XMPP are TCP-based.  So, if I can front a single port for 
> the incoming TCP request and then route it to the appropriate 
> protocol-specific endpoint, there would be some significant benefits to us 
> architecturally because we are not forced to break the functionality into 2 
> separate applications - unless we wanted to.
> 
> That said, if I can find a solution, we'll have to validate the performance 
> and stability - no doubt.
> 
> Thanks,
> Bob
> 
> -Original Message-
> From: André Warnier [mailto:a...@ice-sa.com]
> Sent: Wednesday, June 29, 2011 3:30 PM
> To: Tomcat Users List
> Subject: Re: HOW TO: create custom Tomcat 6 connector to do port 
> sharing
> 
> Pid wrote:
>> On 29/06/2011 19:51, Christopher Schultz wrote:
>>> Honestly, I'd look for a non-Tomcat-centric solution because it's 
>>> probably already been built elsewhere.
>>>
>>> -chris
>> Why is opening another port a problem?
>>
> 
> +1
> 
> I do not know XMPP, but from the original OP description it sounds 
> like a protocol which uses its own transport protocol, and normally 
> some other standard port than 80/443. (*)
> 
> Without even going into what kind of issues you may encounter at the Tomcat 
> level when trying to process requests/responses which are not HTTP/HTTPS, I 
> would also think that if you mix 2 different protocols on the same port, you 
> will be forcing whatever equipment/software which separates and dispatches 
> them, to look *inside* each TCP packet to determine which protocol this one 
> is about.  That in itself will introduce quite a bit of overhead.
> 
> Then again, if the connection is (sometimes) over SSL, that would also 
> probably mean that the packets have to be decrypted, even before their 
> HTTP/XMPP nature can be discriminated.
> 
> Looking at XMPP in Wikipedia, it looks like there is something called "XMPP 
> over HTTP transport".  Is that what the OP has in mind ?
> 
> 
> 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users

Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-06-30 Thread Rohan Kadam
Hi All,

We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier facing
problem that tomcat was not able to connect using Static IP address. The fix
that we found was adding
address = "0.0.0.0" in the Connector tag of server.xml in the "conf" directory.


After upgrading tomcat to  7.0.14, we have done the same process, but we are
not able to connect.

The OS we found these issues are Win XP, Win 2008.

Please suggest.

Thanks,
Rohan Kadam.


"Legal Disclaimer: This electronic message and all contents contain information 
from Cybage Software Private Limited which may be privileged, confidential, or 
otherwise protected from disclosure. The information is intended to be for the 
addressee(s) only. If you are not an addressee, any disclosure, copy, 
distribution, or use of the contents of this message is strictly prohibited. If 
you have received this electronic message in error please notify the sender by 
reply e-mail to and destroy the original message and all copies. Cybage has 
taken every reasonable precaution to minimize the risk of malicious content in 
the mail, but is not liable for any damage you may sustain as a result of any 
malicious content in this e-mail. You should carry out your own malicious 
content checks before opening the e-mail or attachment." 
www.cybage.com



Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-06-30 Thread Pid
On 30/06/2011 13:01, Rohan Kadam wrote:
> Hi All,
> 
> We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier facing
> problem that tomcat was not able to connect using Static IP address. The fix
> that we found was adding
> address = "0.0.0.0" in the Connector tag of server.xml in the "conf" 
> directory.
> 
> 
> After upgrading tomcat to  7.0.14, we have done the same process, but we are
> not able to connect.

Have you also upgraded Java?  What version (exactly) of Java are you using?


p



signature.asc
Description: OpenPGP digital signature


RE: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-06-30 Thread Rohan Kadam
Hi,

I am using JAVA 1.6 update 23 version.

Thanks,
Rohan Kadam.

-Original Message-
From: Pid [mailto:p...@pidster.com] 
Sent: Thursday, June 30, 2011 7:22 PM
To: Tomcat Users List
Subject: Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

On 30/06/2011 13:01, Rohan Kadam wrote:
> Hi All,
> 
> We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier 
> facing problem that tomcat was not able to connect using Static IP 
> address. The fix that we found was adding address = "0.0.0.0" in the 
> Connector tag of server.xml in the "conf" directory.
> 
> 
> After upgrading tomcat to  7.0.14, we have done the same process, but 
> we are not able to connect.

Have you also upgraded Java?  What version (exactly) of Java are you using?


p


"Legal Disclaimer: This electronic message and all contents contain information 
from Cybage Software Private Limited which may be privileged, confidential, or 
otherwise protected from disclosure. The information is intended to be for the 
addressee(s) only. If you are not an addressee, any disclosure, copy, 
distribution, or use of the contents of this message is strictly prohibited. If 
you have received this electronic message in error please notify the sender by 
reply e-mail to and destroy the original message and all copies. Cybage has 
taken every reasonable precaution to minimize the risk of malicious content in 
the mail, but is not liable for any damage you may sustain as a result of any 
malicious content in this e-mail. You should carry out your own malicious 
content checks before opening the e-mail or attachment." 
www.cybage.com



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



Re: Tomcat performance issues...

2011-06-30 Thread Tony Anecito
Thanks for the link and it proved what I was concerned about and that is Tomcat 
6 does not have an approved standard library for JSP's which means 7 has more 
issues with this "Standard" taglib.

I could be wrong but the highest level of support is servlet 2.4 and Tomcat 6 
is 
at 2.5.

Regards,
-Tony



- Original Message 
From: Tony Anecito 
To: Tomcat Users List 
Sent: Wed, June 29, 2011 5:10:33 PM
Subject: Re: Tomcat performance issues...

Thanks I did not spot the users group. I thought maybe the taglibs was a dead 
project seemed like there was no version that supported Tomcat 6.0.x.
I will continue the message thread onto that group thanks for the advice.

I am a tester but the response time was 3-4 seconds.

I have not asked the developers the specifics yet about the tag. Now I am more 
concerned the version of Taglib being used was like for version 5 of Tomcat and 
not for version 6.

Thanks All.
-Tony


 


- Original Message 
From: Konstantin Kolinko 
To: Tomcat Users List 
Sent: Wed, June 29, 2011 12:43:48 PM
Subject: Re: Tomcat performacne issues...

2011/6/29 Christopher Schultz :
> Apache taglibs /is/ JSTL from an API point of view.

To be more precise, JSTL is implemented by the "Standard" taglib there

http://tomcat.apache.org/taglibs/standard/

Note, that the Taglibs project has its separate "taglibs-user" mailing list.

Best regards,
Konstantin Kolinko

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

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

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



how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
We're running tomcat 6.0.32 64-bit on Windows Server 2008 R2.  We have a 
requirement to support pluggable extensions to our webapp.  We do not want the 
associated JAR(s) in the WEB-INF/lib directory.  Instead, we want to place them 
in a WEB-INF/lib/extensions folder that we created.

To do this, I need to inform my webapp class loader about the extra repository. 
 From looking at VirtualWebappLoader, this looks like just what I need.

Problem is - I can't seem to get this to work.  I have created a context.xml 
file and placed it in our META-INF folder.  The contents are:



   


>From reading the tomcat documentation, it seems like Tomcat should 
>automatically detect the context.xml file and add the classloader, but it 
>doesn't seem to be looking in this extra directory.  I've tried adding a path 
>attribute to the Context element, but that didn't help.

If anyone can clarify how to use this, I would greatly appreciate it.

Thanks in advance,
-bob



Re: Tomcat performance issues...

2011-06-30 Thread Konstantin Kolinko
2011/6/30 Tony Anecito :
> Thanks for the link and it proved what I was concerned about and that is 
> Tomcat
> 6 does not have an approved standard library for JSP's which means 7 has more
> issues with this "Standard" taglib.
>
> I could be wrong but the highest level of support is servlet 2.4 and Tomcat 6 
> is
> at 2.5.

All previous versions of specifications are supported.

The version 1.1.2 of the Standard taglib is included into the
"examples" web application and does works on all supported Tomcat
versions.

It is not included as "part" of Tomcat, because your web application
is free to use and bundle whatever libraries it wants, be that
taglibs, myfaces, etc etc.

Best regards,
Konstantin Kolinko

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



Re: Tomcat performance issues...

2011-06-30 Thread Tony Anecito
Thanks I joined the taglib email list and am waiting for an answer. I suspect 
Tomcat might support the lib you mentioned but the servlet spec and what 
appeared to be a dead project worried me.

Regards,
-Tony



- Original Message 
From: Konstantin Kolinko 
To: Tomcat Users List 
Sent: Thu, June 30, 2011 9:19:49 AM
Subject: Re: Tomcat performance issues...

2011/6/30 Tony Anecito :
> Thanks for the link and it proved what I was concerned about and that is 
Tomcat
> 6 does not have an approved standard library for JSP's which means 7 has more
> issues with this "Standard" taglib.
>
> I could be wrong but the highest level of support is servlet 2.4 and Tomcat 6 
>is
> at 2.5.

All previous versions of specifications are supported.

The version 1.1.2 of the Standard taglib is included into the
"examples" web application and does works on all supported Tomcat
versions.

It is not included as "part" of Tomcat, because your web application
is free to use and bundle whatever libraries it wants, be that
taglibs, myfaces, etc etc.

Best regards,
Konstantin Kolinko

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

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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Konstantin Kolinko
2011/6/30 Bob DeRemer :
>           virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>

The above should be an absolute path.

You can use system variables, e.g.
${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar

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



Re: fail to download large static files in tomcat

2011-06-30 Thread André Warnier

Michal Singer wrote:

This was the configuration I had in the server.xml which did not work for large 
files:



And I changed this to:


And now it does work for 500MB files, though when comparing the time it takes 
(for smaller files which work on both configurations),
the performance degraded with the HTTP/1.1 connector. So of course, I prefer it 
to work on nio.



Just to clarify one more aspect :
In previous messages,

a) you showed an access log line like this :
10.206.90.6 - - [30/Jun/2011:11:37:16 +0300] "GET /bundles/vacc-AOS701b318-fl.tgz 
HTTP/1.0" 200 -


(indicating HTTP/1.0 was being used)

and then later you said :

b) "I changed the connector to HTTP/1.1 and now the download works"..

So what exactly did you change, to make HTTP/1.0 become HTTP/1.1 instead ?
Or am I now confused ?
What does the access log show now, for a download ?

 

On a separate issue : in the AccessLog Valve, you can specify a "pattern", so as to add to 
the access log lines the total time it took to process the request (see the "pattern" 
attribute and for instance the "%D" pattern string).

That may be useful in order to really compare objectively the times for 
downloading files.

Remember that there are other elements than the server itself that determine how fast the 
file is downloaded (the network, how many other things are going on, the client, etc..).
So you would need to repeat the test a number of times in order to really be sure that 
there is a solid difference on the server side.



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



RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
Thanks Konstantin, but that didn't do it.  I can see that Tomcat copies the 
context.xml over to /conf/Catalina/localhost and names it 
.xml.  Is there any way to printout the classpath my webapp is using 
in the context of tomcat - to try and debug this?

The exact contents is:





Do I need to do anything programmatically to enable this?

-bob

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Thursday, June 30, 2011 11:27 AM
To: Tomcat Users List
Subject: Re: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

2011/6/30 Bob DeRemer :
>           virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>

The above should be an absolute path.

You can use system variables, e.g.
${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar

-
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



UPDATE - RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
I was able to get this to work.  I had a hunch, so I moved the extensions 
folder outside the WEB-INF directory.Any idea why these extra repositories 
cannot be under the WEB-INF/lib folder ?

Also, ONE OTHER QUESTION: 

Is there a way to have new JAR(s) that get dropped into the extensions folder 
picked up automatically [without] restarting the webapp or tomcat?  We'd like 
to have the classloader actually fallback to reading from this extensions 
location if I can't load it normally.
* would this require a custom classloader that derived from VirtualWebappLoader 
- so it would pickup existing extensions at startup, but could also check/load 
the JAR(s) dynamically if it can't load them?
** if it does require a custom classloader, can someone point me to an example 
of how to do this?

Thanks again,
Bob

-Original Message-
From: Bob DeRemer [mailto:bob.dere...@thingworx.com] 
Sent: Thursday, June 30, 2011 11:53 AM
To: Tomcat Users List
Subject: RE: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

Thanks Konstantin, but that didn't do it.  I can see that Tomcat copies the 
context.xml over to /conf/Catalina/localhost and names it 
.xml.  Is there any way to printout the classpath my webapp is using 
in the context of tomcat - to try and debug this?

The exact contents is:


 


Do I need to do anything programmatically to enable this?

-bob

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com]
Sent: Thursday, June 30, 2011 11:27 AM
To: Tomcat Users List
Subject: Re: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

2011/6/30 Bob DeRemer :
>           virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>

The above should be an absolute path.

You can use system variables, e.g.
${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar

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


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


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



Re: UPDATE - RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Konstantin Kolinko
2011/6/30 Bob DeRemer :
> I was able to get this to work.  I had a hunch, so I moved the extensions 
> folder outside the WEB-INF directory.    Any idea why these extra 
> repositories cannot be under the WEB-INF/lib folder ?

I think classes should be loadable, but IIRC annotation and resources
scanning won't work for the. There was a bug about that and it was
closed as WONTFIX.
The short version is that it is hard to differ between app's own
WEB-INF and your directory, and WEB-INF is explicitly skipped to avoid
scanning it twice.

>
> Also, ONE OTHER QUESTION:
>
> Is there a way to have new JAR(s) that get dropped into the extensions folder 
> picked up automatically [without] restarting the webapp or tomcat?

No, it is not possible. You need to restart the webapp.

>  We'd like to have the classloader actually fallback to reading from this 
> extensions location if I can't load it normally.
> * would this require a custom classloader that derived from 
> VirtualWebappLoader - so it would pickup existing extensions at startup, but 
> could also check/load the JAR(s) dynamically if it can't load them?
> ** if it does require a custom classloader, can someone point me to an 
> example of how to do this?

YMMV.  You may start reading with the ones implemented by Tomcat.
There is classloader for JSPs that supports reloading (if JspServlet
is being run in "development"=true mode).

VirtualWebappLoader is not a classloader. It is just a component that
configures one.

Best regards,
Konstantin Kolinko

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



RE: UPDATE - RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
Thank you!

Since it looks like I need to create my own classloader [to get it to check my 
extensions folder "on the fly"], can you point me to some links or samples that 
show how to do this?  I can't believe more people haven't had to dynamically 
load JAR(s) to resolve classes "on the fly" for extensible applications that 
need to remain running.

-bob

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Thursday, June 30, 2011 12:25 PM
To: Tomcat Users List
Subject: Re: UPDATE - RE: how to use VirtualWebappLoader - either in 
META-INF/context.xml or programmatically on startup

2011/6/30 Bob DeRemer :
> I was able to get this to work.  I had a hunch, so I moved the extensions 
> folder outside the WEB-INF directory.    Any idea why these extra 
> repositories cannot be under the WEB-INF/lib folder ?

I think classes should be loadable, but IIRC annotation and resources scanning 
won't work for the. There was a bug about that and it was closed as WONTFIX.
The short version is that it is hard to differ between app's own WEB-INF and 
your directory, and WEB-INF is explicitly skipped to avoid scanning it twice.

>
> Also, ONE OTHER QUESTION:
>
> Is there a way to have new JAR(s) that get dropped into the extensions folder 
> picked up automatically [without] restarting the webapp or tomcat?

No, it is not possible. You need to restart the webapp.

>  We'd like to have the classloader actually fallback to reading from this 
> extensions location if I can't load it normally.
> * would this require a custom classloader that derived from 
> VirtualWebappLoader - so it would pickup existing extensions at startup, but 
> could also check/load the JAR(s) dynamically if it can't load them?
> ** if it does require a custom classloader, can someone point me to an 
> example of how to do this?

YMMV.  You may start reading with the ones implemented by Tomcat.
There is classloader for JSPs that supports reloading (if JspServlet is being 
run in "development"=true mode).

VirtualWebappLoader is not a classloader. It is just a component that 
configures one.

Best regards,
Konstantin Kolinko

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


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



RE: tomcat recovery after hang

2011-06-30 Thread Carlos Juarez


> > In addition I found a webpage that tells how to check when tomcat falls, 
> > (checking PID or Service status)
> > the problem is that when my tomcat hangs it still "working", Can't use that 
> > methods 
> 
> Instead of trying to work around the problem, why not try to understand
> why Tomcat (or more likely your application) is 'hanging'?

I understand that my app have a problem, I can change nothing on the
 code, because I don't even have the source code but only the compiled 
classes.

> 
> What do the logs say when this happens?
> Is the JVM really still running?

that was my question. how can i know if my JVM is really still working, when I 
make ps axf | grep java or ps ax | grep tomcat, appear the tomcat process, 
when i check service tomcat1 (or tomcat2) status. it responds "running",  but 
nothing is serving requests.


  

RE: Problem with SSL certificate

2011-06-30 Thread D'Anna, Rich (PHH)
Just an update on this issue.  We decided to install the most up to date
version of Tomcat including the native libraries and troubleshoot from
there.

Once everything was installed and came up fine we edited the server.xml
file to enable SSL and we definitely were getting the right certificate
but it was still giving us an error that the certificate was not
trusted.  For some reason it was not seeing the entire certificate
chain.

We did some research and found we needed to add the following setting in
the server.xml:

SSLCACertificateFile="D:\certs\MTG_CA.cer"

Once we did restarted Tomcat everything works as expected.  Thanks again
for all your help.

-Original Message-
From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] 
Sent: Wednesday, June 29, 2011 2:22 PM
To: Tomcat Users List
Subject: RE: Problem with SSL certificate 

> From: D'Anna, Rich (PHH) [mailto:Rich.D'a...@phh.com] 
> Subject: RE: Problem with SSL certificate 

> I'm guessing we are using the native APR connector based 
> on the configuration we selected for the server.xml.

Better to say you're trying to use it, since the logs indicate you're
not.

> I'm guessing from the error message we need to install the APR based
> Tomcat Native Library?  Is that correct?  

Correct.  You should use the one for the Tomcat version you're running,
which is included with the Tomcat downloads for Windows.  Also need to
know if you're using a 32- or 64-bit JVM, since the APR code must be
compiled for the appropriate environment.

Personally, I would take the opportunity to upgrade Tomcat to the
current version, rather than using one that's three years old.  The
current versions include both 32- and 64-bit DLLs, and install the
proper one automatically.

If you really want to stick with 6.0.18 and are running a 32-bit JVM,
get the .zip download from here:

http://archive.apache.org/dist/tomcat/tomcat-6/v6.0.18/bin/

Copy the tcnative-1.dll from that into your Tomcat's bin directory.  If
you're using a 64-bit JVM, please repost, since finding the three-year
old version of tcnative for 64 bit environments is a bit trickier.

 - Chuck


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


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




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



Set Java VM arguments programmatically in Tomcat

2011-06-30 Thread Anand HS
Hello Everyone. !
I would like to set JVM  arguments like Xmx, Xms etc programmatically and
provide it to Tomcat at start up.
I am aware of doing this by editing for eg, catalina.bat  or introducing
setenv.bat , but I was keen on exploring any other ways tomcat provides  in
which I can override these without changing or introducing batch files.

Thanks,
Anand


RE: Set Java VM arguments programmatically in Tomcat

2011-06-30 Thread Caldarale, Charles R
> From: Anand HS [mailto:anan...@gmail.com] 
> Subject: Set Java VM arguments programmatically in Tomcat

> I would like to set JVM  arguments like Xmx, Xms etc programmatically 
> and provide it to Tomcat at start up.

Not quite sure what you mean by "programmatically" here, since the values must 
be set during JVM initialization, long before any Tomcat code runs.  You can 
write your own script that sets the CATALINA_OPTS variable and then invokes the 
regular Tomcat startup scripts.

 - 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: APR Native library on tomcat 6

2011-06-30 Thread ccastle

Hello.

I have the same problem, except that in the log it is not specified what
library is needed. This are the messages in the log:

30-jun-2011 15:13:03 org.apache.coyote.http11.Http11Protocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
30-jun-2011 15:13:04 org.apache.catalina.core.StandardService stop
INFO: Parando servicio Catalina
30-jun-2011 15:13:04 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
30-jun-2011 15:13:04 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: Failed shutdown of Apache Portable Runtime
30-jun-2011 15:16:01 org.apache.catalina.core.AprLifecycleListener
lifecycleEvent
INFO: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
/usr/java/jdk1.6/jre/lib/i386/server:/usr/java/jdk1.6/jre/lib/i386:/usr/java/jdk1.6/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib
30-jun-2011 15:16:01 org.apache.coyote.http11.Http11Protocol init
INFO: Inicializando Coyote HTTP/1.1 en puerto http-8080
30-jun-2011 15:16:01 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 281 ms
30-jun-2011 15:16:02 org.apache.catalina.core.StandardService start
INFO: Arrancando servicio Catalina
30-jun-2011 15:16:02 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.0
30-jun-2011 15:16:02 org.apache.catalina.core.StandardHost start
INFO: Desactivada la validación XML
30-jun-2011 15:16:02 org.apache.catalina.loader.WebappClassLoader
validateJarFile
INFO:
validateJarFile(/opt/tomcat6/webapps/Recaudacion/WEB-INF/lib/servlet-api.jar)
- jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class:
javax/servlet/Servlet.class
30-jun-2011 15:16:02 org.apache.coyote.http11.Http11Protocol start
INFO: Arrancando Coyote HTTP/1.1 en puerto http-8080
30-jun-2011 15:16:02 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
30-jun-2011 15:16:02 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/41  config=null
30-jun-2011 15:16:02 org.apache.catalina.startup.Catalina start
INFO: Server startup in 847 ms


The bolded part of the message is the error I have. Besides, I'm trying to
use tomcat 6 with a Project that was compiled on tomcat 5.5.7, I can't see
the jsp pages.

Could you help me with this plis?

Thankyou!

Christopher Schultz-2 wrote:
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> lmk,
> 
> On 6/19/2009 9:59 AM, lmk wrote:
>> I complied apr sources, I dont used binnaries.
> 
> If you compiled apr, you're not done: you actually need libtcnative-1.so
> as well as apr. The APR connector is a little misleading in its naming
> because it's libtcnative.so that is required, not libapr.so.
> 
> You can find tcnative in your Tomcat distro under
> CATALINA_HOME/bin/tomcat-native.tar.gz
> 
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
> 
> iEYEARECAAYFAko/1BAACgkQ9CaO5/Lv0PCangCbBvsOD69tpdPieboAxoOgcEK2
> TdwAoKWtCfA1oRaoFE2iOffyzJ/d4EwB
> =uhFj
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/APR-Native-library-on-tomcat-6-tp24107914p31967678.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: tomcat recovery after hang

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Carlos,

On 6/30/2011 12:47 PM, Carlos Juarez wrote:
>>> In addition I found a webpage that tells how to check when tomcat falls, 
>>> (checking PID or Service status)
>>> the problem is that when my tomcat hangs it still "working", Can't use that 
>>> methods 
>>
>> Instead of trying to work around the problem, why not try to understand
>> why Tomcat (or more likely your application) is 'hanging'?
> 
> I understand that my app have a problem, I can change nothing on the
>  code, because I don't even have the source code but only the compiled 
> classes.
> 
>>
>> What do the logs say when this happens?
>> Is the JVM really still running?
> 
> that was my question. how can i know if my JVM is really still working, when 
> I make ps axf | grep java or ps ax | grep tomcat, appear the tomcat process, 
> when i check service tomcat1 (or tomcat2) status. it responds "running",  but 
> nothing is serving requests.

Whatever checks the service status is likely to be very basic -- just
checking to see if the pid is actually still alive or something like that.

Better to find out what the server is really doing.

Pid asked about the logs. Can you check the logs for errors or other
suspicious messages?

Also, you can take a thread dump of the JVM to find out what's going on:
http://wiki.apache.org/tomcat/HowTo#How_do_I_obtain_a_thread_dump_of_my_running_webapp_.3F

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

iEYEARECAAYFAk4M3EIACgkQ9CaO5/Lv0PDnVACgr7Z091Ef2SuGWLP2sOSeSiP2
tCEAn1BVw6AXH7FxmMB5NVKcjXtkBc0t
=pHZR
-END PGP SIGNATURE-

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



Re: APR Native library on tomcat 6

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

To whom it may concern,

On 6/30/2011 4:21 PM, ccastle wrote:
> I have the same problem [where APR won't load], except that in the log it is 
> not specified what
> library is needed.

You don't need to read the logs to see what library is needed, you need
to read the documentation:
http://tomcat.apache.org/tomcat-7.0-doc/apr.html

> This are the messages in the log:
>
> The bolded part of the message is the error I have.

Text styles do not come across plain text mailing list posts.

I don't see any error messages at all. Perhaps you are talking about
this INFO message:

> INFO: The Apache Tomcat Native library which allows optimal performance in
> production environments was not found on the java.library.path:
> /usr/java/jdk1.6/jre/lib/i386/server:/usr/java/jdk1.6/jre/lib/i386:/usr/java/jdk1.6/jre/../lib/i386:/usr/java/packages/lib/i386:/lib:/usr/lib

Are you actually intending to use APR? If you are trying to use APR and
it's not working, then you should tell us what you have done so far.

If you don't care about APR or have no idea what I'm talking about and
are only posting to the list because of the above message, you can
safely ignore the message or disable the AprLifecycleListener in
server.xml to get rid of that message.

> Besides, I'm trying to use tomcat 6 with a Project that was compiled
> on tomcat 5.5.7, I can't see the jsp pages.

Please post to the list under a separate subject if you have another,
unrelated problem.

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

iEYEARECAAYFAk4M3WIACgkQ9CaO5/Lv0PD6IgCgom3sUXhIKdrHQCFKHWmH5tc1
URQAnjEU4JTDwTi+11NdtmpzzbD9igMa
=mFx7
-END PGP SIGNATURE-

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



Re: Tomcat performance issues...

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tony,

On 6/30/2011 11:23 AM, Tony Anecito wrote:
> I suspect Tomcat might support the lib you mentioned

Tomcat does not need to support the library specifically: if a library
properly uses the Servlet and/or JSP APIs properly, it should work with
Tomcat. If it doesn't work, the problem is either in configuration (some
features are only available with certain spec versions), a bug in the
library or a bug in Tomcat.

> but the servlet spec

JSTL does not require the use of the most up-to-date servlet spec
(currently 3.0) in order to use it. Tomcat supports all versions of the
servlet spec up to that which is declared (spec 2.4 for TC5.5, spec 2.5
for TC6, and spec 3.0 for TC7).

> and what appeared to be a dead project worried me.

The project is not dead. I think it's just mature enough that there's
little development going on: everything works just fine, apparently.

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

iEYEARECAAYFAk4M3qQACgkQ9CaO5/Lv0PBs8wCgpK7Q87nX/DI44jlzV5Rv9aIJ
c30AoLlNRnHDMiENiS6bSHxhGTPebHDz
=Y1ug
-END PGP SIGNATURE-

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



Re: corrupt gzip output when compression=on in server.xml

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Chris,

On 6/30/2011 11:05 AM, Christopher Taylor wrote:
> While it works great, we encountered a response
> that consistently returned a corrupted gzip stream in the response
> (inside the zip file attached to this message to make sure that it's
> not transparently decompressed by accident).

Could you pare this down to a super-simple test case? If so, log a new
issue in Bugzilla and attach that test case as a complete WAR file so we
can reproduce it.

> What is interesting about the broken response is that the compressed
> data contains an uncompressed fragment at the end, followed by some
> more binary data. I looked around and found that
> org.apache.coyote.http11.filters.FlushableGZIPOutputStream seems to
> force flushing the stream by switching the compression method to
> NO_COMPRESSION and back again to DEFAULT_COMPRESSION -- I wonder if
> this is the cause?

That certainly sounds plausible.

Have you tried other TC versions where this same file works?

> Google yielded two bugs that seem to be related:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4813885 deals with
> flushing Gzip streams and
> https://issues.apache.org/bugzilla/show_bug.cgi?id=48738 seems to
> track the introduction of FlushableGZIPOutputStream into tomcat.

I wonder if you are hitting some super-special edge case, like you are
flushing when the buffer has nothing in it (due to the buffer having
just been flushed naturally) or something like that.

I have to imagine that flushing a GZIPOutputStream is tricky business
because you want gzip to complete it's current block (so it can actually
flush) but also be prepared to continue the stream afterward.

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

iEYEARECAAYFAk4M4FEACgkQ9CaO5/Lv0PDpqACfesDaPACMyl5nD8bJBd2RZHJA
dG4AnAhyct79YRvFXaSOAzl9+aZGRvGQ
=MrFd
-END PGP SIGNATURE-

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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Konstantin,

On 6/30/2011 11:27 AM, Konstantin Kolinko wrote:
> 2011/6/30 Bob DeRemer :
>>   virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>
> 
> The above should be an absolute path.
> 
> You can use system variables, e.g.
> ${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar

Hmm... does that mean that VirtualWebappLoader can't be used with paths
inside WAR files? Being able to support paths relative to the webapp
would be quite nice.

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

iEYEARECAAYFAk4M4YsACgkQ9CaO5/Lv0PCHSACaA5DArmMnC71gtPDOiyEsxoWT
/HoAoI3+0tIrwlcL70SIuj0LnBCZ/S54
=ECep
-END PGP SIGNATURE-

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



Re: Tomcat is not able to connect to IPV4 (Tomcat Version : 7.0.14)

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rohan,

On 6/30/2011 8:01 AM, Rohan Kadam wrote:
> We had recently upgraded tomcat from 5.5.30 to 7.0.14. We were earlier facing
> problem that tomcat was not able to connect using Static IP address. The fix
> that we found was adding
> address = "0.0.0.0" in the Connector tag of server.xml in the "conf" 
> directory.

This was likely because your JVM prefers an IPv6 stack, while using an
IPv4 address (0.0.0.0) explicitly causes it to bind to an IPv4 address.

When you say "not able to connect", do you mean that the client couldn't
reach Tomcat, or that Tomcat couldn't connect to some other server?

> After upgrading tomcat to 7.0.14, we have done the same process, but we are
> not able to connect.

What do Tomcat' logs say when started? What error message(s) do you get
(on the client?)?

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

iEYEARECAAYFAk4M40YACgkQ9CaO5/Lv0PDRmQCeL7LT4QgVi/VzAbwnLFECa+yI
r9cAn2TNOg50IFejixP0TNsWl0fKVSFv
=Y1qL
-END PGP SIGNATURE-

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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Rainer Jung
On 30.06.2011 22:50, Christopher Schultz wrote:
> Konstantin,
> 
> On 6/30/2011 11:27 AM, Konstantin Kolinko wrote:
>> 2011/6/30 Bob DeRemer :
>>>   virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>
> 
>> The above should be an absolute path.
> 
>> You can use system variables, e.g.
>> ${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar
> 
> Hmm... does that mean that VirtualWebappLoader can't be used with paths
> inside WAR files? Being able to support paths relative to the webapp
> would be quite nice.

I always thought the main use case for VWL is to be able to extend wars
by adding things outside without patching them into the war. So sticking
to one identical war and adding variations about the deployment
environment, like ressources needed for configuration, on the outside.

If you add classes, ressources or jar files inside the war, then I don't
see any obvious reason not to include them in the standard places.

Regards,

Rainer

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



Re: Set Java VM arguments programmatically in Tomcat

2011-06-30 Thread Anand HS
I apologize for not being clearer.
Basically I would like not to use any batch scripts ( in Windows ) to set
CATALINA_OPTS, JAVA_OPTS etc.. , instead would like to do it through a
custom Java program and then hook up . To this effect, I was wondering if
there is a way to extend Bootstrap class of Tomcat to achieve it.
That said, I'm not sure if it is a recommended way to do it even since I was
trying to just explore if batch files are the only options for me to feed in
environment variables to Tomcat and Java.

Thanks,
Anand

On Thu, Jun 30, 2011 at 12:04 PM, Caldarale, Charles R <
chuck.caldar...@unisys.com> wrote:

> > From: Anand HS [mailto:anan...@gmail.com]
> > Subject: Set Java VM arguments programmatically in Tomcat
>
> > I would like to set JVM  arguments like Xmx, Xms etc programmatically
> > and provide it to Tomcat at start up.
>
> Not quite sure what you mean by "programmatically" here, since the values
> must be set during JVM initialization, long before any Tomcat code runs.
>  You can write your own script that sets the CATALINA_OPTS variable and then
> invokes the regular Tomcat startup scripts.
>
>  - 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
>
>


webapps and TCP/UDP listening sockets

2011-06-30 Thread Tim Judd
I think this would be probably difficult to Google and get answers, so I joined 
the mailing list hoping I might get a straight answer...

If I develop a webapp that listens for TCP/UDP sockets, which machine is 
actually listening?  Is the tomcat server listening (because the webapp is 
running on that tomcat) or is the client listening (because he is running the 
webapp on the tomcat server)!

My goal is to have:
  single UDP listening at tomcat server for packets, and
  multicast UDP listening at the clients that is getting resended off the 
single 
above UDP port from the webapp tomcat server


This will eventually become a CRM and this mental block or potential problem 
may 
need me to re-evaluate how the tool is made.


 If opportunity doesn't knock, build a door.
"I can" is a way of life.
More and Bigger is not always Better.
The road to success is always uphill.


Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Konstantin Kolinko
2011/7/1 Christopher Schultz :
>
> On 6/30/2011 11:27 AM, Konstantin Kolinko wrote:
>> 2011/6/30 Bob DeRemer :
>>>           virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>
>>
>> The above should be an absolute path.
>>
>> You can use system variables, e.g.
>> ${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar
>
> Hmm... does that mean that VirtualWebappLoader can't be used with paths
> inside WAR files? Being able to support paths relative to the webapp
> would be quite nice.

I think that should be some ${} property.

It either has
a) either to be given to the Digester when it parses the XML, so that
it expands the property,
b) or Digester will leave it unexpanded (because it is unknown) and
VirtualWebappLoader  will expand its value when starting.

Either way, there is a question of obtaining this path early and
passing this information around.


Regarding the issue that I mentioned:
https://issues.apache.org/bugzilla/show_bug.cgi?id=47939

It looks that the following (without "lib") will work:
 ${catalina.base}/webapps/mywebapp/WEB-INF/extensions/*.jar

Best regards,
Konstantin Kolinko

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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Rainer,

On 6/30/2011 5:27 PM, Rainer Jung wrote:
> On 30.06.2011 22:50, Christopher Schultz wrote:
>> Konstantin,
>>
>> On 6/30/2011 11:27 AM, Konstantin Kolinko wrote:
>>> 2011/6/30 Bob DeRemer :
   virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>
>>
>>> The above should be an absolute path.
>>
>>> You can use system variables, e.g.
>>> ${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar
>>
>> Hmm... does that mean that VirtualWebappLoader can't be used with paths
>> inside WAR files? Being able to support paths relative to the webapp
>> would be quite nice.
> 
> I always thought the main use case for VWL is to be able to extend wars
> by adding things outside without patching them into the war. So sticking
> to one identical war and adding variations about the deployment
> environment, like resources needed for configuration, on the outside.

That's a good point: if you need truly exotic class loading
requirements, such as being able to re-load certain libraries for only a
portion of your webapp (a la JSP or AXIS services), then using VWL isn't
really what you're looking for.

> If you add classes, ressources or jar files inside the war, then I don't
> see any obvious reason not to include them in the standard places.

If the VirtualWebappLoader allowed certain JARs to be placed /before/
WEB-INF/classes and WEB-INF/lib/*.jar, then a webapp could also include
external patches without modifying the WAR.

I'm not sure that's a truly useful feature, though ;)

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

iEYEARECAAYFAk4NKQUACgkQ9CaO5/Lv0PB5jwCgpOdbCTpia9w/xkZ1IiqNtSNT
aVgAn0g5EWfP7fqV4K7FaW+oebiEt4FD
=fClj
-END PGP SIGNATURE-

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



RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
I've verified that the WEB-INF/extensions will work, too.  The key issue for us 
is being able to hot-deploy extension JAR(s) live without restarting the webapp 
or Tomcat.  I began by seeing if Tomcat supported find JAR(s) on non-standard 
locations so we can separate the extensions.  These extensions to our core 
product will typically be developed by 3rd parties.

So, I now need to look at creating my own classloader [it seems] because even 
the VWL doesn't monitor for JAR additions and automatically load them.  Again - 
if anyone knows how to do this, I would really appreciate any direction to 
shorten my dev time.

Thanks,
Bob

-Original Message-
From: Konstantin Kolinko [mailto:knst.koli...@gmail.com] 
Sent: Thursday, June 30, 2011 7:17 PM
To: Tomcat Users List
Subject: Re: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

2011/7/1 Christopher Schultz :
>
> On 6/30/2011 11:27 AM, Konstantin Kolinko wrote:
>> 2011/6/30 Bob DeRemer :
>>>           virtualClasspath="/WEB-INF/lib/extensions/*.jar"/>
>>
>> The above should be an absolute path.
>>
>> You can use system variables, e.g.
>> ${catalina.base}/webapps/mywebapp/WEB-INF/lib/extensions/*.jar
>
> Hmm... does that mean that VirtualWebappLoader can't be used with 
> paths inside WAR files? Being able to support paths relative to the 
> webapp would be quite nice.

I think that should be some ${} property.

It either has
a) either to be given to the Digester when it parses the XML, so that it 
expands the property,
b) or Digester will leave it unexpanded (because it is unknown) and 
VirtualWebappLoader  will expand its value when starting.

Either way, there is a question of obtaining this path early and passing this 
information around.


Regarding the issue that I mentioned:
https://issues.apache.org/bugzilla/show_bug.cgi?id=47939

It looks that the following (without "lib") will work:
 ${catalina.base}/webapps/mywebapp/WEB-INF/extensions/*.jar

Best regards,
Konstantin Kolinko

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


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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bob,

On 6/30/2011 9:55 PM, Bob DeRemer wrote:
> I've verified that the WEB-INF/extensions will work, too.  The key
> issue for us is being able to hot-deploy extension JAR(s) live
> without restarting the webapp or Tomcat.  I began by seeing if Tomcat
> supported find JAR(s) on non-standard locations so we can separate
> the extensions.  These extensions to our core product will typically
> be developed by 3rd parties.
> 
> So, I now need to look at creating my own classloader [it seems]
> because even the VWL doesn't monitor for JAR additions and
> automatically load them.  Again - if anyone knows how to do this, I
> would really appreciate any direction to shorten my dev time.

Tomcat has a ClassLoader used for re-loading JSPs. A quick look at that
shows there is no real magic there: it does not re-load itself in any
way. Instead, some other component somewhere must be monitoring the JSP
files for updates and orchestrating the disposal of the old ClassLoader
(and the classes and instances loaded by it) and the creation of a new one.

I believe AXIS also has such a scheme for re-loading web services
without bouncing the entire webapp.

All source code is available online, so you are free to read it all ;)

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

iEYEARECAAYFAk4NKxkACgkQ9CaO5/Lv0PBHdgCdEKO+q78Bg2sKCTHqo3j35Zw8
HC4An0CsvndY6prfajI/jrI45h7T2bF/
=GEfb
-END PGP SIGNATURE-

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



RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
Thanks!  I know it's all open and online, I was just hoping someone might be 
able to point me to some specific classes so I don't have to pour through a lot 
of irrelevant code.

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Thursday, June 30, 2011 10:04 PM
To: Tomcat Users List
Subject: Re: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bob,

On 6/30/2011 9:55 PM, Bob DeRemer wrote:
> I've verified that the WEB-INF/extensions will work, too.  The key 
> issue for us is being able to hot-deploy extension JAR(s) live without 
> restarting the webapp or Tomcat.  I began by seeing if Tomcat 
> supported find JAR(s) on non-standard locations so we can separate the 
> extensions.  These extensions to our core product will typically be 
> developed by 3rd parties.
> 
> So, I now need to look at creating my own classloader [it seems] 
> because even the VWL doesn't monitor for JAR additions and 
> automatically load them.  Again - if anyone knows how to do this, I 
> would really appreciate any direction to shorten my dev time.

Tomcat has a ClassLoader used for re-loading JSPs. A quick look at that shows 
there is no real magic there: it does not re-load itself in any way. Instead, 
some other component somewhere must be monitoring the JSP files for updates and 
orchestrating the disposal of the old ClassLoader (and the classes and 
instances loaded by it) and the creation of a new one.

I believe AXIS also has such a scheme for re-loading web services without 
bouncing the entire webapp.

All source code is available online, so you are free to read it all ;)

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

iEYEARECAAYFAk4NKxkACgkQ9CaO5/Lv0PBHdgCdEKO+q78Bg2sKCTHqo3j35Zw8
HC4An0CsvndY6prfajI/jrI45h7T2bF/
=GEfb
-END PGP SIGNATURE-

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



Re: webapps and TCP/UDP listening sockets

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 6/30/2011 7:14 PM, Tim Judd wrote:
> If I develop a webapp that listens for TCP/UDP sockets, which machine is 
> actually listening?

When you say "machine"... you mean ... what, exactly?

If you develop a webapp that listens for TCP/UDP sockets, where is the
socket bind occurring? If it's your webapp, then it really has nothing
to do with Tomcat at all: it's just like writing a non-webapp program
that binds to a socket and listens.

If you want to delegate incoming requests to threads from Tomcat's
request processor pool, that might be a bit tricky. Is that what you'd
like to do?

Do you really need Tomcat in this situation?

> Is the tomcat server listening (because the webapp is 
> running on that tomcat) or is the client listening (because he is running the 
> webapp on the tomcat server)!

Probably both, but it depends on your answer to the above questions.

> My goal is to have:
>   single UDP listening at tomcat server for packets, and
>   multicast UDP listening at the clients that is getting resended off the 
> single 
> above UDP port from the webapp tomcat server

Why do you want to build this as a web-based application if HTTP isn't
really involved?

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

iEYEARECAAYFAk4NK/sACgkQ9CaO5/Lv0PBlLwCaAqi72qyRX1HCwlrtor+NS62X
YiQAoLuYcbXt4tp9oQ0B+hTCqaocDbkG
=QlO7
-END PGP SIGNATURE-

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



Re: Set Java VM arguments programmatically in Tomcat

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Anand,

On 6/30/2011 6:18 PM, Anand HS wrote:
> Basically I would like not to use any batch scripts ( in Windows ) to set
> CATALINA_OPTS, JAVA_OPTS etc.. , instead would like to do it through a
> custom Java program and then hook up.

You can do this, except that your Java program must launch /a second
JVM/ in order to set properties -- specifically ones such as heap sizes,
etc.

> To this effect, I was wondering if
> there is a way to extend Bootstrap class of Tomcat to achieve it.

No. By the time the Bootstrap code is called, the heap has been
configured and it's too late.

> That said, I'm not sure if it is a recommended way to do it even since I was
> trying to just explore if batch files are the only options for me to feed in
> environment variables to Tomcat and Java.

If you install Tomcat as a service, you can set those parameters in the
service definition (itself a small program that launches the JVM with
the proper parameters) and do anything you want.

But you'll never be able to do this in any practical way through Java code.

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

iEYEARECAAYFAk4NLJEACgkQ9CaO5/Lv0PDQkwCgpPUIvxzVxB72RHxgdFHUW1aO
LGoAnioYym9HOjaRA5tYH7CKfeKfg/Mk
=4skK
-END PGP SIGNATURE-

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



Re: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bob,

On 6/30/2011 10:07 PM, Bob DeRemer wrote:
> Thanks!  I know it's all open and online, I was just hoping someone
> might be able to point me to some specific classes so I don't have to
> pour through a lot of irrelevant code.

Tomcat's component for JSPs is called Jasper. Most of it can be found in
the org.apache.jasper package and subpackages, bundled along with the
rest of the Tomcat code.

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

iEYEARECAAYFAk4NLmwACgkQ9CaO5/Lv0PCQHwCdEQiiqlp6ooaR6ydHE4uTMtFe
HEsAoI2koCSUSozQT4sKJ5tTUMTZxKiU
=yAtC
-END PGP SIGNATURE-

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



RE: how to use VirtualWebappLoader - either in META-INF/context.xml or programmatically on startup

2011-06-30 Thread Bob DeRemer
Awesome, thanks!

-Original Message-
From: Christopher Schultz [mailto:ch...@christopherschultz.net] 
Sent: Thursday, June 30, 2011 10:18 PM
To: Tomcat Users List
Subject: Re: how to use VirtualWebappLoader - either in META-INF/context.xml or 
programmatically on startup

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Bob,

On 6/30/2011 10:07 PM, Bob DeRemer wrote:
> Thanks!  I know it's all open and online, I was just hoping someone 
> might be able to point me to some specific classes so I don't have to 
> pour through a lot of irrelevant code.

Tomcat's component for JSPs is called Jasper. Most of it can be found in the 
org.apache.jasper package and subpackages, bundled along with the rest of the 
Tomcat code.

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

iEYEARECAAYFAk4NLmwACgkQ9CaO5/Lv0PCQHwCdEQiiqlp6ooaR6ydHE4uTMtFe
HEsAoI2koCSUSozQT4sKJ5tTUMTZxKiU
=yAtC
-END PGP SIGNATURE-

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



Re: webapps and TCP/UDP listening sockets

2011-06-30 Thread Tim Judd
Hi Christopher, all

'machine' was meant to indicate one of two choices, the computer that is 
running 
the tomcat server, or the computer who is the client in a client-server 
relationship.  I don't know the intricities of webapps yet in how they run.  
This thread was just trying to understand if I'm barking up the wrong tree.

Your second paragraph is better phrased.  which computer/'machine' is doing the 
binding?  Writing a standalone Java desktop app is most definately going to 
bind 
to it's own machine.  I don't need to delegate anything to Tomcat itself, I 
need 
to know if I run a webapp and it binds and listens to a socket, which machine 
does it bind on?


Lastly, your statement about making it a webapp if http is not involved is 
because to centrally deploy an application is often served off http; I wanted 
to 
get into Java/webapps so I elected this route.  If they are standalone 
protocols 
(and they will be) to communicate between many clients to one (or a farm) of 
servers, why can't I launch it from http?


 If opportunity doesn't knock, build a door.
"I can" is a way of life.
More and Bigger is not always Better.
The road to success is always uphill.





From: Christopher Schultz 
To: Tomcat Users List 
Sent: Thu, June 30, 2011 8:07:55 PM
Subject: Re: webapps and TCP/UDP listening sockets

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Tim,

On 6/30/2011 7:14 PM, Tim Judd wrote:
> If I develop a webapp that listens for TCP/UDP sockets, which machine is 
> actually listening?

When you say "machine"... you mean ... what, exactly?

If you develop a webapp that listens for TCP/UDP sockets, where is the
socket bind occurring? If it's your webapp, then it really has nothing
to do with Tomcat at all: it's just like writing a non-webapp program
that binds to a socket and listens.

If you want to delegate incoming requests to threads from Tomcat's
request processor pool, that might be a bit tricky. Is that what you'd
like to do?

Do you really need Tomcat in this situation?

> Is the tomcat server listening (because the webapp is 
> running on that tomcat) or is the client listening (because he is running the 
> webapp on the tomcat server)!

Probably both, but it depends on your answer to the above questions.

> My goal is to have:
>   single UDP listening at tomcat server for packets, and
>   multicast UDP listening at the clients that is getting resended off the 
>single 
>
> above UDP port from the webapp tomcat server

Why do you want to build this as a web-based application if HTTP isn't
really involved?

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

iEYEARECAAYFAk4NK/sACgkQ9CaO5/Lv0PBlLwCaAqi72qyRX1HCwlrtor+NS62X
YiQAoLuYcbXt4tp9oQ0B+hTCqaocDbkG
=QlO7
-END PGP SIGNATURE-

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