You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Yegor Kozlov <ye...@dinom.ru> on 2007/09/11 18:43:08 UTC

Re[2]: Problem with POI 3

Provide a snippet of the code so we can help you diagnose your
problem.

The exception message "Row number must be between 0 and 65535, was <-32768>"
means that somewhere in your jsp you call sheet.createRow(-32768);

Yegor

> No I don't !

> But note that with Poi 2.51 version, I have no error and my Sheet is correct
> !

> 2007/9/11, Yegor Kozlov <ye...@dinom.ru>:
>>
>> You are passing a negative number to HSSFRow.setRowNum. Do you cast
>> int to short?
>>
>> Yegor
>>
>> > Hi,
>>
>> > I'm trying to use the new version of Apache POI (3 and 3.01) and now,
>> I've a
>> > bug (who doesn't appeared with Poi 2.51 version)
>>
>> > org.apache.catalina.core.ContainerBase
>> .[jonas].[localhost].[/novanet].[jsp]
>> > StandardWrapperValve.java 17:36:20 -ERROR =>Servlet.service() for
>> servlet
>> > jsp threw exception
>> > java.lang.IndexOutOfBoundsException: Row number must be between 0 and
>> 65535,
>> > was <-32768>
>> >         at
>> > org.apache.poi.hssf.usermodel.HSSFRow.setRowNum(HSSFRow.java:208)
>> >         at
>> > org.apache.poi.hssf.usermodel.HSSFRow.<init>(HSSFRow.java:98)
>> >         at
>> > org.apache.poi.hssf.usermodel.HSSFSheet.createRow(HSSFSheet.java
>> > :192)
>> >         at novanet.Requetes.executer(Requetes.java:4959)
>> >         at org.apache.jsp.jsp.requetes.executionFin_jsp._jspService
>> > (executionFin_jsp.java:80)
>> >         at
>> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java
>> > :97)
>> >         at
>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> >         at org.apache.jasper.servlet.JspServletWrapper.service(
>> > JspServletWrapper.java:332)
>> >         at org.apache.jasper.servlet.JspServlet.serviceJspFile(
>> > JspServlet.java:314)
>> >         at
>> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>> >         at
>> > javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
>> >         at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source)
>> >         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
>> > DelegatingMethodAccessorImpl.java:25)
>> >         at java.lang.reflect.Method.invoke(Method.java:324)
>> >         at
>> > org.apache.catalina.security.SecurityUtil$1.run(SecurityUtil.java
>> > :243)
>> >         at java.security.AccessController.doPrivileged(Native Method)
>> >         at
>> > javax.security.auth.Subject.doAsPrivileged(Subject.java:500)
>> >         at org.apache.catalina.security.SecurityUtil.execute(
>> > SecurityUtil.java:275)
>> >         at org.apache.catalina.security.SecurityUtil.doAsPrivilege(
>> > SecurityUtil.java:161)
>> >         at
>> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
>> > ApplicationFilterChain.java:245)
>> >         at org.apache.catalina.core.ApplicationFilterChain.access$000(
>> > ApplicationFilterChain.java:50)
>> >         at org.apache.catalina.core.ApplicationFilterChain$1.run(
>> > ApplicationFilterChain.java:156)
>> >         at java.security.AccessController.doPrivileged(Native Method)
>> >         at org.apache.catalina.core.ApplicationFilterChain.doFilter(
>> > ApplicationFilterChain.java:152)
>> >         at org.apache.catalina.core.StandardWrapperValve.invoke(
>> > StandardWrapperValve.java:213)
>> >         at org.apache.catalina.core.StandardContextValve.invoke(
>> > StandardContextValve.java:178)
>> >         at org.apache.catalina.core.StandardHostValve.invoke(
>> > StandardHostValve.java:126)
>> >         at org.apache.catalina.valves.ErrorReportValve.invoke(
>> > ErrorReportValve.java:105)
>> >         at org.apache.catalina.core.StandardEngineValve.invoke(
>> > StandardEngineValve.java:107)
>> >         at org.apache.catalina.connector.CoyoteAdapter.service(
>> > CoyoteAdapter.java:148)
>> >         at org.apache.coyote.http11.Http11Processor.process(
>> > Http11Processor.java:869)
>> >         at
>> >
>> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection
>> > (Http11BaseProtocol.java:664)
>> >         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(
>> > PoolTcpEndpoint.java:527)
>> >         at
>> > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(
>> > LeaderFollowerWorkerThread.java:80)
>> >         at
>> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(
>> > ThreadPool.java:684)
>> >         at java.lang.Thread.run(Thread.java:534)
>>
>> > May someone help me ?
>>
>> > Best regards,
>> > Julien
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
>> For additional commands, e-mail: user-help@poi.apache.org
>>
>>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Re[2]: Problem with POI 3

Posted by Nick Burch <ni...@torchbox.com>.
On Thu, 1 May 2008 joe@k12s.phast.umass.edu wrote:
> I checked the POI source code and found in HSSFCellUtil this method:

The underlying methods on HSSFRow and HSSFSheet now take ints, so I've
fixed HSSFCellUtil in svn trunk to take advantage of this, and avoid the
issue

Nick

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org


Re: Re[2]: Problem with POI 3

Posted by jo...@k12s.phast.umass.edu.
-- Yegor Kozlov wrote : 
> Provide a snippet of the code so we can help you diagnose your
> problem.
> 
> The exception message "Row number must be between 0 and 65535, was <-32768>"
> means that somewhere in your jsp you call sheet.createRow(-32768);
> 
> Yegor

I would hate to dig up a thread from 2007, but google brought me here :)

I think KiKicool is right, there is a problem with POI.  We're running into the problem too, and I double checked that I am passing an int in, and also double checked by sending it to System.out.println.

I checked the POI source code and found in HSSFCellUtil this method:

    public static HSSFRow getRow(int rowCounter, HSSFSheet sheet) {
        HSSFRow row = sheet.getRow((short)rowCounter);
        if (row == null) {
            row = sheet.createRow((short)rowCounter);
        }
        return row;
    }

This is the function that we're using.  You can see it's casting it to a short.  I checked POI 3.0.2 and 3.1 beta.  They both crash, and have the offending code.  Should be an easy fix.

-Joe


--
This message was sent on behalf of joe@k12s.phast.umass.edu at openSubscriber.com
http://www.opensubscriber.com/message/user@poi.apache.org/7557766.html

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org