You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Dave Madole <dm...@iodalliance.com> on 2008/09/15 20:07:18 UTC

Can't find hssf eventusermodel formula & DateCell related classes building XLS2CSVmra example app

Hi,

When I try to build the XLS2CSVmra app with the poi jar file I get
references to some missing classes and a ³package missing² message.

I can¹t find them in the source, either.

XLS2CSVmra.java:29: package
org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder does not exist
import 
org.apache.poi.hssf.eventusermodel.EventWorkbookBuilder.SheetRecordCollectin
gListener;
                                                              ^
LS2CSVmra.java:65: cannot find symbol
symbol  : class SheetRecordCollectingListener
location: class org.apache.poi.hssf.eventusermodel.examples.XLS2CSVmra
        private SheetRecordCollectingListener workbookBuildingListener;
...
XLS2CSVmra.java:116: cannot find symbol
symbol  : class SheetRecordCollectingListener
location: class org.apache.poi.hssf.eventusermodel.examples.XLS2CSVmra
                        workbookBuildingListener = new
SheetRecordCollectingListener(formatListener);
                                                       ^
...
XLS2CSVmra.java:177: cannot find symbol
symbol  : method 
formatNumberDateCell(org.apache.poi.hssf.record.FormulaRecord)
location: class 
org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener
                                thisStr =
formatListener.formatNumberDateCell(frec);
                                                        ^
...
XLS2CSVmra.java:228: cannot find symbol
symbol  : method 
formatNumberDateCell(org.apache.poi.hssf.record.NumberRecord)
location: class 
org.apache.poi.hssf.eventusermodel.FormatTrackingHSSFListener
            thisStr = formatListener.formatNumberDateCell(numrec);
                                    ^

5 errors

I¹ve looked in the scratchpad and contrib jars, too.

I did find some stuff in the beta release (e.g.,
EventWorkbookBuilder$SheetRecordCollectingListener)
but I¹m not sure what to do with the ³$² or what it means.

I¹m not a ³real² Java programmer, I just want to build this app and modify
it to dump a CSV to a Perl based system, so if I¹m missing something
obvious... sorry.  I would like to have what does work of formula extraction
using the event model, though.

Thanks,

Dave

------ End of Forwarded Message


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


Re: Can't find hssf eventusermodel formula & DateCell related classes building XLS2CSVmra example app

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Dave Madole wrote:
> When I try to build the XLS2CSVmra app with the poi jar file I get 
> references to some missing classes and a ³package missing² message.

You'll need to ensure you use a matching set of POI examples and POI jars. 
It looks to me like you might have the examples from svn, and old jars.

You could try compiling XLS2CSVmra against a recent poi nightly build from 
http://encore.torchbox.com/poi-svn-build/ . (You'll probably want to use 
the recent XLS2CSVmra + jar combination, as there have been some fixes in 
since the last POI -FINAL release)

Nick

RE: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> Here is the file I was trying to parse.
> Based on your feedback it looks like I need to use JDK 1.5.

Yes, that file is an OOXML file. You'll need to use java 1.5, and XSSF 
(see the docs that come with the poi 3.5 beta for how to do XSSF and HSSF 
with the same code)

Nick

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


RE: class file has wrong version 49.0, should be 48.0

Posted by "Davanagere, Nagaraj" <Na...@umassmed.edu>.
Thanks Nick.

Here is the file I was trying to parse.
Based on your feedback it looks like I need to use JDK 1.5.

Please confirm once again if am thinking right?

Thanks,
Nagaraj

-----Original Message-----
From: Nick Burch [mailto:nick@torchbox.com] 
Sent: Monday, September 15, 2008 4:02 PM
To: POI Users List
Subject: RE: class file has wrong version 49.0, should be 48.0

On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a 
> different exception.
> (I am trying to parse a file with .xlsm type )

