You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by thikkar <ck...@gmail.com> on 2009/12/26 08:46:13 UTC

Unable to read entire block; 202 bytes read; expected 512 bytes

I am trying to read an excel file using POI 2.0 (used 1.5 also) , but
I get the following
error:

java.lang.Exception: java.io.IOException: Unable to read entire block;
202 bytes read; expected 512 bytes
at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
at csmip.EvpnExcelParser.importExcel(Unknown Source)
at
_jsps._mds._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java:130)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at
com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
at
org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
at
org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
at
org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:293)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
at
com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)

It is a web based application where i have to read an excel file.
EvpnExcelParser is my own class which uses displayExcel() method to read the
xls file.
Excel file version is 2002 /2003
piece of code:

Hint: xlsPath contains path to the excel file

InputStream inputStream = new FileInputStream (xlsPath);

POIFSFileSystem fileSystem = null;

fileSystem = new POIFSFileSystem (inputStream);

HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
HSSFSheet sheet = workBook.getSheetAt (0);


Please help me as soon as possible.

-- 
View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26925822.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by David Fisher <df...@jmlafferty.com>.
Hi Karthik,

> I will ask my company to deploy the latest version of POI.

You should use POI 3.6

> My concern is ,application is such a big,we are using POI to  
> generate lot of
> reports.

You will need to make sure that they all work correctly. Does your  
company have unit tests that make sure each report generates correctly?

You can come back to the user list for help with any reports that fail  
to work using POI 3.6. There are likely to be a few small API changes.

> Is it possible to deploy more than one POI for an application.

Not in any easy way. You would have to rename everything and that  
would be harder than making sure all the old reports still work.

Regards,
Dave

