Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-26 Thread Rainer Jung

Am 26.08.2015 um 08:00 schrieb Falco Schwarz:

On Tue, Aug 25, 2015 at 5:13 PM, Rainer Jung rainer.j...@kippdata.de
wrote:


Am 25.08.2015 um 14:58 schrieb Falco Schwarz:


If I try to startup httpd though the following error occurs:

httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf:
Cannot
load /opt/apache/modules/mod_jk.so into server:
/opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4



simply change the #elif line 436 e.g. to

#elif defined(JK_USE_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and the
next option (APR atomics) will be used, but you can later switch back to
the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might add
something like this and make the define be chosen according to configure
flags (--disable-gcc-atomics). Or maybe we should even use a configure
check to detect real support for GCC atomics on the target platform.
users-h...@tomcat.apache.org



I switched the logic to better suit my needs, but that works:

#elif !defined(JK_NO_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


So on our 32bit systems jk is built with:
CFLAGS='-DJK_NO_GCC_ATOMICS' ./configure --with-apxs=/opt/apache/bin/apxs

It would be nice if something like that (preferably a configure option)
would be built in. It would of course be even better if configure could
detect if gcc atomics work and decide whether to use them or not. Anyways,
thank you for your quick and very helpful response.


I added a configure check in

  http://svn.apache.org/viewvc?view=revisionrevision=1697985

and documented the problem in

  https://bz.apache.org/bugzilla/show_bug.cgi?id=58285

You might want to cross check.

Thanks for helping!

Regards,

Rainer

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



Re: Problems with tomcat-connectors-1.2.41 on 32bit linux

2015-08-26 Thread Falco Schwarz
On Tue, Aug 25, 2015 at 5:13 PM, Rainer Jung rainer.j...@kippdata.de
wrote:

 Am 25.08.2015 um 14:58 schrieb Falco Schwarz:

 If I try to startup httpd though the following error occurs:

 httpd: Syntax error on line 88 of /opt/apache/conf/alles/httpd.conf:
 Cannot
 load /opt/apache/modules/mod_jk.so into server:
 /opt/apache/modules/mod_jk.so: undefined symbol: __sync_add_and_fetch_4


 simply change the #elif line 436 e.g. to

 #elif defined(JK_USE_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
 (__GNUC__ == 4  __GNUC_MINOR__ = 1))


 Since JK_USE_GCC_ATOMICS is not defined, the elif will be skipped and the
 next option (APR atomics) will be used, but you can later switch back to
 the GCC version by compiling with -DJK_USE_GCC_ATOMICS. We might add
 something like this and make the define be chosen according to configure
 flags (--disable-gcc-atomics). Or maybe we should even use a configure
 check to detect real support for GCC atomics on the target platform.
 users-h...@tomcat.apache.org


I switched the logic to better suit my needs, but that works:

#elif !defined(JK_NO_GCC_ATOMICS)  defined(__GNUC__)  (__GNUC__  4 ||
(__GNUC__ == 4  __GNUC_MINOR__ = 1))


So on our 32bit systems jk is built with:
CFLAGS='-DJK_NO_GCC_ATOMICS' ./configure --with-apxs=/opt/apache/bin/apxs

It would be nice if something like that (preferably a configure option)
would be built in. It would of course be even better if configure could
detect if gcc atomics work and decide whether to use them or not. Anyways,
thank you for your quick and very helpful response.

Falco


Re: WebSocket asynchronous reads

2015-08-26 Thread Mark Thomas
On 26 August 2015 10:34:24 GMT-04:00, Steffen Heil (Mailinglisten) 
li...@steffen-heil.de wrote:
Hi

Is there a way to tell tomcat to stop receiving data for a certain
websocket?
(Not to close it, but not to read from inputstream for some time.)

Regards,
  Steffen

Sorry, no.

The best you can do is a no-op branch in the  message handler.

Mark


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



AW: WebSocket asynchronous reads

2015-08-26 Thread Steffen Heil (Mailinglisten)
Hi


 Is there a way to tell tomcat to stop receiving data for a certain
 websocket?
 (Not to close it, but not to read from inputstream for some time.)


 Sorry, no.
 The best you can do is a no-op branch in the  message handler.


