Help, InvocationTargetException on POI version 2.5.1

View: New views
3 Messages — Rating Filter:   Alert me  

Help, InvocationTargetException on POI version 2.5.1

by John Byrne-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello all,

 

First of all, I know it's a very dated version of POI.  Every time I
change something on this system it doesn't work any more so I haven't
had the chance to upgrade.  

 

Finally, I need help with an error I'm having getting POI to work in a
new program.  I'm getting the following error and I don't know what to
do because I can't troubleshoot it due to not having the source code.
The program stops in what looks like native code.

 

java.lang.reflect.InvocationTargetException

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

      at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)

      at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

      at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java
:224)

      at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.jav
a:160)

      at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

      at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

      at
org.snbw.util.excel.ExcelConnection.readWorkbook(ExcelConnection.java:19
9)

      at
org.snbw.util.excel.ExcelConnection.<init>(ExcelConnection.java:36)

      at
org.snbw.util.scan.CrisisCallTime.FormatTimes.main(FormatTimes.java:47)

Caused by: java.lang.IllegalArgumentException: Illegal length

      at
org.apache.poi.util.StringUtil.getFromUnicodeHigh(StringUtil.java:76)

      at
org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:135)

      at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)

      at org.apache.poi.hssf.record.Record.<init>(Record.java:55)

      at
org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88)

      ... 11 more

 

Can anyone help?

 

John Byrne

Support Network for Battered Women

1257 Tasman Dr. Suite C

Sunnyvale, CA

94089

 

(408) 541-6100 x 138

Fax: (408) 541-3333

 


Re: Help, InvocationTargetException on POI version 2.5.1

by Nick Burch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 24 Jul 2008, John Byrne wrote:
> First of all, I know it's a very dated version of POI.  Every time I
> change something on this system it doesn't work any more so I haven't
> had the chance to upgrade.

poi 2.5.1 dates from 4 years ago next week....

> Finally, I need help with an error I'm having getting POI to work in a
> new program.  I'm getting the following error and I don't know what to
> do because I can't troubleshoot it due to not having the source code.
> The program stops in what looks like native code.

You need to look a bit futher down the stack trace, the interesting bit is
a nested exception:

> Caused by: java.lang.IllegalArgumentException: Illegal length
>
>      at
> org.apache.poi.util.StringUtil.getFromUnicodeHigh(StringUtil.java:76)
>
>      at
> org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:135)
>
>      at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)
>
>      at org.apache.poi.hssf.record.Record.<init>(Record.java:55)
>
>      at
> org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88)
>
>      ... 11 more

So there's an issue with a unicode string in a font record. Try it with
poi 3.1 to see if it's a corrupt record, or a bug in poi that's long since
fixed

Nick

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


RE: Help, InvocationTargetException on POI version 2.5.1

by John Byrne-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey... It worked.  The workbook was protected.

Thank you for your help.  I did use v 3.1 and that gave me a clue as to
why it wasn't working.  The error mentioned that POI did not support
encrypted files which reminded me to unprotect the workbook.

John Byrne
Support Network for Battered Women
1257 Tasman Dr. Suite C
Sunnyvale, CA
94089
 
(408) 541-6100 x 138
Fax: (408) 541-3333
-----Original Message-----
From: John Byrne [mailto:jbyrne@...]
Sent: Thursday, July 24, 2008 10:00 AM
To: user@...
Subject: Help, InvocationTargetException on POI version 2.5.1

Hello all,

 

First of all, I know it's a very dated version of POI.  Every time I
change something on this system it doesn't work any more so I haven't
had the chance to upgrade.  

 

Finally, I need help with an error I'm having getting POI to work in a
new program.  I'm getting the following error and I don't know what to
do because I can't troubleshoot it due to not having the source code.
The program stops in what looks like native code.

 

java.lang.reflect.InvocationTargetException

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
Method)

      at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
ccessorImpl.java:39)

      at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
tructorAccessorImpl.java:27)

      at java.lang.reflect.Constructor.newInstance(Constructor.java:494)

      at
org.apache.poi.hssf.record.RecordFactory.createRecord(RecordFactory.java
:224)

      at
org.apache.poi.hssf.record.RecordFactory.createRecords(RecordFactory.jav
a:160)

      at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:163)

      at
org.apache.poi.hssf.usermodel.HSSFWorkbook.<init>(HSSFWorkbook.java:130)

      at
org.snbw.util.excel.ExcelConnection.readWorkbook(ExcelConnection.java:19
9)

      at
org.snbw.util.excel.ExcelConnection.<init>(ExcelConnection.java:36)

      at
org.snbw.util.scan.CrisisCallTime.FormatTimes.main(FormatTimes.java:47)

Caused by: java.lang.IllegalArgumentException: Illegal length

      at
org.apache.poi.util.StringUtil.getFromUnicodeHigh(StringUtil.java:76)

      at
org.apache.poi.hssf.record.FontRecord.fillFields(FontRecord.java:135)

      at org.apache.poi.hssf.record.Record.fillFields(Record.java:90)

      at org.apache.poi.hssf.record.Record.<init>(Record.java:55)

      at
org.apache.poi.hssf.record.FontRecord.<init>(FontRecord.java:88)

      ... 11 more

 

Can anyone help?

 

John Byrne

Support Network for Battered Women

1257 Tasman Dr. Suite C

Sunnyvale, CA

94089

 

(408) 541-6100 x 138

Fax: (408) 541-3333

 


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

LightInTheBox - Buy quality products at wholesale price!