Hello,

I think the problem here is that you are using the same filePath for
opening and saving the file.
You need an InputStream for read and work with your file, but this
stream becames unaccessible when you create an
OutputStream under the same path and file name.
I think the solution is to make a copy (say myFile.tmp) before start
working, open the copy to work, save in the original path
(myFile.xslx) and delete the copy.

Regards.


On Mon, Nov 29, 2010 at 5:58 AM, Troll <[email protected]> wrote:
>
> yes, even if i didn't change file: just open and save i get anyway
>
> SEVERE: java.io.IOException: Can't obtain the input stream from
> /docProps/app.xml
> org.apache.poi.POIXMLException: java.io.IOException: Can't obtain the input
> stream from /docProps/app.xml
>        at org.apache.poi.POIXMLDocument.getProperties(POIXMLDocument.java:172)
>        at org.apache.poi.POIXMLDocument.write(POIXMLDocument.java:208)
>        at bc.Converter.deleteAsposeSheet(Converter.java:131)
>        at bc.Converter.convertToRawData(Converter.java:55)
>        at bc.SchedulerEvent$1.run(SchedulerEvent.java:50)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at bc.SchedulerEvent.run(SchedulerEvent.java:36)
>        at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
>        at
> java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)
>        at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)
>        at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.IOException: Can't obtain the input stream from
> /docProps/app.xml
>        at
> org.apache.poi.openxml4j.opc.PackagePart.getInputStream(PackagePart.java:468)
>        at org.apache.poi.POIXMLProperties.<init>(POIXMLProperties.java:75)
>        at org.apache.poi.POIXMLDocument.getProperties(POIXMLDocument.java:170)
>        ... 15 more
>
>
> --
> View this message in context: 
> http://apache-poi.1045710.n5.nabble.com/Can-t-obtain-the-input-stream-from-docProps-app-xml-tp3284222p3284276.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
ちりも積もれば山となる

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to