Standardizer exception

User 870ab5b546

17-07-2014 19:40:52

Getting an exception when starting up a Standardizer object in JChem 14.7.14.0:


Jul 17, 2014 3:36:47 PM chemaxon.naming.n2s.CASNumberConverter <clinit>
WARNING: Exception while loding cache
java.io.IOException: Cannot create parent directory
at chemaxon.util.DotfileUtil.ensureParentExists(DotfileUtil.java:165)
at chemaxon.util.DotfileUtil.getDotFileWithEnsuredPath(DotfileUtil.java:78)
at chemaxon.naming.n2s.CASNumberConverter.<clinit>(CASNumberConverter.java:43)
at chemaxon.formats.recognizer.NameRecognizer.isSurelyName(NameRecognizer.java:173)
at chemaxon.formats.recognizer.NameRecognizer.evaluateName(NameRecognizer.java:111)
at chemaxon.formats.recognizer.NameRecognizer.isNameLine(NameRecognizer.java:96)
at chemaxon.formats.recognizer.NameRecognizer.tryToRecognize(NameRecognizer.java:57)
at chemaxon.formats.recognizer.RecognitionSubsystem.processLine(RecognitionSubsystem.java:153)
at chemaxon.formats.recognizer.RecognitionSubsystem.processLine(RecognitionSubsystem.java:114)
at chemaxon.formats.MolInputStream.processLine(MolInputStream.java:334)
at chemaxon.formats.MolInputStream.initTextFormat(MolInputStream.java:246)
at chemaxon.formats.MolInputStream.init(MolInputStream.java:136)
at chemaxon.formats.MolInputStream.<init>(MolInputStream.java:116)
at chemaxon.formats.MolImporter.init(MolImporter.java:542)
at chemaxon.formats.MolImporter.<init>(MolImporter.java:118)
at chemaxon.standardizer.advancedactions.StripSaltsAction.readSaltDictionary(StripSaltsAction.java:309)
at chemaxon.standardizer.advancedactions.StripSaltsAction.<clinit>(StripSaltsAction.java:65)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at chemaxon.standardizer.StandardizerActionFactory.getStandardizerAction(StandardizerActionFactory.java:231)
at chemaxon.standardizer.StandardizerActionFactory.getAvailableStandardizerActions(StandardizerActionFactory.java:184)
at chemaxon.standardizer.configuration.reader.StandardizerSAXHandler.initializeMap(StandardizerSAXHandler.java:112)
at chemaxon.standardizer.configuration.reader.StandardizerSAXHandler.<init>(StandardizerSAXHandler.java:101)
at chemaxon.standardizer.configuration.reader.StandardizerSAXHandler.<init>(StandardizerSAXHandler.java:78)
at chemaxon.standardizer.configuration.reader.StandardizerXMLReader.<init>(StandardizerXMLReader.java:77)
at chemaxon.standardizer.Standardizer.<init>(Standardizer.java:204)
at com.epoch.servlet.GroupLoader.loadAppConfig(GroupLoader.java:125)

User 870ab5b546

17-07-2014 19:46:03

The line of code that is eliciting the error is:


AppConfig.standardizer =
new Standardizer(new File(normalizeConfigFile));

The contents of normalizeConfigFile are:


<?xml version="1.0" encoding="UTF-8"?>
<!-- Standardizer configuration file -->

<StandardizerConfiguration Version ="0.1">
<Actions>
<Transformation ID="S_or_Se_ylide_double"
Structure="[#16,#34;++:1]-[#34,#16,#8,#7,#6;-:2]>>[#16,#34;+:1]=[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="S_or_Se_ylide_double"
Structure="[#16,#34;+:1]-[#34,#16,#8,#7,#6;-:2]>>[#16,#34;0:1]=[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="S_or_Se_ylide_triple"
Structure="[#16,#34;++:1]=[#34,#16,#8,#7,#6;-:2]>>[#16,#34;+:1]#[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="S_or_Se_ylide_triple"
Structure="[#16,#34;+:1]=[#34,#16,#8,#7,#6;-:2]>>[#16,#34;0:1]#[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="N_or_P_or_As_ylide_double"
Structure="[#7,#15,#33;+:1]-[#34,#16,#8,#7,#6;-:2]>>[#7,#15,#33;0:1]=[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="N_or_P_or_As_ylide_triple"
Structure="[#7,#15,#33;+:1]=[#34,#16,#8,#7,#6;-:2]>>[#7,#15,#33;0:1]#[#34,#16,#8,#7,#6:2]"/>
<Transformation ID="N_or_P_or_As_dianion_ylide_double"
Structure="[#7,#15,#33;+:1]-[#34,#16,#8,#7,#6;--:2]>>[#7,#15,#33;0:1]=[#34,#16,#8,#7,#6;-:2]"/>
</Actions>
</StandardizerConfiguration>

User 870ab5b546

17-07-2014 19:51:51

Interestingly, when I change the code to try to catch the IOException, then when I compile, I get this error:


GroupLoader.java:127: exception java.io.IOException is never thrown in body of corresponding try statement
} catch (IOException e) {
^
GroupLoader.java:139: exception java.io.IOException is never thrown in body of corresponding try statement
} catch (IOException e) {
^

Seems pretty clear that the line is throwing an IOException, so why won't it let me catch it?.


So then I changed the code to catch a generic exception. It compiles now, but it still doesn't catch the exception when the program starts up.


I think I have done all I can do to solve this problem.

ChemAxon e08c317633

18-07-2014 10:02:54

Bob, it's not an exception thrown from Standardizer code, it's a stack trace printed by chemaxon.naming.n2s.CASNumberConverter. Standardizer ignores it on purpose: it's absolutely not relevant there.


Just ignore this printed message. We will find less confusing ways to display such warnings.