ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vanessa" <vanessaboss...@telenet.be>
Subject Re: Problem with blob
Date Tue, 14 Aug 2007 07:02:30 GMT
Hi Meindert


This is a part of the stacktrace.
what strange is, with the blobs of 65000 it works perfectly and that of 59056 it does not
work. In my previous code before Ibatis it worked perfectly, sow I think I have somewhere
made a mistake in my code. Now, we have been switched over to Ibatis and now I get this error
only with those of length 59056.




<10-aug-2007 14.45 u. CEST> <Error> <HTTP> <BEA-101017> <[ServletContext(id=29596326,name=STUDREG,context-path=/STUDREG)

] Root cause of ServletException.

java.lang.IndexOutOfBoundsException
        at java.nio.Buffer.checkBounds(Buffer.java:454)
        at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:163)
           
      




>----- Oorspronkelijk bericht -----
>Van: Meindert [mailto:meindert@pastelebusiness.com]
>Verzonden: dinsdag, augustus 14, 2007 08:44 AM
>Aan: user-java@ibatis.apache.org
>Onderwerp: RE: Problem with blob
>
>Hi Vanessa,
>
>Sorry if I'm wrong (I don't work with blogs)
>But I would think that the byteread object you think you set with the line 
>public byte[] byteread = new byte[65000];
>will be overridden by
>byteread = ((model.StudentHtml)resultList.get(0)).getAttest();
>and a new byte array with the size 59056 would be created
>
>I don't see in your code the place where the IndexOutOfBoundsException
>would be thrown?
>
>Kind Regards
> Meindert
>
>-----Original Message-----
>From: Vanessa [mailto:vanessabossens@telenet.be] 
>Sent: 14 August 2007 08:36 AM
>To: user-java@ibatis.apache.org
>Subject: Problem with blob
>
>Hello everyone
>
>I have the next problem what I cannot solve.
>I have a web application that displays blobs to the users.
>I have written the code myself and when I execute it, I get an ERROR 500.
>java.lang.IndexOutOfBoundsException
>The problem is, when I have for example 20 blobs that the users can see, al
>the blobs that are stock in the database with length 65000 are displayed and
>the one with 59056 gives the ERROR 500 java.lang.IndexOutOfBoundsException
>error.
>
>This is the code I have developed for displaying the blob: 
>
>
>public byte[] byteread = new byte[65000];
>
>public boolean readStudentHtml(String key) throws Exception {
>
>    try {
>	Etc..
>
>      If Etc. {
>        for Etc..  {
>
>        Object currentBlob =
>((model.StudentHtml)resultList.get(i)).getAttest();
>          if (currentBlob != null) {
>            byteread = ((model.StudentHtml)resultList.get(0)).getAttest();
>            logger.trace("Blob found for : " + key);
>            return true;
>          } else {
>            logger.error("Blob not found for : " + key);
>            return false;
>          }
>        }
>        } else {
>          logger.error("Blob not found for : " + key);
>      }
>    } catch (Exception e) {
>      logger.trace("Error readStudentHtml : Cause : " + e);
>      e.printStackTrace();
>    }
>    return false;
>  }
>
>
>Can someone help me.
>Vanessa
>
>
>
>
>



Mime
View raw message