How to cancel upload?

2011-08-19 Thread Steffen Heil (Mailinglisten)
Hi Short question: How can I prevent tomcat to receive the complete post data? Long question: I have a servlet that uses apache commons fileupload to process incoming uploads using the streaming api. Short version of the code: InputStream inputStream; try { ServletFileUpload upload =

AW: How to cancel upload?

2011-08-21 Thread Steffen Heil (Mailinglisten)
Hi Short question: How can I prevent tomcat to receive the complete post data? Stop sending the data before it's all been sent. Sorry, I don't understand what you mean. If you mean to send only small parts and only those that are wanted, that's nothing I can do. I need to support the

AW: AW: How to cancel upload?

2011-08-21 Thread Steffen Heil (Mailinglisten)
Hi Actually, I'm not entirely correct and I am now remembering this has been discussed before on either this list or the tomcat-dev list. Do you remember anything else about that thread? Something that might help me find it... ? Are you throwing an exception, or closing the inputstream? I

WebSockets and HTTPS problems

2012-10-10 Thread Steffen Heil (Mailinglisten)
Hi We have a web application that makes more and more use of websockets. (In fact we emulate websockets with comet servlets for older browsers and want to use real websockets for current ones.) We implemented our websocket support using tomcat 7.0.30 and a servlet extending

AW: WebSockets and HTTPS problems

2012-10-10 Thread Steffen Heil (Mailinglisten)
Hi Check to see if the WebSocket examples that ship with Tomcat work with your configuration. If they don't compare the differences between the default configuration and you configuration to and find the change that breaks stuff. First, thanks for the reply. I downloaded tomcat 7.0.32

AW: AW: WebSockets and HTTPS problems

2012-10-10 Thread Steffen Heil (Mailinglisten)
Hi I just took a look at this. The examples work out of the box for HTTPS with BIO but not with NIO. This looks like a Tomcat bug at this point. I'll take a look. What would I need to do to switch to BIO for now? And does Comet work with BIO? Regards, Steffen smime.p7s Description:

Sending through WebSockets

2012-10-10 Thread Steffen Heil (Mailinglisten)
Hi I have a server with several websocket connections. (Or at least I will have at some time, see thread about ssl problems...) Now just as in the chat example, I need to send some data from time to time so some (but not neccessarily all) of those connections. Now, what happens if one of the

AW: AW: AW: WebSockets and HTTPS problems

2012-10-11 Thread Steffen Heil (Mailinglisten)
Hi See if this fixes if for you: http://people.apache.org/~markt/dev/tomcat-7/v7.0.33-r1397089/apache- tomcat-7.0.33-r1397089.tar.gz Preliminary tests look promising. Everything worked (using a few single click tests so far). Thanks! This is not an official release. Use it at your own

AW: Accidentally remove catalina.out file

2012-11-29 Thread Steffen Heil (Mailinglisten)
Hi What should happen when catalina.out is deleted? Please, I need to resolve this question. So far as I know it's just a logfile and all that happens is that you lost the log output. The file should be created on the next start of the server. Even when the server is running and the

NullPointerException in NioBlockingSelector - not a problem though

2012-12-12 Thread Steffen Heil (Mailinglisten)
Hi I cannot reproduce it, but I've seen the following error in my logs a few times now: SEVERE: Error reading request, ignored java.lang.NullPointerException at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java :193) at

Configure connectors while running tomcat from webapp

2013-01-22 Thread Steffen Heil (Mailinglisten)
Hi Currently I need to find a way to replace the ssl certificate used by a (nio) connector at runtime. It also needs to be done by the (only) webapp. Is there a way to do this? Soon we will need a way to change the ip address a connector is listening on. Both could be solved by removing a

Connector with wrong protocol

2013-02-24 Thread Steffen Heil (Mailinglisten)
Hi I need to start and stop a connector inside a servlet. That works with the following code: final org.apache.catalina.connector.Connector nioConnector = new org.apache.catalina.connector.Connector( org.apache.coyote.http11.Http11NioProtocol );

How to do a clean connector shut down?

2013-02-24 Thread Steffen Heil (Mailinglisten)
Sorry, I already posted this question with the wrong subject. (I started the mail earlier, when I had another problem...) Hi I need to start and stop a connector inside a servlet. That works with the following code: final

Small bug in Tomcat and interest in wildcard patch

2013-03-02 Thread Steffen Heil (Mailinglisten)
Hi I looked into the source of tomcat 7 (7.0.x trunk) to extend it to support wildcard aliases (such as *.example.com). I found the class org.apache.tomcat.util.http.mapper.Mapper. Looking at it, I found a small bug (lines 210-213): if (pos 0) { log.error(No host found: +

AW: Adding Connectors

2013-03-21 Thread Steffen Heil (Mailinglisten)
Hi I think this should be discussed on the users' list. I'm cross-posting this message one time for that purpose. See below. Sorry, as I assumed that in a state where tomcat does not start connectors defined in server.xml it should also not start other connectors, I regarded this as a bug.

Choosing provider to load pkcs12 keystore for ssl

2014-06-14 Thread Steffen Heil (Mailinglisten)
Hi I am using tomcat with the NIO connector, so I load the ssl certificate and private key from a keystore in pkcs12 format. This works fine using RSA. Now I want to switch to a certificate using ECC and that EC is not supported by the JRE. It IS however supported by bouncycastle. In my own

AW: Choosing provider to load pkcs12 keystore for ssl

2014-06-16 Thread Steffen Heil (Mailinglisten)
Hi Okay, I must have overlooked the keystoreProvider attribute completely. Sorry for that and thanks a lot for the hint. However that only solved the loading part of the problem. The certificate is still unusable. When I try to connect, the browser reports an error. I set javax.net.debug=all

Forcing SSL Renotiation

2015-06-26 Thread Steffen Heil (Mailinglisten)
Hi My tomcat installation offers pages through https only. So when accessing these pages, an ssl connection is established. Later on, a user may decide to log in, hence hitting a page, that requires client certificates, and the browser pops up a selection dialog for a certificate. Once

How to configure a TrustManager in code?

2015-05-26 Thread Steffen Heil (Mailinglisten)
Hi I am creating several components for my web application in java code instead of the xml files. For this I am using a privileged servlet that (besides other things) creates a Connector and a Realm. That's working fine. As I can do context.setRealm(...) I can use a Realm that is loaded in

URI Templates

2015-08-20 Thread Steffen Heil (Mailinglisten)
Hi I have several servlets with mappings such as /a/* /b/* /c/* And so on. One of these mappings was for the old Tomcat 7.0.27 websocket implementation: /ws/* That worked. Now, with the new JSR version in Tomcat 8, I cannot get this to work. The problem is, that all of the following

Connection resets without timeout

2015-08-25 Thread Steffen Heil (Mailinglisten)
Hi When using async servlets with timeout set to 0, tomcat seems not to detect, if the client closes the connection. At least the servlet listener is not notified. I expected AsyncListener.onComplete or AsyncListener.onError or AsyncListener.onTimeout, but none of these are called. The only

Exception using Async Servlet

2015-08-25 Thread Steffen Heil (Mailinglisten)
Hi I am using servlets with startAsync to be able to read and write asynchronously. However from time to time the following is logged: Aug 25, 2015 5:52:32 PM org.apache.catalina.connector.CoyoteAdapter asyncDispatch SCHWERWIEGEND: Exception while processing an asynchronous request

AW: Asynchronous writes (Servlet and WebSocket)

2015-08-25 Thread Steffen Heil (Mailinglisten)
Hi Thanks for assuring me, that it really is asynchronous. That was a blocker for us. archive? I'm guessing you mean achieve. Yes, I did. Sorry, not a native English speaker... No, it will buffer it all in the SocketWrapper. You won't get another notification until the buffered data

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

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

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

AW: Exception using Async Servlet

2015-08-26 Thread Steffen Heil (Mailinglisten)
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

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

AW: Connection resets without timeout

2015-08-27 Thread Steffen Heil (Mailinglisten)
terminator) or by closing the connection (inbound only) after the data. However, even if the inbound connection is closed, the response should still be sent to the client, so in that case the client even expects some answer after he sent FIN... -Ursprüngliche Nachricht- Von: Steffen Heil

AW: AW: WebSocket asynchronous reads

2015-09-06 Thread Steffen Heil (Mailinglisten)
Hi > > 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'm largely ignorant of the asynchronous world, but I do have a question > about what you're asking. Are

Asynchronous writes (Servlet and WebSocket)

2015-08-25 Thread Steffen Heil (Mailinglisten)
Hi I am investigating, how I can archive asynchronous writes with tomcat. For servlets I came up with code like this: final AsyncContext context = request.startAsync(); final ServletInputStream input = request.getInputStream(); final ServletOutputStream output =

AW: AW: AW: How to cancel download on the server side

2016-06-03 Thread Steffen Heil (Mailinglisten)
Hi > throw new ServletException(); That was the difference. I threw a IllegalStateException(), so tomcat sent "0\r\n". I changed my code to throw a ServletException() and now it works. Thanks for that. One very little thing left: Is there a way to suppress the logged exception: Jun 03, 2016

AW: AW: AW: AW: How to cancel download on the server side

2016-06-06 Thread Steffen Heil (Mailinglisten)
Hi > It is a dirty Tomcat specific trick that will only work as long as the code > is the way it is but if you throw a ClientAbortException wrapped > in a ServletException you shouldn't see that log message. Thanks a lot, this was just what I was looking for. Regards, Steffen

AW: AW: How to cancel download on the server side

2016-06-03 Thread Steffen Heil (Mailinglisten)
Hi > > Yes, we thought about that. However it still leaves the problem of a > > lot of storage on the server that is used for no reason and increasing > > the time to download the backup.. > So it's better to buffer the huge download in memory instead of on the disk? > Maybe I don't understand

AW: AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
> > That's another story. > > I tried that. And the internet explorer as well as curl report an error, if > > the download stops without the ending 0\r\n. > > > > But I had to set "Connection: close" and "Transfer-Encoding: chunked" > > myself and encode the chunk headers myself. > > If I leave

AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
Hi > We had a similar problem. We just added a "preparation" step before the > actual download. > > 1. User clicks on "request download" link 2. jQuery sends a request to > servlet and instructs it to prepare the download 3. Meanwhile > the request download link has been changed with

AW: How to cancel download on the server side

2016-06-01 Thread Steffen Heil (Mailinglisten)
Hi > I believe that, while the HTTP specification supports what you want to do, > neither servers nor clients support it. For example, you can > use "trailers" (headers end the end of the response) to tell the client what > happened, but I suspect that no client will actually read > them or

How to cancel download on the server side

2016-05-29 Thread Steffen Heil (Mailinglisten)
Hi I am streaming a huge file from a servlet to the browser. It can easily be multiple gigabytes. Currently the data is prepared on the server, stored in a file and then sent to the client with a "Content-Disposition: attachment" header, so the browser handles it as a download. After the

AW: Memory Leak

2016-06-29 Thread Steffen Heil (Mailinglisten)
Hi > > Here, the log. I am quite sure how to go about troubleshooting it. > > Any help is greatly appreciated. > The application has a memory leak. You need to get it fixed. > > catalina.out.prob:SEVERE: The web application [] appears to have > > started a thread named > >

AW: AW: java

2016-07-18 Thread Steffen Heil (Mailinglisten)
Hi > > I am not sure that this related, be we were having issues after > > updating from 1.8.0_31 to 1.8.0_72 with certificates signed by > > root-cas that have a md5 signature. While the CA signature in the CA > > certificate does not provide any security, a bug in the jre rejected > > the

AW: java

2016-07-18 Thread Steffen Heil (Mailinglisten)
Hi > With jdk 1.8.0.45 our ldap communication is giving results. As soon as we > change tomcat to use jdk1.8.0_51, I am getting below > exception. I am not sure security changes in jdk 1.8.0_51 preventing the ldap > certificate loaded in cacerts in java not communicating > properly to our ldap

SocketTimeoutException in CoyoteInputStream

2016-07-18 Thread Steffen Heil (Mailinglisten)
Hi I am getting the following exception: 2016-07-18 07:46:52.667 /http/httpmodule WARN null - error during upload | java.net.SocketTimeoutException | at org.apache.tomcat.util.net.NioBlockingSelector.read(NioBlockingSelector.java:202) | at

AW: SocketTimeoutException in CoyoteInputStream

2016-07-18 Thread Steffen Heil (Mailinglisten)
8.0.26 > -Ursprüngliche Nachricht- > Von: Mark Thomas [mailto:ma...@apache.org] > Gesendet: Montag, 18. Juli 2016 13:37 > An: Tomcat Users List <users@tomcat.apache.org> > Betreff: Re: SocketTimeoutException in CoyoteInputStream > > On 18 July 2016 1

NPE in tomcat because of WebSocket API and Lambdas

2016-06-27 Thread Steffen Heil (Mailinglisten)
Hi I just got the following NPE in tomcat: java.lang.NullPointerException at org.apache.tomcat.websocket.Util.getGenericType(Util.java:217) at org.apache.tomcat.websocket.Util.getMessageType(Util.java:171) at