You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by teena21 <fr...@yahoo.com> on 2008/03/06 12:43:11 UTC

Error in HWPF

I m new in hwpf and i want to read a word document for this i am using POI
APIs HWPF

my code is this

HWPFDocument doc = new HWPFDocument (new FileInputStream (args[0]));
Range r = doc.getRange();

System.out.println("Example you supplied:");
System.out.println("--------------­ -------");
for (int x = 0; x < r.numSections(); x++)
{
Section s = r.getSection(x);
for (int y = 0; y < s.numParagraphs(); y++)
{
Paragraph p = s.getParagraph(y);
for (int z = 0; z < p.numCharacterRuns(); z++)
{

CharacterRun run = p.getCharacterRun(z);

String text = run.text();

System.out.print(text);
}

System.out.println();
}
}

but this code gives an error at run time

java.lang.NoClassDefFoundError: org/apache/poi/hpsf/WritingNotSupp­
ortedException

plz help me to remove this problem
i had import all HWPF APIs
-- 
View this message in context: http://www.nabble.com/Error-in-HWPF-tp15871377p15871377.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: Error in HWPF

Posted by Nick Burch <ni...@torchbox.com>.
On Thu, 6 Mar 2008, teena21 wrote:
> my POI  is poi-scratchpad-3.0-rc4-20070503

You'll have a main poi jar too, which is almost certainly older

> can u give me a Link from where i can download new POI version

http://poi.apache.org/
on the left hand side, click the "download link"
http://www.apache.org/dyn/closer.cgi/poi/
pick your mirror
download the binary package, and the source one too if you want to debug

Nick

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


Re: Error in HWPF

Posted by teena21 <fr...@yahoo.com>.
my POI  is poi-scratchpad-3.0-rc4-20070503 


can u give me a Link from where i can download new POI version 


Nick Burch wrote:
> 
> On Thu, 6 Mar 2008, teena21 wrote:
>> but this code gives an error at run time
>>
>> java.lang.NoClassDefFoundError: org/apache/poi/hpsf/WritingNotSupp­
>> ortedException
> 
> You almost certainly have an older version of the main poi jar on your 
> classpath (2.5.x is my guess). Make sure you're only using a consistent 
> set of the main poi and scratchpad jars
> 
> Nick
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
> 

-- 
View this message in context: http://www.nabble.com/Error-in-HWPF-tp15871377p15889706.html
Sent from the POI - User mailing list archive at Nabble.com.


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


Re: Error in HWPF

Posted by Nick Burch <ni...@torchbox.com>.
On Thu, 6 Mar 2008, teena21 wrote:
> but this code gives an error at run time
>
> java.lang.NoClassDefFoundError: org/apache/poi/hpsf/WritingNotSupp­
> ortedException

You almost certainly have an older version of the main poi jar on your 
classpath (2.5.x is my guess). Make sure you're only using a consistent 
set of the main poi and scratchpad jars

Nick