You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Srinivas <sr...@yahoo.com> on 2004/10/25 09:05:42 UTC

Please Help Me....Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io.FileInputStream

Hi Guys,
 
I am using the POI in my Application and my aim is to count the line in the word document.In that purpose i wrote some code but i am getting the error like....
 
Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io
.FileInputStream
        at org.apache.poi.hpsf.PropertySet.isPropertySetStream(PropertySet.java:
332)
        at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:244)
        at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java
:59)
        at LineCount.main(LineCount.java:21)

 
and the Code is .....
 
           InputStream ins=new FileInputStream(args[0]);
            PropertySet ps=PropertySetFactory.create(ins);
            DocumentSummaryInformation dsi=new DocumentSummaryInformation(ps);
            System.out.println("No fo Lines in the Word Document  "+ args[0]+"  is " +dsi.getLineCount());
 
I don't know where is the error in my code ....Please tell me...
 
Advanced Thanks and waiting for ur replay...
 
Srinivas
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Please Help Me....Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io.FileInputStream

Posted by Srinivas <sr...@yahoo.com>.
Hi Rainer,
 
Thank you for your time and consideration and now i am sending my ReadTile.java and geeting exception to U ..Please send me the answer ....
 
 *
 * @author Rainer Klute (klute@rainer-klute.de)
 * @version $Id: ReadTitle.java,v 1.2 2003/02/20 17:51:37 klute Exp $
 * @since 2003-02-01
 */
public class ReadTitle
{
    public static void main(String[] args) throws IOException
    {
        final String filename = args[0];
        POIFSReader r = new POIFSReader();
        r.registerListener(new MyPOIFSReaderListener(),"\005SummaryInformation");
        r.read(new FileInputStream(filename)); ==== Here is the Line No :24--I am geeting here Error.......
    }

    static class MyPOIFSReaderListener implements POIFSReaderListener
    {
        public void processPOIFSReaderEvent(POIFSReaderEvent event)
        {
            SummaryInformation dsi = null;
            try
            {
                dsi = (SummaryInformation)PropertySetFactory.create(event.getStream());
            }
            catch (Exception ex)
            {
                throw new RuntimeException ("Property set stream \"" +event.getPath() + event.getName() + "\": " + ex);
            }
            final String title = dsi.getTitle();
            if (title != null)
                System.out.println("Title: \"" + title + "\"");
            else
                System.out.println("Document has no title.");
        }
    }
  }
 
 
and here is the Error i am getting on my console .....
 
Exception in thread "main" java.lang.RuntimeException: Property set stream "\#9827;Su
mmaryInformation": java.io.UnsupportedEncodingException: cp1252
        at ReadTitle$MyPOIFSReaderListener.processPOIFSReaderEvent(ReadTitle.jav
a:39)
        at org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(PO
IFSReader.java:260)
        at org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.jav
a:96)
        at ReadTitle.main(ReadTitle.java:24)=======
 
 
Please Tell me the Error where i am getting now....
I am waiting for your replay....
 
Thank you for replay...
Srinivas

Rainer Klute <kl...@rainer-klute.de> wrote:
Am Di, 2004-10-26 um 15.53 schrieb Srinivas:
> Exception in thread "main" java.lang.RuntimeException: Property set stream "\#9827;Su
> mmaryInformation": java.lang.ClassCastException: org.apache.poi.hpsf.PropertySet
> at ReadTitle$MyPOIFSReaderListener.processPOIFSReaderEvent(ReadTitle.jav
> a:39)
> at org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(PO
> IFSReader.java:260)
> at org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.jav
> a:96)
> at ReadTitle.main(ReadTitle.java:24)
> 
> This is the Error I am getting here ...

I don't know how your program looks like now, but the name
"\#9827;SummaryInformation" is definetely wrong. It must be
"\005SummaryInformation" - see the documentation.

Best regards
Rainer Klute

Rainer Klute IT-Consulting GmbH
Dipl.-Inform.
Rainer Klute E-Mail: klute@rainer-klute.de
K�rner Grund 24 Telefon: +49 172 2324824
D-44143 Dortmund Telefax: +49 231 5349423

Inhibit software patents: http://www.nosoftwarepatents.com/


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


		
---------------------------------
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.

Re: Please Help Me....Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io.FileInputStream

Posted by Rainer Klute <kl...@rainer-klute.de>.
Am Di, 2004-10-26 um 15.53 schrieb Srinivas:
> Exception in thread "main" java.lang.RuntimeException: Property set stream "\#9827;Su
> mmaryInformation": java.lang.ClassCastException: org.apache.poi.hpsf.PropertySet
>         at ReadTitle$MyPOIFSReaderListener.processPOIFSReaderEvent(ReadTitle.jav
> a:39)
>         at org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(PO
> IFSReader.java:260)
>         at org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.jav
> a:96)
>         at ReadTitle.main(ReadTitle.java:24)
> 
> This is the Error I am getting here ...

