ERROR: column "cd_fp14" specified more than once

User cb6c8cdd0f

13-03-2006 03:52:11

I am getting the following error when trying to import an SDF file via java code:


chemaxon.jchem.db.TransferException: ERROR: column "cd_fp14" specified more than once








I am using the latest version of jchem (3.1.5) and postgresql.








Here is the full stack trace:





at org.postgresql.util.PSQLException.parseServerError(PSQLException.java:139)


at org.postgresql.core.QueryExecutor.executeV3(QueryExecutor.java:152)


at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:100)


at org.postgresql.core.QueryExecutor.execute(QueryExecutor.java:43)


at org.postgresql.jdbc1.AbstractJdbc1Statement.execute(AbstractJdbc1Statement.java:517)


at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:50)


at org.postgresql.jdbc1.AbstractJdbc1Statement.executeUpdate(AbstractJdbc1Statement.java:273)


at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:893)


at chemaxon.jchem.db.UpdateHandler.execute(UpdateHandler.java:816)


at chemaxon.jchem.db.FileToSQLHandler.importFile(FileToSQLHandler.java:230)


at chemaxon.jchem.db.Importer.importMols(Importer.java:306)


at final2.main(final2.java:32)


problem: chemaxon.jchem.db.TransferException: ERROR: column "cd_fp14" specified more than once





....





another problem I have is this:


"chemaxon.jchem.db.PropertyNotSetException: Auto-increment property not set"





This goes away when I add db.isAutoIncrementProperty to the JChemProperties table. However, I don't think I should have to do this because jcman import feature works fine without this.

ChemAxon 9c0afc9aaf

13-03-2006 18:23:17

Hi,





I could not reproduce these problems so far.





After looking at the code it seems that the stack trace in your post was not produced by JChem version 3.1.5.





I suspect that there is an older jar file in your development environment, and there is a version conflict.


The missing property problem is also a result of this: the old version needed this property, but the new one from command line does not.





This topic can help you determining the current jchem version:


http://www.chemaxon.com/forum/ftopic127.html








Best regards,





Szilard

User cb6c8cdd0f

14-03-2006 02:39:50

chemaxon.jchem.VersionInfo.JCHEM_VERSION from that java file says I am using 3.1.5

ChemAxon 9c0afc9aaf

14-03-2006 08:17:52

Hi,
Quote:
chemaxon.jchem.VersionInfo.JCHEM_VERSION from that java file says I am using 3.1.5
In this case multiple versions are mixed in your system.


I am confident about this version conflict, since the line numbers listed in the stack trace does not contain code that could throw this exception.


For example line 893 of UpdateHandler only contains a "}", which is obviously an impossible place to throw an exception.





Also, there is no "db.isAutoIncrementProperty" in version 3.1.5, and it cannot be missing.





I do not know about your running environment, but:


- if running from command line please check your CLASSPATH


- if running from Tomcat, please checked the lib directories for jchem.jar files (e.g. shared/lib, WEB-INF/lib)


Also deleting the the cache (contents of the /work directory) and restarting Tomcat may be useful.


- if running from an IDE, please check the library configuration





Best regards,





Szilard

User cb6c8cdd0f

15-03-2006 02:14:20

export CLASSPATH=.:/home/chempacific/test2/jchem/lib/jchem.jar:/usr/share/java/postgresql-jdbc3.jar





That's my classpath.

ChemAxon 9c0afc9aaf

15-03-2006 09:59:03

Quote:
export CLASSPATH=.:/home/chempacific/test2/jchem/lib/jchem.jar:/usr/share/java/postgresql-jdbc3.jar
Do you run your application from command line ?


(e.g. "java my.application.Class")


If not, how do you run it ?


If you are running it from an IDE or from a web server / application server the CLASSPATH setting is irrelevant.





Kind regards,





Szilard








PS: Our scripts (e.g. jcman, msketch, etc.) include the appropriate jar file in


the CLASSPATH, so we generally do not recommend putting any ChemAxon jar files into the CLASSPATH to avoid future version conflicts.


Instead a similar starting script is recommended for your applications.

User cb6c8cdd0f

15-03-2006 14:05:20

Yes I run it from the command line (java myapp).


I actually got it working, simply by moving the "." to the end of the CLASSPATH. Very strange. I didn't have any class files in "."

ChemAxon 9c0afc9aaf

16-03-2006 11:46:11

Hi,





Probably you have unpacked a jchem.jar in that directory some time ago.


In that case you can find calls files under a "chemaxon" directory in a hierarchy. (the directory hierarchy represents the packages)





Anyway, I'm glad your problem has been solved.





Best regards,





Szilard