User f05f6b8c05
28-12-2010 03:22:19
Hi,
I am getting an error when running the following code in jchem 5.4.0.0 (java 1.5.0_17-b04)
Molecule mol = MolImporter.importMol("OC(C(O)C(O)=O)C(O)=O");
MolSearch s = new MolSearch();
MolSearchOptions so = new MolSearchOptions();
so.setExactFragment(true);
so.setStereoSearchType(SearchConstants.STEREO_EXACT);
s.setSearchOptions(so);
Molecule m = MolImporter.importMol("OC(C(O)C(O)=O)C(O)=O |&1:1,2,w:1.0,2.2|");
s.setTarget(mol);
s.setQuery(m);
int[][] hits = s.findAll();
if (hits!=null) {
System.out.println("found");
}
If I comment out this line:
so.setStereoSearchType(SearchConstants.STEREO_EXACT);
then I no longer get an exception.
Am I doing something incorrectly?
Thanks for any help.
The exception is:
chemaxon.sss.search.SearchException: An error occured during search:java.lang.ArrayIndexOutOfBoundsException: 64
Query:OC(C(O)C(O)=O)C(O)=O |&1:1,2,w:1.0,2.2|
Target:OC(C(O)C(O)=O)C(O)=O
Caused by:
64
at chemaxon.sss.search.MolSearch.getWrapperSearchException(MolSearch.java:697)
at chemaxon.sss.search.MolSearch.findFirstHit(MolSearch.java:732)
at chemaxon.sss.search.MolSearch.findAllHits(MolSearch.java:795)
at chemaxon.sss.search.Search.findAll(Search.java:649)
at debug.<init>(debug.java:37)
at debug.main(debug.java:18)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 64
at chemaxon.sss.search.StructureSearch.hasEnoughBondsForStereo(StructureSearch.java:4694)
at chemaxon.sss.search.StructureSearch.compareChiralities0(StructureSearch.java:5330)
at chemaxon.sss.search.StructureSearch.compareChiralities(StructureSearch.java:5196)
at chemaxon.sss.search.StructureSearch.testChiralityInTheMiddle(StructureSearch.java:5427)
at chemaxon.sss.search.StructureSearch.isCompatibleIdx(StructureSearch.java:5505)
at chemaxon.sss.search.StructureSearch.findNextSNforThisQN(StructureSearch.java:5575)
at chemaxon.sss.search.StructureSearch.findNext0(StructureSearch.java:6527)
at chemaxon.sss.search.StructureSearch.findFirst0(StructureSearch.java:6334)
at chemaxon.sss.search.StructureSearch.findFirstHit(StructureSearch.java:6288)
at chemaxon.sss.search.MolSearch.findNextEnumeratedHit(MolSearch.java:1024)
at chemaxon.sss.search.MolSearch.findNextFilteredHit(MolSearch.java:877)
at chemaxon.sss.search.MolSearch.findFirstHit(MolSearch.java:724)
... 4 more