Can't import the same file twice in Welcome window

Bug #598157 reported by Sébastien Heymann
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Gephi
Fix Released
Low
Unassigned
0.7
Fix Released
Low
Unassigned

Bug Description

Way to reproduce:
* Launch Gephi
* Open Les_Miserable.gexf from the Welcome window
* Open this window again and try to import the same file.

[Fatal Error] :1:1: Premature end of file.
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Impossible to parse the given XML file
        at org.gephi.desktop.importer.DesktopImportControllerUI$5.run(DesktopImportControllerUI.java:189)
        at org.gephi.utils.longtask.api.LongTaskExecutor$RunningLongTask.run(LongTaskExecutor.java:228)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
        at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
        at java.util.concurrent.FutureTask.run(FutureTask.java:138)
        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:619)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Impossible to parse the given XML file
        at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:132)
        at org.gephi.desktop.importer.DesktopImportControllerUI$5.run(DesktopImportControllerUI.java:183)
        ... 7 more
Caused by: java.lang.RuntimeException: Impossible to parse the given XML file
        at org.gephi.io.importer.api.ImportUtils.getXMLDocument(ImportUtils.java:96)
        at org.gephi.io.importer.plugin.file.ImporterGEXF.execute(ImporterGEXF.java:103)
        at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:113)
        at org.gephi.io.importer.impl.ImportControllerImpl.importFile(ImportControllerImpl.java:130)
        ... 8 more

Tags: import
Changed in gephi:
milestone: none → 0.7alpha4
importance: Undecided → Low
Revision history for this message
Christian Tominski (ct-informatik) wrote :

The problem is that when the stream is read for the second time, it is at the EOF. A solution is to simply call stream.reset() before starting the import.

Revision history for this message
Eduardo Ramos (eduramiba) wrote :

Thanks for the patch, the fix is now commited.

Changed in gephi:
status: New → Fix Committed
Changed in gephi:
status: Fix Committed → Fix Released
Revision history for this message
Sébastien Heymann (sebastien.heymann) wrote :

I re-open this bug, as the fix is no longer valid in Gephi 0.7beta.

It is still a premature end of file.

Changed in gephi:
milestone: 0.7alpha4 → 0.7beta
milestone: 0.7beta → 0.7alpha4
tags: added: import
Changed in gephi:
status: Fix Released → Confirmed
Revision history for this message
Sébastien Heymann (sebastien.heymann) wrote :

Can't reproduce this bug again, it may have been solved recently on the fly...

Changed in gephi:
status: Confirmed → Fix Committed
Revision history for this message
Christian Tominski (ct-informatik) wrote :

I've checked again. The bug is solved indeed, the stream is reset to avoid EOF when reading a file for the second time.

Changed in gephi:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.