Which means I have to either buffer all incoming messages until I am ready to 
process them (might occupy lots of memory) or I have to drop them.
Both is not really ideal.

I don’t know, if the websocket specification already defines something, but are 
there any plans to implement such a feature?
From my POV it would be rather easy not to unregister a certain connection in 
the read selector and reregister it later on.
However such an API would need to exposed somehow.


Regards,
   Steffen



smime.p7s
Description: S/MIME cryptographic signature


Re: AW: WebSocket asynchronous reads

2015-08-26 Thread Mark Thomas
On 26/08/2015 12:50, Steffen Heil (Mailinglisten) wrote:
 Hi
 
 
 Is there a way to tell tomcat to stop receiving data for a certain
 websocket?
 (Not to close it, but not to read from inputstream for some time.)
 
 
 Sorry, no.
 The best you can do is a no-op branch in the  message handler.
 
 
 Which means I have to either buffer all incoming messages until I am ready to 
 process them (might occupy lots of memory) or I have to drop them.
 Both is not really ideal.
 
 I don’t know, if the websocket specification already defines something, but 
 are there any plans to implement such a feature?

Nothing comes to mind. Sounds like what you really want is reactive streams.

 From my POV it would be rather easy not to unregister a certain connection in 
 the read selector and reregister it later on.
 However such an API would need to exposed somehow.

Yes, but such low level access doesn't seem right to me.

Mark


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



AW: AW: Asynchronous writes (Servlet and WebSocket)

2015-08-26 Thread Steffen Heil (Mailinglisten)
Hi


 The equivalent code for NIO is in
 org.apache.coyote.http11.InternalNioOutputBuffer

Thanks for the reference. I took a short look at it.
As soon as I have a little time left, I will analyze it in more depth, as I am 
very interested in NIO...
For now the assertion that write are indeed asynchronous is enough for me.


 No. It is too invasive to back port to the stable 8.0.x and it also requires 
 removing support for BIO and comet which we don't want to
 do in 8.0.x.

Will this be rather a 8.1.x (mid term) or 9.0.x (long term) change?
Is the code in trunk considered stable?


 8.0.x releases are on a roughly monthly cycle. The most recent (8.0.26) was 
 announced today.

Thanks for the hint, I missed that one.


Regards,
  Steffen



smime.p7s
Description: S/MIME cryptographic signature


AW: Exception using Async Servlet

2015-08-26 Thread Steffen Heil (Mailinglisten)
Hi


 Make sure you are using the latest 8.0.26 release. There have been some fixes 
 around async dispatch. If you still see the issue then
 we'll need a test case (as simple as possible) that reproduces the issue for 
 us to investigate.

I just upgraded to 8.0.26. But I see the same exception again:

Aug 26, 2015 9:42:41 AM org.apache.catalina.connector.CoyoteAdapter 
asyncDispatch
SCHWERWIEGEND: Exception while processing an asynchronous request
java.lang.IllegalStateException: Calling [asyncError()] is not valid for a 
request with Async state [MUST_COMPLETE]
at 
org.apache.coyote.AsyncStateMachine.asyncError(AsyncStateMachine.java:351)
at 
org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:820)
at org.apache.coyote.Request.action(Request.java:378)
at 
org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:419)
at 
org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:332)
at 
org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1709)
at 
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:649)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
at 
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at 
org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)


I *think* this happens in the following case:

1. A client opens an html file using https that gets dispatched to an Async 
servlet.

2. The servlet calls startAsync, registers read/write/context handlers:
AsyncContext context = request.startAsync();
context.setTimeout( 0 );
ServletInputStream input = request.getInputStream();
ServletOutputStream output = response.getOutputStream();
ChannelProcessor processor = new ChannelProcessor( ... );
context.addListener( processor );
input.setReadListener( processor );
output.setWriteListener( processor );

