# Java Error on duplicate import

User fa2b982dc8

16-12-2008 22:39:27

Hi, can anyone help me understand the duplicate filtering on import in Instant JChem 2.4?

I was given an sdf file that included a few duplicates and I wanted the import process to weed these out. I did a file import into a new JChemBase entity with the "Duplicate filtering" flag checked in the advanced options.

It begins the import and then errors with the following java error:
 Quote: java.lang.NullPointerException at com.im.ijc.io.api.ErrorWriter.getErrorFile(ErrorWriter.java:138) at com.im.ijc.io.api.ErrorWriter.getErrorWriter(ErrorWriter.java:85) at com.im.ijc.io.api.ErrorWriter.write(ErrorWriter.java:63) at com.im.ijc.io.formats.StructureFileParser$Parser.writeCurrentRecordAsError(StructureFileParser.java:283) at com.im.ijc.io.quickimport.QuickImportWizardIterator.processError(QuickImportWizardIterator.java:897) at com.im.ijc.io.quickimport.QuickImportWizardIterator.loadData(QuickImportWizardIterator.java:776) at com.im.ijc.io.quickimport.QuickImportWizardIterator.access$100(QuickImportWizardIterator.java:91) at com.im.ijc.io.quickimport.QuickImportWizardIterator$2.run(QuickImportWizardIterator.java:547) at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986) The import window behind the java error reports:  Quote: Structure is mapped to current field Structure Starting to import data... Warning: Structure 63 not imported. It is a duplicate of CD_ID 53 in the database. Warning: Failed to import row 63: null At this point, I'm given the option to Finish or Cancel, but both lead to the same result of a table created with the first 62 chemicals in the sdf only. I *did* once find a method for import that led to a full table creation with the duplicates saved in a new file (in the same directory as the input file) that was called ORIG-FILENAME_duplicates.sdf...but I can not find that method any more. Any ideas? Thanks! --Karl ChemAxon fa971619eb 17-12-2008 08:25:47 This is a known problem on Windows when the file that is being imported is accessed through a UNC (e.g. \\drive\path\to\file network drive) rather than a disk mapped to a letter (e.g. C:). In this case writing the file containing the duplicates fails. This problem is fixed in the upcoming 2.4.1 update, but in the meantime the workaroud is to copy the file that is to be imported to a drive that is mapped to a letter (e.g copy it to your C: drive). That way the duplicates file is written OK. Let me know if this doesn't work. Tim User fa2b982dc8 17-12-2008 15:02:13 Yes, that turns out to have been the problem. Thanks for the help. The file is on a mapped drive but the file selection browser was referencing it as the double slash directory instead of the mapped style. Once I forced it to navigate to the file as a mapped drive (H:), everything went as expected originally. ChemAxon fa971619eb 17-12-2008 15:06:02 OK, thanks for the feedback. As I mentioned, this workaround should not be necessary with 2.4.1. Tim ChemAxon fa971619eb 26-12-2008 09:36:38 As mentioned, this problem is now fixed in IJC 2.4.1, so the workaround should no longer be necessary. Tim User 550505e3de 05-01-2009 22:59:04 Hello, After updating to the latest Instant JChem build, I received a different java.lang.NullPointerException error: "JChem has detected that some tables were created with an older version of JChem, and log tables should be created for them to be usable with this version. Do you want JChem to create these log tables now? Before you select YES, please stop all other JChem applications. NOTE: You must have the CREATE TABLE right for this. Tables affected: APP.ZINC_LEADLIKE" After selecting YES to proceed with the update, IJC stalls with database initialization in progress. I would be happy to delete the offending table, but cannot connect to the database. Any alternative solutions? Corey HARDWARE/SOFTWARE: Windows XP SP2 Dell Inspiron 9300 Instant JChem Version: 2.4.1 (build: 081222) JChem Version: 5.1.4 JChem Table Version: 50103 Marvin Version: 5.1.4 (build date: 2008-12-18) Java: 1.6.0_05; Java HotSpot(TM) Client VM 10.0-b19 System: Windows XP version 5.1 running on x86; Cp1252; en_US (instantjchem) NetBeans build: 200711261600 Userdir: C:\Documents and Settings\Corey\Application Data\.instantjchem\ijc_2_4 Java Web Start: No ERROR STACK: java.lang.NullPointerException at chemaxon.jchem.db.TableInfo.createCreateLogTableStatement(TableInfo.java:623) at chemaxon.jchem.db.TableInfo.createLogTable(TableInfo.java:910) at chemaxon.jchem.db.Updater.createLogTables(Updater.java:666) at chemaxon.jchem.db.Updater.performCurrentUpdate(Updater.java:140) at chemaxon.jchem.db.Updater.performCurrentUpdate(Updater.java:127) at com.im.df.impl.db.JChemTableUpdater.performNextAction(JChemTableUpdater.java:98) at com.im.df.impl.db.sprovider.UpgradeJChemIterator$UpgradeAction.performNextAction(UpgradeJChemIterator.java:131)

at com.im.df.impl.db.sprovider.SchemaProviderImpl.proceedToNextState(SchemaProviderImpl.java:100)

at com.im.ijc.core.api.util.SchemaInitManager.startInit(SchemaInitManager.java:209)

at com.im.ijc.core.api.util.SchemaInitManager.access$000(SchemaInitManager.java:51) at com.im.ijc.core.api.util.SchemaInitManager$1.run(SchemaInitManager.java:73)

at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561) [catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)

06-01-2009 23:47:30

Hi,

We have found the problem, it is a bug in the JChem Base. We are going to fix it, and send you a patch soon.

Sorry for this inconvenience.

Regards, Edvard

ChemAxon fa971619eb

07-01-2009 17:29:37

We have fixed the problem.

It should only affect you if you are upgrading from quite an old version of IJC.

http://www.chemaxon.com/shared/tim/ijc_support/ijc_2_4_1/patches/jchem_5.1.4.1/jchem.jar

and then copy the downloaded file to this directory to replace the existing jchem.jar file:

<IJC_INSTALL_DIR>\instantjchem\modules\ext

The full path (on Windows) should look something like this:

C:\Program Files\ChemAxon\InstantJChem\instantjchem\modules\ext

Once this file is updated then start IJC and the upgrade process should hopefully be successful.

Please let us know how this goes.

Tim