You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Gascoigne Thomas <ga...@AXXIA.com> on 2006/05/17 13:30:42 UTC
Exception creating HWPFDocument
I'm just trying to start testing some poi functionality but am falling
at the first hurdle:
try
{
InputStream in = new FileInputStream(INPUT_FILE);
HWPFDocument doc = new HWPFDocument(in);
}
The exception is:
java.lang.NoSuchMethodError:
org.apache.poi.hwpf.model.TextPiece.getCP()I
at
org.apache.poi.hwpf.model.SectionTable.CPtoFC(SectionTable.java:103)
at
org.apache.poi.hwpf.model.SectionTable.<init>(SectionTable.java:70)
at
org.apache.poi.hwpf.HWPFDocument.<init>(HWPFDocument.java:164)
at
com.axxia.poi.test.POIWordDocTest.testTextExtraction(POIWordDocTest.java
:24)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at
junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTe
stRunner.java:478)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRun
ner.java:344)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRu
nner.java:196)
Anybody know what I'm doing wrong? Would also appreciate some example
code that shows the basics of reading in a Word document and outputting
it as a (text) string.
Thanks, Thomas.
**********************************************************************
The information in this e-mail and any attachment is confidential.
It is intended only for the named recipient(s). If you are not a
named recipient please notify the sender immediately and do not
disclose the contents to another person or take copies. Although
Axxia Systems has taken every reasonable precaution to ensure
that any attachment to this e-mail has been checked for viruses,
it is strongly recommended that you carry out your own virus
check before opening any attachment, as we cannot accept
liability for any damage sustained as a result of software virus
infection. Axxia Systems reserves the right and senders of
messages shall be taken to consent to the monitoring and
recording of e-mails addressed to axxia.com.
**********************************************************************
Re: Exception creating HWPFDocument
Posted by Nick Burch <ni...@torchbox.com>.
On Wed, 17 May 2006, Gascoigne Thomas wrote:
> I'm just trying to start testing some poi functionality but am falling
> at the first hurdle:
>
> java.lang.NoSuchMethodError:
> org.apache.poi.hwpf.model.TextPiece.getCP()I
I would suspect that you have some sort of mis-match between your POI jar
files. Make sure you have the latest ones, and only the latest ones on
your classpath
> Would also appreciate some example code that shows the basics of reading
> in a Word document and outputting it as a (text) string.
Just use this:
http://jakarta.apache.org/poi/apidocs/org/apache/poi/hwpf/extractor/WordExtractor.html
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List: http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/