3. The server writes some data to output.
4. As the client is not sending data, onAllDataRead is called and the 
reference to input is dropped.
5. onWritePossible is called, but there is no more data to send for now.
6. The client window is closed. (BTW: The servlet is not notified about that at 
all.)
7. Later, an server event occurs and the server writes to output again (after 
checking isReady).

I think this is the point, the exception is logged.


I will try to create a testcase, but stripping down that code is far from easy 
as it is in the middle of a framework.


I would also like to increase logging in tomcat, but I could not find out, how 
to do so.
My current logging.properties consists of the following only:


handlers = java.util.logging.ConsoleHandler
.handlers = java.util.logging.ConsoleHandler

.level = TRACE
org.apache.level = TRACE


I suspect that should set any logger to TRACE, but only a few lines are 
logged...


Regards,
  Steffen



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat 7 - Organizing web applications into sub directories

2015-08-26 Thread Mark Thomas
On 26 August 2015 05:06:08 BST, Srikanth Challa srika...@enterpriseatlas.com 
wrote:
I am trying to organize my applications (multiple) into a specific
hierarchy under the webapps folder.
Something like this -
webapps
 dev
  app1
  app2
 test
  app1
  app3

When deploying (without WAR), I am getting a 404 error for servlets.
Tried
changing the web.xml servlet mapping, still no luck. It works perfectly
when the folder is moved directly under webapps like below -
webapps
 app1

Does tomcat have a limitation on organizing webapps under multiple
levels
of folders (under the webapp directory)?

Yes. Both WARs and directories must be placed directly in the appBase. You can 
use any organisation you like if you store them outside the appBase.

Mark



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



RE: [ANN] Apache Tomcat Connectors 1.2.41 released

2015-08-26 Thread Alten, Jessica-Aileen
 @Jessica: which CPU architecture are you using: x86 (32 Bit), x64 (64
 Bits) or even Itanium 64? Which OS version do you have? If you are
 willing to test, I can provide an example binary from which we might
 learn, how well it works and whether that type of build is suitable for
 others as well.

Windows Server 2008R2 (productive/staging), x64 architecture.

Installing different redistributables (vcredist.exe) is in fact really common 
under Windows. Some installations require lots of redistributables (x86 and/or 
x64) on the same server.

Your link is for the x86 version, the x64 architecture redistributable is
http://www.microsoft.com/en-us/download/details.aspx?id=14632.

Greetings,
Jessica



Re: AW: Asynchronous writes (Servlet and WebSocket)

2015-08-26 Thread Mark Thomas
On 26 August 2015 08:30:38 BST, Steffen Heil (Mailinglisten) 
li...@steffen-heil.de wrote:

 No. It is too invasive to back port to the stable 8.0.x and it also
requires removing support for BIO and comet which we don't want to
 do in 8.0.x.

Will this be rather a 8.1.x (mid term) or 9.0.x (long term) change?

It will be in 9.0.x. It is TBD if there will be a 8.1.x branch. We don't often 
do it. The possibility has been raised but no plans to do it at the moment.

Is the code in trunk considered stable?

Yes, excluding the HTTP/2 which a) is still in development and b) I know I can 
easily crash.

Cheers,

Mark


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



Re: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat servers/clusters?

2015-08-26 Thread Prarthana Agwania
Chuck,

Apologies for the confusion. Let me rephrase it,

Currently, we have multiple Tomcat nodes running on a single or on
different physical machines with each having its own object pool
(consider we have a pool of java String object but not connection
pool) i.e., an object pool per node. The requirement is to share this
pool of objects across Tomcat nodes.

Is there any such implementation that we can readily use to achieve this?

Thanks,
Prarthana

On Tue, Aug 25, 2015 at 6:10 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:
 From: Prarthana Agwania [mailto:prarthana.agwa...@gmail.com]
 Subject: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat 
 servers/clusters?

 Currently in our project, we have multiple Tomcat servers running on a
 single physical server each having its own connection pool. We have a
 requirement where in, we could have a shared connection pool across
 multiple Tomcat servers.

 Whoever came up with that requirement is seriously confused.  Underlying 
 every database connection is a TCP/IP connection, which by definition, is 
 point-to-point.  There is no possible way for a single TCP/IP connection to 
 be usable other than by the two end points (discounting MITM hacks).

 At best, you could invent a proxy machine which would connect to the DB 
 server, and each Tomcat server could connect to the proxy.  The added 
 complication, performance impact, and overall cost make this a completely 
 nonsensical thing to do.

  - Chuck


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




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


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



