-
1. Re: StreamHandler index out of bounds
mazz Jun 19, 2006 10:37 PM (in response to mazz)Forgot some other things.
First, I can see data in the stream - in the debugger, I see the full data get copied via arraycopy() when I put a breakpoint on that line. Its only when I reach the end of the stream do I then get this exception. So, I can see something looping on the read() - the first time through its OK, the second time into this read() method fails since the stream has reached EOF.
Second, my testing is a bit unusual - my client and server are both running in the same VM. I don't know if that matters, but I mention it just in case. -
2. Re: StreamHandler index out of bounds
tom.elrod Jun 20, 2006 1:22 AM (in response to mazz)Don't guess you have a test case for this? Even just the code in the handler will do (need to see how you are using the StreamHandler). Also, did you try using the server invoker handler code directly on the original stream (bypassing remoting)? Just curious how it behaves in that case.
http://jira.jboss.com/jira/browse/JBREM-506 -
3. Re: StreamHandler index out of bounds
mazz Jun 20, 2006 8:50 AM (in response to mazz)No test case that you can use directly.
Also I'm not using StreamHandler directly. I am creating my own InputStream (a ByteArrayInputStream to be exact), passing it to Client.invoke(InputStream, Object), which in turn makes it way to the handler on the server side. I then have my handler read the stream like any normal stream which is when I get this exception.
On the handler side, I just operate on an "InputStream" (which is implicitly a StreamHandler I believe - I'm just working on the input stream given to StreamInvocationHandler.handleStream(InputStream, InvocationRequest).
Here's psuedo-code of my test on the client side:String stream_data = "Stream this string!!!"; InputStream in = new ByteArrayInputStream( stream_data.getBytes() ); results = getJBossRemotingClient().invoke( in, myParam);
and on the server side:public handleStream(InputStream in, InvocationRequest req) { byte[] stream_data = readEntireStream(in); }
-
4. Re: StreamHandler index out of bounds
mazz Jun 20, 2006 10:57 AM (in response to mazz)See the JIRA issue for the fix. I changed it such that the arraycopy() call is not made if the retByte is not greater than 0. That fixes me and I work successfully now.