GraphStream Users

Archives de la liste Aide


Re: FileSinkGEFX NullPointerException


Chronologique Discussions 
  • From: guilhelm savin <guilhelm.savin AT gmail.com>
  • To: "graphstream-users AT litislab.fr" <graphstream-users AT litislab.fr>, dhmhsl AT gmail.com
  • Subject: Re: FileSinkGEFX NullPointerException
  • Date: Mon, 14 Aug 2017 08:34:56 +1200

Hi,

It looks like you have attribute with a null value and the sink is not able to deal with it.
Attributes need to be declared at the beginning of the file, with their type. So the sink is going through the attributes, identifying them with their id and type. But null is not a recognized type, and this case is not handle as properly as it should.

The quickest fix you may have would be to remove null attributes before exporting with GEXF sink.

Cheers.

2017-08-14 7:51 GMT+12:00 <dhmhsl AT gmail.com>:
Hello,
I have the following code:

FileSinkBase fileOutput;
[...]
fileOutput = new FileSinkGEXF();
mGraph.getGraph().addSink(fileOutput);
fileOutput.begin(oFilename);
[...] // Populate graph
fileOutput.end();
fileOutput.flush();

The graph is created by: graph = new DefaultGraph(name, false, true);

The result of the execution (Not always) is the following:
Exception in thread "pool-1-thread-7" java.lang.NullPointerException
        at
org.graphstream.stream.file.FileSinkGEXF$GEXFAttributeMap.getID(FileSinkGEXF.java:523)
        at
org.graphstream.stream.file.FileSinkGEXF$GEXFAttributeMap.check(FileSinkGEXF.java:498)
        at
org.graphstream.stream.file.FileSinkGEXF$GEXFAttributeMap.<init>(FileSinkGEXF.java:478)
        at
org.graphstream.stream.file.FileSinkGEXF.exportGraphSpells(FileSinkGEXF.java:242)
        at
org.graphstream.stream.file.FileSinkGEXF.outputEndOfFile(FileSinkGEXF.java:113)
        at org.graphstream.stream.file.FileSinkBase.end(FileSinkBase.java:202)

The same portion of code works perfect with FileSinkDGS() and
FileSinkDOT(true);

any ideas? thank you



--
Guilhelm Savin
Computer Science PhD



Archives gérées par MHonArc 2.6.16.

Top of page