> Please suggest me an POI version to deploy.
>
> No issues in opening and resaving the file.
>
> Thanks
> Karthik
>
>
> David Fisher wrote:
>>
>> I don't know iPlanet, we use Tomcat, but seriously you need to talk  
>> to
>> your company about using more recent versions of POI. Maybe that is
>> not as hard as you think. Your company will need to help you. Here  
>> are
>> some questions.
>>
>> Does your company deploy POI 1.5 or 2.0 jars for every application on
>> a server? If the answer is no, then you should be able to deploy your
>> own version  of POI in your application in a WEB-INF/lib directory or
>> something similar.
>>
>> Seriously it should not be too hard for your company to upgrade to a
>> recent version of POI. You will likely need to go to at least version
>> 3.5. I know that there were fixes to block size issues applied after
>> 3.2. I don't know if they are your issues.
>>
>> It is also possible that this file has been damaged in some way. What
>> happens when you open it in Excel and re-save it?
>>
>> Regards,
>> Dave
>>
>> On Dec 26, 2009, at 8:06 PM, thikkar wrote:
>>
>>>
>>> I cannot update to latest version, since my company is using POI for
>>> various
>>> Applications.
>>> I will try to get the problematic file from my company. In the
>>> meanwhile
>>> ,can u think of some other solution? My Application is deployed in
>>> IPlanet
>>> server which is in Solaris OS.
>>>
>>>
>>>
>>>
>>> MSB wrote:
>>>>
>>>> If you can, the first thing to do would be to update to the current
>>>> version of the API as both of those you are using are quite old
>>>> now. It
>>>> could very well be that the problem you are experiencing was
>>>> reported and
>>>> addressed in the time between version 2.0 and 3.6 and if it has,  
>>>> the
>>>> advice can only and will be to upgrade I suspect. However, if you
>>>> cannot
>>>> do this for some reason - and I would strongly advise that you do -
>>>> can
>>>> you attach the problematic file please so that the developers can
>>>> look
>>>> into the issue?
>>>>
>>>> Mark B
>>>>
>>>>
>>>> thikkar wrote:
>>>>>
>>>>> I am trying to read an excel file using POI 2.0 (used 1.5 also) ,
>>>>> but
>>>>> I get the following
>>>>> error:
>>>>>
>>>>> java.lang.Exception: java.io.IOException: Unable to read entire
>>>>> block;
>>>>> 202 bytes read; expected 512 bytes
>>>>> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
>>>>> at csmip.EvpnExcelParser.importExcel(Unknown Source)
>>>>> at
>>>>> _jsps
>>>>> ._mds
>>>>> ._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java: 
>>>>> 130)
>>>>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:
>>>>> 107)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>>>> at
>>>>> com.iplanet.ias.web.jsp.JspServlet
>>>>> $JspServletWrapper.service(JspServlet.java:687)
>>>>> at
>>>>> com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:
>>>>> 459)
>>>>> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core
>>>>> .StandardWrapperValve
>>>>> .invokeServletService(StandardWrapperValve.java:771)
>>>>> at
>>>>> org.apache.catalina.core.StandardWrapperValve.access
>>>>> $000(StandardWrapperValve.java:118)
>>>>> at
>>>>> org.apache.catalina.core.StandardWrapperValve
>>>>> $1.run(StandardWrapperValve.java:293)
>>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina
>>>>> .core.StandardContextValve.invoke(StandardContextValve.java:218)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
>>>>> 209)
>>>>> at
>>>>> org
>>>>> .apache
>>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>>> at
>>>>> com
>>>>> .iplanet
>>>>> .ias
>>>>> .web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java: 
>>>>> 157)
>>>>> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
>>>>>
>>>>> It is a web based application where i have to read an excel file.
>>>>> EvpnExcelParser is my own class which uses displayExcel() method
>>>>> to read
>>>>> the xls file.
>>>>> Excel file version is 2002 /2003
>>>>> piece of code:
>>>>>
>>>>> Hint: xlsPath contains path to the excel file
>>>>>
>>>>> InputStream inputStream = new FileInputStream (xlsPath);
>>>>>
>>>>> POIFSFileSystem fileSystem = null;
>>>>>
>>>>> fileSystem = new POIFSFileSystem (inputStream);
>>>>>
>>>>> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
>>>>> HSSFSheet sheet = workBook.getSheetAt (0);
>>>>>
>>>>>
>>>>> Please help me as soon as possible.
>>>>>
>>>>>
>>>>
>>>>
>>>
>>> -- 
>>> View this message in context:
>>> http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26931823.html
>>> Sent from the POI - Dev mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>>> For additional commands, e-mail: dev-help@poi.apache.org
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26935926.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by thikkar <ck...@gmail.com>.
I will ask my company to deploy the latest version of POI.

My concern is ,application is such a big,we are using POI to generate lot of
reports.

Is it possible to deploy more than one POI for an application.

Please suggest me an POI version to deploy.

No issues in opening and resaving the file.

Thanks
Karthik