Is .xlsm a new, ooxml file? If so, you'll need to upgrade to java 1.5.
POI currently supports java 1.4 for the older OLE2 documents, but to
parse the new ooxml ones various dependencies are java 1.5 only. So, for
XSSF (to parse .xlsx files and similar), you need to be using java 1.5,
the normal (non -jdk14-) jar, and the -ooxml- jar (+ dependencies)

Nick

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



RE: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a different
> exception.
> (I am trying to parse a file with .xlsm type )

Is .xlsm a new, ooxml file? If so, you'll need to upgrade to java 1.5. POI 
currently supports java 1.4 for the older OLE2 documents, but to parse the 
new ooxml ones various dependencies are java 1.5 only. So, for XSSF (to 
parse .xlsx files and similar), you need to be using java 1.5, the 
normal (non -jdk14-) jar, and the -ooxml- jar (+ dependencies)

Nick

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


RE: class file has wrong version 49.0, should be 48.0

Posted by "Davanagere, Nagaraj" <Na...@umassmed.edu>.
Thanks Nick.

I tried with poi-jdk14-3.5-beta1-20080718.jar and now I get a different
exception.
(I am trying to parse a file with .xlsm type )

Unhandled Exception thrown: class
org.apache.poi.poifs.filesystem.OfficeXmlFileException
Root cause of ServletException.
org.apache.poi.poifs.filesystem.OfficeXmlFileException: The supplied
data appears to be in the Office 2007+ XML. POI only supports OLE2
Office documents
	at
org.apache.poi.poifs.storage.HeaderBlockReader.<init>(HeaderBlockReader.
java:108)
	at
org.apache.poi.poifs.filesystem.POIFSFileSystem.<init>(POIFSFileSystem.j
ava:151) 


Please let me know if am using the correct library to parse this file?

Thanks,
Nagaraj

-----Original Message-----
From: Nick Burch [mailto:nick@torchbox.com] 
Sent: Monday, September 15, 2008 3:19 PM
To: POI Users List
Subject: Re: class file has wrong version 49.0, should be 48.0

On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> My java source compilation fails with the following exception.
>    [javac] util\FileUploadHelper.java:12: cannot access 
> org.apache.poi.hssf.usermodel.HSSFCell
>    [javac] bad class file:
> lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.
> cl
> ass)

If you're still on java 1.4, you'll want
poi-jdk14-3.5-beta1-20080718.jar instead of poi-3.5-beta1-20080718.jar.
It's in the binary download along with the jar you're using

Nick

---------------------------------------------------------------------
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: class file has wrong version 49.0, should be 48.0

Posted by Nick Burch <ni...@torchbox.com>.
On Mon, 15 Sep 2008, Davanagere, Nagaraj wrote:
> My java source compilation fails with the following exception.
>    [javac] util\FileUploadHelper.java:12: cannot access
> org.apache.poi.hssf.usermodel.HSSFCell
>    [javac] bad class file:
> lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.cl
> ass)

If you're still on java 1.4, you'll want poi-jdk14-3.5-beta1-20080718.jar 
instead of poi-3.5-beta1-20080718.jar. It's in the binary download along 
with the jar you're using

Nick

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


class file has wrong version 49.0, should be 48.0

Posted by "Davanagere, Nagaraj" <Na...@umassmed.edu>.
Hi,

I had to use poi-3.5-beta1 for working with .xlsm files.
I use jdk 1.4.2

My java source compilation fails with the following exception.
    [javac] util\FileUploadHelper.java:12: cannot access
org.apache.poi.hssf.usermodel.HSSFCell
    [javac] bad class file:
lib\poi-3.5-beta1-20080718.jar(org/apache/poi/hssf/usermodel/HSSFCell.cl
ass)
    [javac] class file has wrong version 49.0, should be 48.0
    [javac] Please remove or make sure it appears in the correct
subdirectory of  the classpath.
    [javac] import org.apache.poi.hssf.usermodel.HSSFCell;
    [javac]                                      ^
    [javac] 1 error

Please let me know if we have to use only JDK 1.5 for working with
poi-3.5?

Thanks,
Nagaraj


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