I don't know how your program looks like now, but the name
"\#9827;SummaryInformation" is definetely wrong. It must be
"\005SummaryInformation" - see the documentation.

Best regards
Rainer Klute

                           Rainer Klute IT-Consulting GmbH
  Dipl.-Inform.
  Rainer Klute             E-Mail:  klute@rainer-klute.de
  Körner Grund 24          Telefon: +49 172 2324824
D-44143 Dortmund           Telefax: +49 231 5349423

Inhibit software patents: http://www.nosoftwarepatents.com/


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


Re: Please Help Me....Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io.FileInputStream

Posted by Srinivas <sr...@yahoo.com>.
Thank U Rainer for replay to me and follow the instructions u have to specified the URL but i am getting this error like....
 
Exception in thread "main" java.lang.RuntimeException: Property set stream "\#9827;Su
mmaryInformation": java.lang.ClassCastException: org.apache.poi.hpsf.PropertySet
        at ReadTitle$MyPOIFSReaderListener.processPOIFSReaderEvent(ReadTitle.jav
a:39)
        at org.apache.poi.poifs.eventfilesystem.POIFSReader.processProperties(PO
IFSReader.java:260)
        at org.apache.poi.poifs.eventfilesystem.POIFSReader.read(POIFSReader.jav
a:96)
        at ReadTitle.main(ReadTitle.java:24)

This is the Error I am getting here ...
 
Please replay to this Mail ....
I am waiting for ur replay..
 
Thanks
Srinivas

Rainer Klute <kl...@rainer-klute.de> wrote: 
Am Mo, 2004-10-25 um 09.05 schrieb Srinivas:
> I am using the POI in my Application and my aim is to count the line in the word document.In that purpose i wrote some code but i am getting the error like....
> 
> Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io
> .FileInputStream
> at org.apache.poi.hpsf.PropertySet.isPropertySetStream(PropertySet.java:
> 332)
> at org.apache.poi.hpsf.PropertySet.(PropertySet.java:244)
> at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java
> :59)
> at LineCount.main(LineCount.java:21)
> 
> 
> and the Code is .....
> 
> InputStream ins=new FileInputStream(args[0]);
> PropertySet ps=PropertySetFactory.create(ins);
> DocumentSummaryInformation dsi=new DocumentSummaryInformation(ps);
> System.out.println("No fo Lines in the Word Document "+ args[0]+" is " +dsi.getLineCount());
> 
> I don't know where is the error in my code ....Please tell me...

You should RTFM (Read The Fine Manual) available under
and study the examples
under src/examples/src/org/apache/poi/hpsf/examples, e.g.
ReadTitle.java. The first thing you will find out is that you cannot
create a PropertySet as you are trying to do it.

Best regards
Rainer Klute

Rainer Klute IT-Consulting GmbH
Dipl.-Inform.
Rainer Klute E-Mail: klute@rainer-klute.de
Körner Grund 24 Telefon: +49 172 2324824
D-44143 Dortmund Telefax: +49 231 5349423

Inhibit software patents: http://www.nosoftwarepatents.com/


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



Yahoo! India Matrimony: Find your partner online.

Re: Please Help Me....Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io.FileInputStream

Posted by Rainer Klute <kl...@rainer-klute.de>.
Am Mo, 2004-10-25 um 09.05 schrieb Srinivas:
> I am using the POI in my Application and my aim is to count the line in the word document.In that purpose i wrote some code but i am getting the error like....
>  
> Exception in thread "main" org.apache.poi.hpsf.MarkUnsupportedException: java.io
> .FileInputStream
>         at org.apache.poi.hpsf.PropertySet.isPropertySetStream(PropertySet.java:
> 332)
>         at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:244)
>         at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java
> :59)
>         at LineCount.main(LineCount.java:21)
> 
>  
> and the Code is .....
>  
>            InputStream ins=new FileInputStream(args[0]);
>             PropertySet ps=PropertySetFactory.create(ins);
>             DocumentSummaryInformation dsi=new DocumentSummaryInformation(ps);
>             System.out.println("No fo Lines in the Word Document  "+ args[0]+"  is " +dsi.getLineCount());
>  
> I don't know where is the error in my code ....Please tell me...

You should RTFM (Read The Fine Manual) available under
<http://jakarta.apache.org/poi/hpsf/how-to.html> and study the examples
under src/examples/src/org/apache/poi/hpsf/examples, e.g.
ReadTitle.java. The first thing you will find out is that you cannot
create a PropertySet as you are trying to do it.

Best regards
Rainer Klute

                           Rainer Klute IT-Consulting GmbH
  Dipl.-Inform.
  Rainer Klute             E-Mail:  klute@rainer-klute.de
  Körner Grund 24          Telefon: +49 172 2324824
D-44143 Dortmund           Telefax: +49 231 5349423

Inhibit software patents: http://www.nosoftwarepatents.com/


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