David Fisher wrote:
> 
> I don't know iPlanet, we use Tomcat, but seriously you need to talk to  
> your company about using more recent versions of POI. Maybe that is  
> not as hard as you think. Your company will need to help you. Here are  
> some questions.
> 
> Does your company deploy POI 1.5 or 2.0 jars for every application on  
> a server? If the answer is no, then you should be able to deploy your  
> own version  of POI in your application in a WEB-INF/lib directory or  
> something similar.
> 
> Seriously it should not be too hard for your company to upgrade to a  
> recent version of POI. You will likely need to go to at least version  
> 3.5. I know that there were fixes to block size issues applied after  
> 3.2. I don't know if they are your issues.
> 
> It is also possible that this file has been damaged in some way. What  
> happens when you open it in Excel and re-save it?
> 
> Regards,
> Dave
> 
> On Dec 26, 2009, at 8:06 PM, thikkar wrote:
> 
>>
>> I cannot update to latest version, since my company is using POI for  
>> various
>> Applications.
>> I will try to get the problematic file from my company. In the  
>> meanwhile
>> ,can u think of some other solution? My Application is deployed in  
>> IPlanet
>> server which is in Solaris OS.
>>
>>
>>
>>
>> MSB wrote:
>>>
>>> If you can, the first thing to do would be to update to the current
>>> version of the API as both of those you are using are quite old  
>>> now. It
>>> could very well be that the problem you are experiencing was  
>>> reported and
>>> addressed in the time between version 2.0 and 3.6 and if it has, the
>>> advice can only and will be to upgrade I suspect. However, if you  
>>> cannot
>>> do this for some reason - and I would strongly advise that you do -  
>>> can
>>> you attach the problematic file please so that the developers can  
>>> look
>>> into the issue?
>>>
>>> Mark B
>>>
>>>
>>> thikkar wrote:
>>>>
>>>> I am trying to read an excel file using POI 2.0 (used 1.5 also) ,  
>>>> but
>>>> I get the following
>>>> error:
>>>>
>>>> java.lang.Exception: java.io.IOException: Unable to read entire  
>>>> block;
>>>> 202 bytes read; expected 512 bytes
>>>> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
>>>> at csmip.EvpnExcelParser.importExcel(Unknown Source)
>>>> at
>>>> _jsps 
>>>> ._mds 
>>>> ._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java:130)
>>>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java: 
>>>> 107)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>>> at
>>>> com.iplanet.ias.web.jsp.JspServlet 
>>>> $JspServletWrapper.service(JspServlet.java:687)
>>>> at  
>>>> com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java: 
>>>> 459)
>>>> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina 
>>>> .core 
>>>> .StandardWrapperValve 
>>>> .invokeServletService(StandardWrapperValve.java:771)
>>>> at
>>>> org.apache.catalina.core.StandardWrapperValve.access 
>>>> $000(StandardWrapperValve.java:118)
>>>> at
>>>> org.apache.catalina.core.StandardWrapperValve 
>>>> $1.run(StandardWrapperValve.java:293)
>>>> at java.security.AccessController.doPrivileged(Native Method)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina 
>>>> .core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina 
>>>> .core.StandardContextValve.invoke(StandardContextValve.java:218)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
>>>> at
>>>> org 
>>>> .apache 
>>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>>> at
>>>> com 
>>>> .iplanet 
>>>> .ias 
>>>> .web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
>>>> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
>>>>
>>>> It is a web based application where i have to read an excel file.
>>>> EvpnExcelParser is my own class which uses displayExcel() method  
>>>> to read
>>>> the xls file.
>>>> Excel file version is 2002 /2003
>>>> piece of code:
>>>>
>>>> Hint: xlsPath contains path to the excel file
>>>>
>>>> InputStream inputStream = new FileInputStream (xlsPath);
>>>>
>>>> POIFSFileSystem fileSystem = null;
>>>>
>>>> fileSystem = new POIFSFileSystem (inputStream);
>>>>
>>>> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
>>>> HSSFSheet sheet = workBook.getSheetAt (0);
>>>>
>>>>
>>>> Please help me as soon as possible.
>>>>
>>>>
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26931823.html
>> Sent from the POI - Dev mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
>> For additional commands, e-mail: dev-help@poi.apache.org
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26935926.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by David Fisher <df...@jmlafferty.com>.
I don't know iPlanet, we use Tomcat, but seriously you need to talk to  
your company about using more recent versions of POI. Maybe that is  
not as hard as you think. Your company will need to help you. Here are  
some questions.

Does your company deploy POI 1.5 or 2.0 jars for every application on  
a server? If the answer is no, then you should be able to deploy your  
own version  of POI in your application in a WEB-INF/lib directory or  
something similar.

Seriously it should not be too hard for your company to upgrade to a  
recent version of POI. You will likely need to go to at least version  
3.5. I know that there were fixes to block size issues applied after  
3.2. I don't know if they are your issues.

It is also possible that this file has been damaged in some way. What  
happens when you open it in Excel and re-save it?

Regards,
Dave

On Dec 26, 2009, at 8:06 PM, thikkar wrote:

>
> I cannot update to latest version, since my company is using POI for  
> various
> Applications.
> I will try to get the problematic file from my company. In the  
> meanwhile
> ,can u think of some other solution? My Application is deployed in  
> IPlanet
> server which is in Solaris OS.
>
>
>
>
> MSB wrote:
>>
>> If you can, the first thing to do would be to update to the current
>> version of the API as both of those you are using are quite old  
>> now. It
>> could very well be that the problem you are experiencing was  
>> reported and
>> addressed in the time between version 2.0 and 3.6 and if it has, the
>> advice can only and will be to upgrade I suspect. However, if you  
>> cannot
>> do this for some reason - and I would strongly advise that you do -  
>> can
>> you attach the problematic file please so that the developers can  
>> look
>> into the issue?
>>
>> Mark B
>>
>>
>> thikkar wrote:
>>>
>>> I am trying to read an excel file using POI 2.0 (used 1.5 also) ,  
>>> but
>>> I get the following
>>> error:
>>>
>>> java.lang.Exception: java.io.IOException: Unable to read entire  
>>> block;
>>> 202 bytes read; expected 512 bytes
>>> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
>>> at csmip.EvpnExcelParser.importExcel(Unknown Source)
>>> at
>>> _jsps 
>>> ._mds 
>>> ._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java:130)
>>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java: 
>>> 107)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>> at
>>> com.iplanet.ias.web.jsp.JspServlet 
>>> $JspServletWrapper.service(JspServlet.java:687)
>>> at  
>>> com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java: 
>>> 459)
>>> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>> at
>>> org 
>>> .apache 
>>> .catalina 
>>> .core 
>>> .StandardWrapperValve 
>>> .invokeServletService(StandardWrapperValve.java:771)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.access 
>>> $000(StandardWrapperValve.java:118)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve 
>>> $1.run(StandardWrapperValve.java:293)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> org 
>>> .apache 
>>> .catalina 
>>> .core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
>>> at
>>> org 
>>> .apache 
>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>> at
>>> org 
>>> .apache 
>>> .catalina 
>>> .core.StandardContextValve.invoke(StandardContextValve.java:218)
>>> at
>>> org 
>>> .apache 
>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>> at
>>> org 
>>> .apache 
>>> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
>>> at
>>> org 
>>> .apache 
>>> .catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>>> at
>>> com 
>>> .iplanet 
>>> .ias 
>>> .web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
>>> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
>>>
>>> It is a web based application where i have to read an excel file.
>>> EvpnExcelParser is my own class which uses displayExcel() method  
>>> to read
>>> the xls file.
>>> Excel file version is 2002 /2003
>>> piece of code:
>>>
>>> Hint: xlsPath contains path to the excel file
>>>
>>> InputStream inputStream = new FileInputStream (xlsPath);
>>>
>>> POIFSFileSystem fileSystem = null;
>>>
>>> fileSystem = new POIFSFileSystem (inputStream);
>>>
>>> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
>>> HSSFSheet sheet = workBook.getSheetAt (0);
>>>
>>>
>>> Please help me as soon as possible.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26931823.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by Antony Bowesman <ad...@teamware.com>.
I had similar problems with MS files with 3.0 and 3.5. They were Word  
docs but I just padded the files to a 512 byte boundary and it managed  
to process them.

On 27/12/2009, at 2:36 PM, thikkar <ck...@gmail.com> wrote:

>
> I cannot update to latest version, since my company is using POI for  
> various
> Applications.
> I will try to get the problematic file from my company. In the  
> meanwhile
> ,can u think of some other solution? My Application is deployed in  
> IPlanet
> server which is in Solaris OS.
>
>
>
>
> MSB wrote:
>>
>> If you can, the first thing to do would be to update to the current
>> version of the API as both of those you are using are quite old  
>> now. It
>> could very well be that the problem you are experiencing was  
>> reported and
>> addressed in the time between version 2.0 and 3.6 and if it has, the
>> advice can only and will be to upgrade I suspect. However, if you  
>> cannot
>> do this for some reason - and I would strongly advise that you do -  
>> can
>> you attach the problematic file please so that the developers can  
>> look
>> into the issue?
>>
>> Mark B
>>
>>
>> thikkar wrote:
>>>
>>> I am trying to read an excel file using POI 2.0 (used 1.5 also) ,  
>>> but
>>> I get the following
>>> error:
>>>
>>> java.lang.Exception: java.io.IOException: Unable to read entire  
>>> block;
>>> 202 bytes read; expected 512 bytes
>>> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
>>> at csmip.EvpnExcelParser.importExcel(Unknown Source)
>>> at
>>> _jsps._mds._evpn_excel_import_jsp._jspService 
>>> (_evpn_excel_import_jsp.java:130)
>>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java: 
>>> 107)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>> at
>>> com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service 
>>> (JspServlet.java:687)
>>> at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile 
>>> (JspServlet.java:459)
>>> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invokeServletService 
>>> (StandardWrapperValve.java:771)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.access$000 
>>> (StandardWrapperValve.java:118)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve$1.run 
>>> (StandardWrapperValve.java:293)
>>> at java.security.AccessController.doPrivileged(Native Method)
>>> at
>>> org.apache.catalina.core.StandardWrapperValve.invoke 
>>> (StandardWrapperValve.java:289)
>>> at
>>> org.apache.catalina.core.StandardPipeline.invoke 
>>> (StandardPipeline.java:509)
>>> at
>>> org.apache.catalina.core.StandardContextValve.invoke 
>>> (StandardContextValve.java:218)
>>> at
>>> org.apache.catalina.core.StandardPipeline.invoke 
>>> (StandardPipeline.java:509)
>>> at
>>> org.apache.catalina.core.StandardHostValve.invoke 
>>> (StandardHostValve.java:209)
>>> at
>>> org.apache.catalina.core.StandardPipeline.invoke 
>>> (StandardPipeline.java:509)
>>> at
>>> com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process 
>>> (NSAPIProcessor.java:157)
>>> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
>>>
>>> It is a web based application where i have to read an excel file.
>>> EvpnExcelParser is my own class which uses displayExcel() method  
>>> to read
>>> the xls file.
>>> Excel file version is 2002 /2003
>>> piece of code:
>>>
>>> Hint: xlsPath contains path to the excel file
>>>
>>> InputStream inputStream = new FileInputStream (xlsPath);
>>>
>>> POIFSFileSystem fileSystem = null;
>>>
>>> fileSystem = new POIFSFileSystem (inputStream);
>>>
>>> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
>>> HSSFSheet sheet = workBook.getSheetAt (0);
>>>
>>>
>>> Please help me as soon as possible.
>>>
>>>
>>
>>
>
> -- 
> View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26931823.html
> Sent from the POI - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
> For additional commands, e-mail: dev-help@poi.apache.org
>


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by thikkar <ck...@gmail.com>.
I cannot update to latest version, since my company is using POI for various
Applications.
I will try to get the problematic file from my company. In the meanwhile
,can u think of some other solution? My Application is deployed in IPlanet
server which is in Solaris OS. 




