Return-Path: list-help: list-unsubscribe: List-Post: List-Id: Mailing-List: contact cactus-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list cactus-user@jakarta.apache.org Received: (qmail 2686 invoked by uid 99); 6 May 2005 09:07:28 -0000 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=HTML_90_100,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from gate.consol.de (HELO gate.consol.de) (194.246.122.10) by apache.org (qpsmtpd/0.28) with ESMTP; Fri, 06 May 2005 02:07:25 -0700 Received: from msgsrv.bb.consol.de (imap.consol.de [10.250.0.113]) by gate.consol.de (8.12.11/8.12.11) with ESMTP id j4694kAa098336 for ; Fri, 6 May 2005 11:04:46 +0200 (CEST) (envelope-from Alvin.Antony@consol.de) Received: from charpak (charpak.int.consol.de [10.0.1.141]) by msgsrv.bb.consol.de (8.12.11/8.12.11) with ESMTP id j4694kuX083846 for ; Fri, 6 May 2005 11:04:46 +0200 (CEST) (envelope-from alvin.antony@consol.de) From: "Alvin Antony" To: Subject: Problem with ObjectInputStream and WebRequest.setUserData & .getUserData() Date: Fri, 6 May 2005 11:04:46 +0200 Message-ID: <001c01c5521a$a687c470$8d01000a@int.consol.de> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_001D_01C5522B.6A109470" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Antivirus: Scanned by Vexira Antivirus 1.0.6 X-Virus-Checked: Checked ------=_NextPart_000_001D_01C5522B.6A109470 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Dear Friends, I am new to the mailing list and so to Cactus!! Please pardon me if it is a silly Q. I am writing a test suit for an Applet& Servlet client server Application. The Applet sends the information to the Servlet through an Object stream, but my test case for this throws an EOFException. public void beginService ( WebRequest webRequest ) throws ClassNotFoundException, IOException { ProdFinderIntegratonTestRepository prodFinderIntegrationTestRep = new ProdFinderIntegratonTestRepository (); Map input; try { input = prodFinderIntegrationTestRep.getRequestToCreateMainCategory(); assertNotNull( input ); ByteArrayOutputStream bos = new ByteArrayOutputStream(); ObjectOutputStream oos = new ObjectOutputStream( bos ); oos.writeObject( input ); oos.flush(); bos.close(); ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( bos.toByteArray() ); objectInputStream = new ObjectInputStream( byteArrayInputStream ); webRequest.setContentType("application/binary"); webRequest.setUserData( objectInputStream ) ; } catch (ObjectNotFoundException e) { e.printStackTrace(); } catch (PFInternalError e) { e.printStackTrace(); } } /** * * Class under test for void service(HttpServletRequest, HttpServletResponse) */ public void testService() throws ServletException, IOException { InputStream is = request.getInputStream(); ObjectInputStream oInput = new ObjectInputStream(is); MessageReceiver messageReceiver = new MessageReceiver(); messageReceiver.init( config ); messageReceiver.service(request, response ); assertNotNull( response); } [cactus] Testcase: testService(com.siemens.productfinder.communication.TestMe ssageReceiver): Caused an ERROR [cactus] null [cactus] java.io.EOFException [cactus] at java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInp utStream.java:2165) [cactus] at java.io.ObjectInputStream$BlockDataInputStream.readShort(Obje ctInputStream.java:2631) [cactus] at java.io.ObjectInputStream.readStreamHeader(ObjectInputStream. java:734) [cactus] at java.io.ObjectInputStream.(ObjectInputStream.java:253) [cactus] at com.siemens.productfinder.communication.TestMessageReceiver.t estService(Unknown Source)... Any help would be great Thanks in advance, Alvin ------=_NextPart_000_001D_01C5522B.6A109470--