No Structure, java.lang.ArrayIndexOutOfBoundsException

User 366e966a35

26-11-2013 09:59:32

Hello!

    I'm facing the following issue with the JChem cartridge v5.4.0.1: when an attempt is made to handle a reaction consisting of a "No Structure" reactant and a "No Structure" product, a java.lang.ArrayIndexOutOfBoundsException is thrown.

    The code to handle the structure is:


ConnectionHandler ch = new ConnectionHandler();
ch.setConnection(...);
UpdateHandler uh = new UpdateHandler(ch, UpdateHandler.INSERT, ..., null);
uh.setEmptyStructuresAllowed(true);
uh.setDuplicateFiltering(UpdateHandler.DUPLICATE_FILTERING_ON);
uh.setStructure(drawing);
int id = uh.execute(true);


    The stacktrace is:


java.lang.ArrayIndexOutOfBoundsException: -1
    at chemaxon.reaction.Reaction.setReaction(Reaction.java:1032)
    at chemaxon.descriptors.RFGenerator.createReactionCenterFingerprint(RFGenerator.java:147)
    at chemaxon.descriptors.RFGenerator.generate(RFGenerator.java:105)
    at chemaxon.descriptors.RFParameters.generate(RFParameters.java:192)
    at chemaxon.descriptors.ReactionFingerprint.generate(ReactionFingerprint.java:386)
    at chemaxon.sss.screen.CombinedFingerprint.getReactionFingeprints(CombinedFingerprint.java:481)
    at chemaxon.sss.screen.CombinedFingerprint.getCombinedFingerprints(CombinedFingerprint.java:430)
    at chemaxon.jchem.db.UpdateHandler.getFingerprints(UpdateHandler.java:1091)
    at chemaxon.jchem.db.UpdateHandler.init(UpdateHandler.java:1166)
    at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:2270)


    Is it a known issue that is fixed in recent JChem releases?


Thank you!

ChemAxon d4fff15f08

26-11-2013 16:53:41

Hi!


 


Before answering your question I just want to clarify, by "No Structure" you mean an empty structure?


 


Thanks,


Norbert

User 366e966a35

26-11-2013 17:57:04

Hello Norbert!


    Yes, an empty structure.


Thank you.

ChemAxon d4fff15f08

27-11-2013 14:18:29

Hi Leonid,


 


I have tried to reproduce the problem, but could not succeed. 


Would you be so kind to attach the file containing the reaction (drawing)? In case you don't want to attach the file (because of confidentiality reasons or anything else) you can send it via e-mail to jcb-support at chemaxon.com.


It would also help us if you could try to insert the structure into a DB using JChem Manager, and send the error message if exists. In case you are not familiar with JChem Manager, you may find some information about it here: https://www.chemaxon.com/jchem/doc/admin/ but we are also available if you may have any question regarding it.


Thanks in advance,


Norbert

User 366e966a35

27-11-2013 17:56:19

Hello Norbert!


    In the attachment you'll find the reaction that causes the exception. I also tried to import it using JChem Manager - the result is the same.


java.util.concurrent.ExecutionException: chemaxon.util.concurrent.processors.WorkUnitException: java.lang.ArrayIndexOutOfBoundsException: -1
        at chemaxon.util.concurrent.processors.WorkUnitData.getResult(Unknown Source)
        at chemaxon.util.concurrent.processors.ScheduledWorkUnitData.getResult(Unknown Source)
        at chemaxon.util.concurrent.processors.WorkUnitDataIterator.getNext(Unknown Source)
        at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:365)
        at chemaxon.jchem.db.FileToSQLHandler.importFile(FileToSQLHandler.java:129)
        at chemaxon.jchem.gui.Importer.run(Importer.java:156)
        at java.lang.Thread.run(Unknown Source)