MSB wrote:
> 
> If you can, the first thing to do would be to update to the current
> version of the API as both of those you are using are quite old now. It
> could very well be that the problem you are experiencing was reported and
> addressed in the time between version 2.0 and 3.6 and if it has, the
> advice can only and will be to upgrade I suspect. However, if you cannot
> do this for some reason - and I would strongly advise that you do - can
> you attach the problematic file please so that the developers can look
> into the issue?
> 
> Mark B
> 
> 
> thikkar wrote:
>> 
>> I am trying to read an excel file using POI 2.0 (used 1.5 also) , but
>> I get the following
>> error:
>> 
>> java.lang.Exception: java.io.IOException: Unable to read entire block;
>> 202 bytes read; expected 512 bytes
>> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
>> at csmip.EvpnExcelParser.importExcel(Unknown Source)
>> at
>> _jsps._mds._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java:130)
>> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>> at
>> com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
>> at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
>> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
>> at
>> org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
>> at
>> org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:293)
>> at java.security.AccessController.doPrivileged(Native Method)
>> at
>> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>> at
>> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>> at
>> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
>> at
>> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
>> at
>> com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
>> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
>> 
>> It is a web based application where i have to read an excel file.
>> EvpnExcelParser is my own class which uses displayExcel() method to read
>> the xls file.
>> Excel file version is 2002 /2003
>> piece of code:
>> 
>> Hint: xlsPath contains path to the excel file
>> 
>> InputStream inputStream = new FileInputStream (xlsPath);
>> 
>> POIFSFileSystem fileSystem = null;
>> 
>> fileSystem = new POIFSFileSystem (inputStream);
>> 
>> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
>> HSSFSheet sheet = workBook.getSheetAt (0);
>> 
>> 
>> Please help me as soon as possible.
>> 
>> 
> 
> 

-- 
View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26931823.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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


Re: Unable to read entire block; 202 bytes read; expected 512 bytes

Posted by MSB <ma...@tiscali.co.uk>.
If you can, the first thing to do would be to update to the current version
of the API as both of those you are using are quite old now. It could very
well be that the problem you are experiencing was reported and addressed in
the time between version 2.0 and 3.6 and if it has, the advice can only and
will be to upgrade I suspect. However, if you cannot do this for some reason
- and I would strongly advise that you do - can you attach the problematic
file please so that the developers can look into the issue?

Mark B


thikkar wrote:
> 
> I am trying to read an excel file using POI 2.0 (used 1.5 also) , but
> I get the following
> error:
> 
> java.lang.Exception: java.io.IOException: Unable to read entire block;
> 202 bytes read; expected 512 bytes
> at csmip.EvpnExcelParser.displayFromExcel(Unknown Source)
> at csmip.EvpnExcelParser.importExcel(Unknown Source)
> at
> _jsps._mds._evpn_excel_import_jsp._jspService(_evpn_excel_import_jsp.java:130)
> at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
> at
> com.iplanet.ias.web.jsp.JspServlet$JspServletWrapper.service(JspServlet.java:687)
> at com.iplanet.ias.web.jsp.JspServlet.serviceJspFile(JspServlet.java:459)
> at com.iplanet.ias.web.jsp.JspServlet.service(JspServlet.java:375)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:908)
> at
> org.apache.catalina.core.StandardWrapperValve.invokeServletService(StandardWrapperValve.java:771)
> at
> org.apache.catalina.core.StandardWrapperValve.access$000(StandardWrapperValve.java:118)
> at
> org.apache.catalina.core.StandardWrapperValve$1.run(StandardWrapperValve.java:293)
> at java.security.AccessController.doPrivileged(Native Method)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:289)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:218)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:209)
> at
> org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:509)
> at
> com.iplanet.ias.web.connector.nsapi.NSAPIProcessor.process(NSAPIProcessor.java:157)
> at com.iplanet.ias.web.WebContainer.service(WebContainer.java:579)
> 
> It is a web based application where i have to read an excel file.
> EvpnExcelParser is my own class which uses displayExcel() method to read
> the xls file.
> Excel file version is 2002 /2003
> piece of code:
> 
> Hint: xlsPath contains path to the excel file
> 
> InputStream inputStream = new FileInputStream (xlsPath);
> 
> POIFSFileSystem fileSystem = null;
> 
> fileSystem = new POIFSFileSystem (inputStream);
> 
> HSSFWorkbook workBook = new HSSFWorkbook (fileSystem);
> HSSFSheet sheet = workBook.getSheetAt (0);
> 
> 
> Please help me as soon as possible.
> 
> 

-- 
View this message in context: http://old.nabble.com/Unable-to-read-entire-block--202-bytes-read--expected-512-bytes-tp26925822p26925944.html
Sent from the POI - Dev mailing list archive at Nabble.com.


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