| Author | Topic |
Posts: 2
Registered: August 2008
|
|
libSBML.so crashes (using java bindings)
|
08 Aug '08 02:22
|
 |
|
Hi,
I ran into some troubles using libSBML recently. I use the java binding and everything seemed to work fine. The problem I found occurs very unfrequently so I tried to create a reproducable setup that generates the error messages. The errors happen more often for certain files than for others. Do you think this might be a misuse of the java bindings, or maybe a bug in the c++ code?
The errors don't seem to be compile- or platform- or library(java-versions, etc)-specific. During testing, the same line of code can produce any of the error messages in the attached file named 'sbml.errrors'.
I hope following report can help you. It contains compiler options, lib versions, the java program generating the errors and a file with error messages:
//edit: the SBML model input file is now attached as well.
===========================================================
REPORT
===========================================================
Compiling:
---------------------------
I compiled with Xerces(2.7.0) and expat swig(1.3.33). And the java code was run on (java-1.5, java-1.6) on different platform (Ubuntu, XUbuntu, SuSE) and architectures (32 bit, 64 bit):
compiler options:
--with-expat --with-java --with-swig
--with-xerces --with-java --with-swig
---------------------------
Java-Code:
---------------------------
public class DefaultSBMLEngine {
public static Logger logger = Logger.getRootLogger();
static {
try {
System.out.println(System.getProperty("java.library.path"));
System.loadLibrary("sbmlj");
/* Extra check to be sure we have access to libSBML: */
Class.forName("org.sbml.libsbml.libsbml");
} catch (Exception e) {
System.err.println("Error: could not load the libSBML library");
System.exit(1);
}
}
public static void main(String[] args) {
// Initialize the logger
try {
Date d = new Date();
SimpleLayout layout = new SimpleLayout();
ConsoleAppender consoleAppender = new ConsoleAppender(layout);
logger.addAppender(consoleAppender);
FileAppender fileAppender =
new FileAppender(layout, d.getTime() + "sbmlengine.log", false);
logger.addAppender(fileAppender);
logger.setLevel(Level.DEBUG);
logger.info("Program started at:\t" + DateFormat.getInstance().format(d));
} catch (Exception ex) {
System.out.println(ex);
}
testLibSBML();
}
public static void testLibSBML() {
// SBML Model
String interactionType = "";
File f = null;
String pathId = null;
boolean subtype = false;
for (int i = 0; i < 1000; i++) {
Model model = null;
SBMLReader sbmlreader = new SBMLReader();
ListOfSpecies listSpec = new ListOfSpecies();
ListOfReactions listReac = new ListOfReactions();
try {
model = (sbmlreader.readSBMLInternal("Integrin_signalling_pathway.xml")).getModel();
listSpec = model.getListOfSpecies();
listReac = model.getListOfReactions();
// get the pathname
pathId = model.getId();
// iterate species
for (long count_s = 0; count_s < listSpec.size(); count_s++) {
Species s = new Species();
XMLNode notes = null;
s = (Species)listSpec.get(count_s);
notes = s.getNotes();
String strNotes1 = XMLNode.convertXMLNodeToString(notes);
}
// iterate reac
for (long count_s = 0; count_s < listReac.size(); count_s++) {
Reaction r = new Reaction();
r = (Reaction)listReac.get(count_s);
XMLNode a = r.getAnnotation();
String annot = XMLNode.convertXMLNodeToString(a.getChild(0));
}
sbmlreader.delete();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
[Updated on: 09 Aug '08 03:07]
|
|
|