Caused by: chemaxon.util.concurrent.processors.WorkUnitException: java.lang.ArrayIndexOutOfBoundsException: -1
        at chemaxon.util.concurrent.processors.InputOrderedWorkUnitProcessor.process(Unknown Source)
        at chemaxon.util.concurrent.processors.InputOrderedWorkUnitProcessor.processInput(Unknown Source)
        at chemaxon.util.concurrent.processors.WorkUnitWorker.work0(Unknown Source)
        at chemaxon.util.concurrent.processors.WorkUnitWorker.work(Unknown Source)
        at chemaxon.util.concurrent.worker.Worker$1.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at chemaxon.util.concurrent.worker.Worker.run(Unknown Source)
        at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
        at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        ... 1 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: -1
        at chemaxon.reaction.Reaction.setReaction(Reaction.java:1032)
        at chemaxon.descriptors.RFGenerator.createReactionCenterFingerprint(RFGenerator.java:147)
        at chemaxon.descriptors.RFGenerator.generate(RFGenerator.java:105)
        at chemaxon.descriptors.RFParameters.generate(RFParameters.java:192)
        at chemaxon.descriptors.ReactionFingerprint.generate(ReactionFingerprint.java:386)
        at chemaxon.sss.screen.CombinedFingerprint.getReactionFingeprints(CombinedFingerprint.java:481)
        at chemaxon.sss.screen.CombinedFingerprint.getCombinedFingerprints(CombinedFingerprint.java:430)
        at chemaxon.jchem.db.UpdateHandler.getFingerprints(UpdateHandler.java:1091)
        at chemaxon.jchem.db.UpdateHandler.init(UpdateHandler.java:1166)
        at chemaxon.jchem.db.UpdateHandler.createRowData(UpdateHandler.java:3270)
        at chemaxon.jchem.db.UpdateHandler.createRowData(UpdateHandler.java:3250)
        at chemaxon.jchem.db.ParallelStructTableUpdater$UpdateHandlerAdapter.process(ParallelStructTableUpdater.java:121)
        at chemaxon.util.concurrent.util.AbstractWorkUnit.call(Unknown Source)
        ... 14 more
chemaxon.util.ChemaxonException: chemaxon.jchem.db.TransferException: chemaxon.util.concurrent.processors.WorkUnitException: java.lang.ArrayIndexOutOfBoundsException: -1
Caused by:
chemaxon.util.concurrent.processors.WorkUnitException: java.lang.ArrayIndexOutOfBoundsException: -1
        at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:477)
        at chemaxon.jchem.db.FileToSQLHandler.importFile(FileToSQLHandler.java:129)
        at chemaxon.jchem.gui.Importer.run(Importer.java:156)
        at java.lang.Thread.run(Unknown Source)
Caused by: chemaxon.jchem.db.TransferException: chemaxon.util.concurrent.processors.WorkUnitException: java.lang.ArrayIndexOutOfBoundsException: -1
        at chemaxon.jchem.db.ParallelStructTableUpdater.importFile(ParallelStructTableUpdater.java:467)
        ... 3 more

Thank you.

ChemAxon d4fff15f08

28-11-2013 10:50:37

Hi Leonid,


 


Thank you for your help. With the file attached I could reproduce the problem, which was fixed in version 5.8.0. So the current versions do handle such files correctly.


 


Thanks for your effort again!


Norbert

User 366e966a35

29-11-2013 09:52:06

Hello Norbert!


    Thank you for your assistance! I checked the issue with the JChem cartridge v5.8.2 and found it fixed.

ChemAxon d4fff15f08

29-11-2013 10:29:03

Hi Leonid,


 


You are welcome!


I am just interested why you move to a relative old version of JChem and not really considering upgrading to the latest 6.1.3. Any feedback on this would be really valuable for us.


 


Thanks in advance.


Norbert

User 366e966a35

29-11-2013 18:57:24

Hello Norbert!



    JChem cartridge v5.4 is the officially supported JChem version by our application for the time being; effort and gain of migration to the latest version is to be considered.


Thank you.

ChemAxon d4fff15f08

30-11-2013 08:15:01

OK, thanks for the information.