Re: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat servers/clusters?

2015-08-26 Thread André Warnier

On 26.08.2015 12:36, Prarthana Agwania wrote:

Chuck,

Apologies for the confusion. Let me rephrase it,

Currently, we have multiple Tomcat nodes running on a single or on
different physical machines with each having its own object pool
(consider we have a pool of java String object but not connection
pool) i.e., an object pool per node. The requirement is to share this
pool of objects across Tomcat nodes.

Is there any such implementation that we can readily use to achieve this?


Maybe you should look at something like this :
https://code.google.com/p/memcached/wiki/Clients




Thanks,
Prarthana

On Tue, Aug 25, 2015 at 6:10 PM, Caldarale, Charles R
chuck.caldar...@unisys.com wrote:

From: Prarthana Agwania [mailto:prarthana.agwa...@gmail.com]
Subject: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat 
servers/clusters?



Currently in our project, we have multiple Tomcat servers running on a
single physical server each having its own connection pool. We have a
requirement where in, we could have a shared connection pool across
multiple Tomcat servers.


Whoever came up with that requirement is seriously confused.  Underlying every 
database connection is a TCP/IP connection, which by definition, is 
point-to-point.  There is no possible way for a single TCP/IP connection to be 
usable other than by the two end points (discounting MITM hacks).

At best, you could invent a proxy machine which would connect to the DB server, 
and each Tomcat server could connect to the proxy.  The added complication, 
performance impact, and overall cost make this a completely nonsensical thing 
to do.

  - 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





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



Re: Exception using Async Servlet

2015-08-26 Thread Sean Dawson
On Wed, Aug 26, 2015 at 8:13 AM, Steffen Heil (Mailinglisten) 
li...@steffen-heil.de wrote:

 Hi


 Doing a lot of additional testing, I found the reason for the exception.
 In the WriteListener.onError(Throwable) handler, we released all our
 resources using a central function that included calling
 context.complete().

 It seems like tomcat does not like that call.
 However there are only two cases:

 1. That call is NOT allowed in onError, then it should throw an exception
 right away.
 2. That call IS allowed in onError, then it should not leave some internal
 inconsistency (as the later exception implies).

 BTW:
 1. Calling context.complete() in AsyncListener.onError(AsyncEvent)
 seems not to be a problem.
 2. The exception also prevents a call to
 AsyncListener.onError(AsyncEvent), so a WriteListener can hide the end of
 the connection completely from the AsyncListener. However to my understand
 those should be to separate state machines...


 Doing these tests, I recognized I did a lot of guessing about the
 interactions between the 3 different callbacks.
 Is there any documentation on how they interact?


I'd love to know this too...

http://stackoverflow.com/questions/29135237/asynccontext-timeouts-and-retries



 Regards,
   Steffen



  -Ursprüngliche Nachricht-
  Von: Steffen Heil (Mailinglisten) [mailto:li...@steffen-heil.de]
  Gesendet: Mittwoch, 26. August 2015 10:04
  An: Tomcat Users List users@tomcat.apache.org
  Betreff: AW: Exception using Async Servlet
 
  Hi
 
 
   Make sure you are using the latest 8.0.26 release. There have been
 some fixes around async dispatch. If you still see the issue then
   we'll need a test case (as simple as possible) that reproduces the
 issue for us to investigate.
 
  I just upgraded to 8.0.26. But I see the same exception again:
 
  Aug 26, 2015 9:42:41 AM org.apache.catalina.connector.CoyoteAdapter
 asyncDispatch
  SCHWERWIEGEND: Exception while processing an asynchronous request
  java.lang.IllegalStateException: Calling [asyncError()] is not valid for
 a request with Async state [MUST_COMPLETE]
