Problem deploying to OAS10g

I have a problem deploying my application to Oracle OAS10g (

I use IT MILL Toolkit version 5.3.1, when i try to access the application i get this exception:

09/04/14 11:18:04 java.lang.IndexOutOfBoundsException: The supplied offset + length did not fit into the supplied byte[] (offset 
    + length = 0 + 65536 = 65536 vs byte[].length = 5) 
 09/04/14 11:18:04     at 
 09/04/14 11:18:04     at com.itmill.toolkit.terminal.gwt.server.CommunicationManager.handleVariables(
 09/04/14 11:18:04     at com.itmill.toolkit.terminal.gwt.server.CommunicationManager.handleUidlRequest(
 09/04/14 11:18:04     at com.itmill.toolkit.terminal.gwt.server.ApplicationServlet.service( 
 09/04/14 11:18:04     at javax.servlet.http.HttpServlet.service( 
 09/04/14 11:18:04     at com.evermind.server.http.ServletRequestDispatcher.invoke( 
 09/04/14 11:18:04     at com.evermind.server.http.ServletRequestDispatcher.forwardInternal( 
 09/04/14 11:18:04     at com.evermind.server.http.HttpRequestHandler.doProcessRequest( 
 09/04/14 11:18:04     at com.evermind.server.http.HttpRequestHandler.processRequest( 
 09/04/14 11:18:04     at 
 09/04/14 11:18:04     at 
 09/04/14 11:18:04     at$ 
 09/04/14 11:18:04     at com.evermind.util.ReleasableResourcePooledExecutor$
 09/04/14 11:18:04     at 

Can anybody help with this issue?

Thank you in advance.

Hmm… this is interesting.

This seems to be valid exception based in

code of CommunicationManager
indicates that this situation will arise if the content length is less than MAX_BUFFER_SIZE.

(The line numbers differ so much that I’m not sure about the versions here…)

But shouldn’t this be the case in most situations? Why are other server implementations working?

Seems to me that Oracle 10g reports the content length to be 5 (correct for the init request) but then provides an input stream which returns more than 5 bytes. Other servers return an input stream from which only 5 bytes can be read. Oracle bug?

I created a ticket for this at

What I meant with the weird part is that according to InputStream documentation for read-function says that:

And the,off,len) is invoked like this:

612	            byte[] buffer = new byte[request.getContentLength()]
613	            ServletInputStream inputStream = request.getInputStream();
614	            int totalBytesRead = 0;
615	            int bytesRead;
616	            while ((bytesRead =, totalBytesRead,
617	                    MAX_BUFFER_SIZE)) != -1) {
618	                totalBytesRead += bytesRead;
619	            }

Doesn’t this say that if MAX_BUFFER_SIZE is greater than request.getContentLength(), the off+len is also always greater than buffer.length? This should not work at all… or what am I missing here?

I added a fix for this issue which should be more compatible with the specs. I guess the reason it works in other servlet containers is that the specs are not interpreted that strictly i.e. no exception is only thrown if off+len > b.length() AND off+bytes available to read > b.length() .

Great! I assumed that this was the case. The EvermindServletInputStream is just a little different from other ServletInputStream implementations.

Fulvio, please try and see if it works better for you.

Yes, that works fine for me!!!

Thank you so much!!