I got the svn copy and successfully build the source in netbeans.
Now i am running cdk with org.openscience.cdk.applications.FingerPrinter as
a main class.
i have provided the argument as "E:\Model\acetone.MOL"
while running i got this error
E:\Model\acetone.MOL: error=
java.lang.NullPointerException
at org.openscience.cdk.applications.FingerPrinter.main(
FingerPrinter.java:76)
then i checked the fingerPrinter.main class to see from where the error is
coming
it is coming from the highlighted area.
Means the reader is null.
IChemObjectReader reader = new ReaderFactory().createReader(new
FileReader(input));
why this is happening.
try {
File input = new File(ifilename);
if(input.exists()){
System.out.println("File is Alive");
}
if (!input.isDirectory()) {
IChemObjectReader reader = new
ReaderFactory().createReader(new FileReader(input));
if (reader.accepts(Molecule.class)) {
ChemFile content =
(ChemFile)reader.read((ChemObject)new ChemFile());
List containersList =
ChemFileManipulator.getAllAtomContainers(content);
if (containersList.size() > 0) {
for (int j = 0; j < containersList.size(); j++)
{
String print = fingerprinter.getFingerprint
((IAtomContainer)containersList.get(j)).toString();
System.out.println(ifilename + " ("+ j +"):
fingerprint=" + print);
}
}
}
}
} catch (Exception exception) {}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
strange,
then i changed the code to
Reader rr = new BufferedReader(new FileReader(input));
IChemObjectReader reader = new ReaderFactory().createReader(rr);
but all the way the reader is coming empty.I have checked the existance of
file it is present.
the same code is running well with the other jars.
what could be the error and how can i solve it.
please help..
--
********************************
sushil ronghe
Center of Pharmacoinformatics
India
*********************************
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Cdk-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cdk-user