at
 org.apache.coyote.AsyncStateMachine.asyncError(AsyncStateMachine.java:351)
at
 org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:820)
at org.apache.coyote.Request.action(Request.java:378)
at
 org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:419)
at
 org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:332)
at
 org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1709)
at
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:649)
at
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
at
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
at
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)
 
 
  I *think* this happens in the following case:
 
  1. A client opens an html file using https that gets dispatched to an
 Async servlet.
 
  2. The servlet calls startAsync, registers read/write/context handlers:
AsyncContext context = request.startAsync();
context.setTimeout( 0 );
ServletInputStream input = request.getInputStream();
ServletOutputStream output = response.getOutputStream();
ChannelProcessor processor = new ChannelProcessor( ... );
context.addListener( processor );
input.setReadListener( processor );
output.setWriteListener( processor );
 
  3. The server writes some data to output.
  4. As the client is not sending data, onAllDataRead is called and the
 reference to input is dropped.
  5. onWritePossible is called, but there is no more data to send for
 now.
  6. The client window is closed. (BTW: The servlet is not notified about
 that at all.)
  7. Later, an server event occurs and the server writes to output again
 (after checking isReady).
 
  I think this is the point, the exception is logged.
 
 
  I will try to create a testcase, but stripping down that code is far
 from easy as it is in the middle of a framework.
 
 
  I would also like to increase logging in tomcat, but I could not find
 out, how to do so.
  My current logging.properties consists of the following only:
 
 
  handlers = java.util.logging.ConsoleHandler
  .handlers = java.util.logging.ConsoleHandler
 
  .level = TRACE
  org.apache.level = TRACE
 
 
  I suspect that should set any logger to TRACE, but only a few lines are
 logged...
 
 
  Regards,
Steffen




[ANN] Apache Tomcat 7.0.64 released

2015-08-26 Thread Violeta Georgieva
The Apache Tomcat team announces the immediate availability of Apache
Tomcat 7.0.64.

Apache Tomcat is an open source software implementation of the Java
Servlet, JavaServer Pages, Java Expression Language and Java
WebSocket technologies.

This release contains a number of bug fixes and improvements compared to
version 7.0.63. The notable changes since 7.0.63 include:


- Avoid an NPE when adding POJO WebSocket endpoints programmatically
- Improved handling of async timeouts
- Facilitate weaving by allowing ClassFileTransformer to be added to
  WebappClassLoader


Please refer to the change log for the complete list of changes:
http://tomcat.apache.org/tomcat-7.0-doc/changelog.html

Note: This version has 4 zip binaries: a generic one and
  three bundled with Tomcat native binaries for Windows operating
  systems running on different CPU architectures.

Note: Use of the Java WebSocket 1.1 implementation requires Java 7.

Note: If you use the APR/native AJP or HTTP connector you *must* upgrade
  to version 1.1.33 or later of the APR/native library.

Downloads:
http://tomcat.apache.org/download-70.cgi

Migration guides from Apache Tomcat 5.5.x and 6.0.x:
http://tomcat.apache.org/migration.html

Enjoy

The Apache Tomcat team


AW: Exception using Async Servlet

2015-08-26 Thread Steffen Heil (Mailinglisten)
Hi


Doing a lot of additional testing, I found the reason for the exception.
In the WriteListener.onError(Throwable) handler, we released all our 
resources using a central function that included calling context.complete().

It seems like tomcat does not like that call.
However there are only two cases:

1. That call is NOT allowed in onError, then it should throw an exception right 
away.
2. That call IS allowed in onError, then it should not leave some internal 
inconsistency (as the later exception implies).

BTW: 
1. Calling context.complete() in AsyncListener.onError(AsyncEvent) seems 
not to be a problem.
2. The exception also prevents a call to AsyncListener.onError(AsyncEvent), 
so a WriteListener can hide the end of the connection completely from the 
AsyncListener. However to my understand those should be to separate state 
machines...


Doing these tests, I recognized I did a lot of guessing about the interactions 
between the 3 different callbacks.
Is there any documentation on how they interact?


Regards,
  Steffen



 -Ursprüngliche Nachricht-
 Von: Steffen Heil (Mailinglisten) [mailto:li...@steffen-heil.de]
 Gesendet: Mittwoch, 26. August 2015 10:04
 An: Tomcat Users List users@tomcat.apache.org
 Betreff: AW: Exception using Async Servlet
 
 Hi
 
 
  Make sure you are using the latest 8.0.26 release. There have been some 
  fixes around async dispatch. If you still see the issue then
  we'll need a test case (as simple as possible) that reproduces the issue 
  for us to investigate.
 
 I just upgraded to 8.0.26. But I see the same exception again:
 
 Aug 26, 2015 9:42:41 AM org.apache.catalina.connector.CoyoteAdapter 
 asyncDispatch
 SCHWERWIEGEND: Exception while processing an asynchronous request
 java.lang.IllegalStateException: Calling [asyncError()] is not valid for a 
 request with Async state [MUST_COMPLETE]
   at 
 org.apache.coyote.AsyncStateMachine.asyncError(AsyncStateMachine.java:351)
   at 
 org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:820)
   at org.apache.coyote.Request.action(Request.java:378)
   at 
 org.apache.catalina.core.AsyncContextImpl.setErrorState(AsyncContextImpl.java:419)
   at 
 org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:332)
   at 
 org.apache.coyote.http11.AbstractHttp11Processor.asyncDispatch(AbstractHttp11Processor.java:1709)
   at 
 org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:649)
   at 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
   at 
 org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
   at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
   at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
   at 
 org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
   at java.lang.Thread.run(Thread.java:745)
 
 
 I *think* this happens in the following case:
 
 1. A client opens an html file using https that gets dispatched to an Async 
 servlet.
 
 2. The servlet calls startAsync, registers read/write/context handlers:
   AsyncContext context = request.startAsync();
   context.setTimeout( 0 );
   ServletInputStream input = request.getInputStream();
   ServletOutputStream output = response.getOutputStream();
   ChannelProcessor processor = new ChannelProcessor( ... );
   context.addListener( processor );
   input.setReadListener( processor );
   output.setWriteListener( processor );
 
 3. The server writes some data to output.
 4. As the client is not sending data, onAllDataRead is called and the 
 reference to input is dropped.
 5. onWritePossible is called, but there is no more data to send for now.
 6. The client window is closed. (BTW: The servlet is not notified about that 
 at all.)
 7. Later, an server event occurs and the server writes to output again 
 (after checking isReady).
 
 I think this is the point, the exception is logged.
 
 
 I will try to create a testcase, but stripping down that code is far from 
 easy as it is in the middle of a framework.
 
 
 I would also like to increase logging in tomcat, but I could not find out, 
 how to do so.
 My current logging.properties consists of the following only:
 
 
 handlers = java.util.logging.ConsoleHandler
 .handlers = java.util.logging.ConsoleHandler
 
 .level = TRACE
 org.apache.level = TRACE
 
 
 I suspect that should set any logger to TRACE, but only a few lines are 
 logged...
 
 
 Regards,
   Steffen



smime.p7s
Description: S/MIME cryptographic signature


Re: Tomcat 7 - Organizing web applications into sub directories

2015-08-26 Thread André Warnier

On 26.08.2015 06:06, Srikanth Challa wrote:

I am trying to organize my applications (multiple) into a specific
hierarchy under the webapps folder.
Something like this -
webapps
  dev
   app1
   app2
  test
   app1
   app3

When deploying (without WAR), I am getting a 404 error for servlets. Tried
changing the web.xml servlet mapping, still no luck. It works perfectly
when the folder is moved directly under webapps like below -
webapps
  app1

Does tomcat have a limitation on organizing webapps under multiple levels
of folders (under the webapp directory)?



Hi.
Without getting too technical :
It is not a limitation of Tomcat.  There /are/ ways of doing what you indicate above.  But 
the problem is that if you do that, you are going against the natural way in which URLs 
are mapped to web-applications, and that will force you further down the line, to do ever 
more complicated things to keep this working correctly (for example, if you want to easily 
move an application between the dev and the test areas above).


To map URLs to web-applications, Tomcat is following the basic principles outlined in the 
Servlet Specification 3.0, for example this :


-- quote --
10.5 Directory Structure
A Web application exists as a structured hierarchy of directories. The root of 
this
hierarchy serves as the document root for files that are part of the 
application. For
example, for a Web application with the context path /catalog in a Web 
container,
the index.html file at the base of the Web application hierarchy or in a JAR 
file
inside WEB-INF/lib that includes the index.html under META-INF/resources
directory can be served to satisfy a request from /catalog/index.html.
-- unquote --

(re: http://tomcat.apache.org/tomcat-8.0-doc/appdev/deployment.html)

For Tomcat, the root for all the applications within a specified Host, is the 
directory which is indicated by the appBase attribute of the corresponding Host tag.

Like this :
  Host name=localhost  appBase=(/somepath/)webapps
unpackWARs=true autoDeploy=true

and then under (/somepath/)webapps/ you would have something like this :

(/somepath/)webapps/
   app1
 app1-sub1
 app1-sub2
   app2
 app2-sub1
 app2-sub2
etc..

This makes it clear to Tomcat that app1 and app2 are the distinct web-applications 
(also known as context), corresponding respectively to URLs such as :

  http://yourhost:port/app1
  http://yourhost:port/app2
and that the subdirectories app1-sub1, app1-sub2 etc.. are internal sub-divisions of 
these app1 and app2 web-applications, helping to map longer URLs to things inside 
these application (such as servlets, JSP pages, HTML pages etc.) (these further 
sub-mappings being described in the web.xml file of each web-application).


If you want to go against this natural interpretation of the directory structure by 
Tomcat, then you have to start telling Tomcat (in various places), that app1/app1-sub1 
is one application, and app1/app1-sub2 is a different application etc.., which 
complicates things for you (for example, you'd have to name a WAR file like 
app1#app1-sub1.war). (And also, since it is not the natural way, it will confuse 
orther people).


A more practical way of achieving what you want, would probably be to define 2 distinct 
Host's, like this (in server.xml) :


 Host name=mydevhost appBase=(/somepath/)webapps-dev
unpackWARs=true autoDeploy=true
...
/Host

 Host name=mytesthost appBase=(/somepath/)webapps-test
unpackWARs=true autoDeploy=true
...
/Host

(and of course, both mydevhost and mytesthost map to the same IP address 
(in DNS)).

and then have a directory structure like this :

webapps-dev/
   app1
   app2

webapps-test/
   app1
   app2
   app3

corresponding to URLs like :
 http://mydevhost:port/app1  (maps to /somepath/webapps-dev/app1)
 http://mytesthost:port/app1 (maps to /somepath/webapps-test/app1)
 etc..

This way, the internal configuration and content of app1 can be exactly the same for 
dev and test, and you can move an application between the 2 Hosts (or anywhwere else, 
such as to another machine) without having to make any change at all inside the 
application or its configuration.




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



WebSocket asynchronous reads

2015-08-26 Thread Steffen Heil (Mailinglisten)
Hi

Is there a way to tell tomcat to stop receiving data for a certain websocket?
(Not to close it, but not to read from inputstream for some time.)

Regards,
  Steffen



smime.p7s
Description: S/MIME cryptographic signature


RE: [ANN] Apache Tomcat 7.0.64 released

2015-08-26 Thread RAY, DAVID
Just FYI:  I'm getting invalid signature on Apache-tomcat-7.0.64.tar.gz when I 
download from http://apache.mirrors.hoobly.com/

Signed with unknown certificate 0x208B0AB1D63011C7.
The signature is bad.

Sooo, tried again and downloaded from http://www.us.apache.org/dist/   
Valid signature this time. 

I guess it could be a problem on my end with my keys or whatever.  But whatever 
the case is, I don't have any problems with the signature when downloading from 
http://www.us.apache.org/dist/
 

David Ray
System Administrator | Technical Operations
Tarrant County College District | Office: OWTL 3300.B28
2301 Horizon Dr. | Fort Worth, TX 76177
817-515-1843 | Fax 817-515-0812
david@tccd.edu | www.tccd.edu



Re: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat servers/clusters?

2015-08-26 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Prarthana,

On 8/26/15 6:36 AM, Prarthana Agwania wrote:
 Currently, we have multiple Tomcat nodes running on a single or on 
 different physical machines with each having its own object pool 
 (consider we have a pool of java String object but not connection 
 pool) i.e., an object pool per node. The requirement is to share
 this pool of objects across Tomcat nodes.
 
 Is there any such implementation that we can readily use to achieve
 this?

I brought this up at ApacheCon 2015 in Austin, TX and Mark Thomas said
that Tomcat's Tribes component was built for just such a purpose.

I have no idea how to deploy Tribes using your own code, I've never
looked-into the API or anything else, but you could have a look at
what's there.

(In my case, I wanted to build a service that was nothing but a simple
clustered name/value store. Note that memcached, as André suggested,
when clustered actually divides the data into chunks without repeats
on other member clusters. I wanted something with different semantics
- -- specifically, that every node had a copy of every key/value pair,
and that featured eventual-consistency. I don't need something as
heavy as Voldemort or Cassandra - I don't need durability - so I was
looking for something more basic.)

If you want, check out Voldemort or Aerospike, or even Tribes. But no,
no component in Tomcat is going to do this for you (other than Tribes,
which you will largely have to figure out for yourself).

- -chris
-BEGIN PGP SIGNATURE-
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJV3bi1AAoJEBzwKT+lPKRYFfwP/0P0aE0qWOqLayJVT9MPZXRi
9liVmobPezCC6Ahp3tNc3libJvhuxwDXgdSVGyEa25jMjspdwjY8R60ztiIX4H52
YGqy41HOBXdqJTUxcjPpF05IAEVZmkVJjFs6f0lbwQA0Q3MPgOvnLAOGy+eob7zZ
76lmxIDoPgwrSm+WQGsSEmV9oqG2QEtfolMnuSDFqJFAtcnxTV2ewueTftNZVi7+
IT9bF7afpIJZTMTxpP8jj9QC6LXRz7cToai+S1D+NOJqkJTGWegI2eOWTSpg2Wlf
dOQsZk2DewAQDyWyzFcsFwqFSqi72TLymtnYD0Z49lm0Ynjjeq4PqU+JS/v4mRs/
oV+7CzrkUFLEs4RASkesxyXhCkRf3X33aG37Q+g+0tsVquoRxB/pnhqIP1819/6G
dBGKF42BQzF5V+fiHtbkPS0+uJyTDSSeCaLGOAXyCbrR961bdeikV/xQI34alyWi
ikUcI2IWMVxhX0oq2otzCCU22DQR6eI3W6vXZnzRvk67UK5flAM2birKTapC4R8v
n6JcEh8I5//jkjWUfphJMr1InEjswFNYQj0PV9/BFVh4LJ1kGMRbSVNM1rsydesZ
Pddfyf24jd6Jy2mktS6rxNTe/krl69nSD5b24sjO9PjDeNTfqiG5J3mV/WTa+ZXt
4loPyCiKQ1QhWX6e5VzY
=fEMG
-END PGP SIGNATURE-

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



RE: Tomcat 8.0.23, Apache Commons 2.2: Object pool shared across Tomcat servers/clusters?

2015-08-26 Thread Alten, Jessica-Aileen
 Currently, we have multiple Tomcat nodes running on a single or on
 different physical machines with each having its own object pool
 (consider we have a pool of java String object but not connection
 pool) i.e., an object pool per node. The requirement is to share this
 pool of objects across Tomcat nodes.

 Is there any such implementation that we can readily use to achieve
 this?

Another solution is the Infinispan data grid http://infinispan.org . It is 
released under the Apache 2.0 open source license. I'm integrating it into my 
application at the moment. I have the same requirements that you have. The 
documentation and the examples are extraordinary good, perhaps a little bit 
overwhelming.

Greetings,
Jessica

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