'ijcPropertiesDao' Error when Accessing Oracle Schema

User f90da33c79

06-03-2009 22:11:14

It's been awhile since I've using Instant JChem, so please forgive me if I'm doing something wrong.  I tried to create a new connection to an Oracle database using IJC 2.4.2, but when I enter in the database information then click "Next", the following error message is displayed:








Code:
Error creating bean with name 'ijcPropertiesDao' defined in class path resource [com/im/df/resources/core-bean-factory.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.im.df.impl.db.persist.IJCPropertiesDao]: Constructor threw exception; nested exception is org.springframework.jdbc.BadSqlGrammarException: StatementCallback; bad SQL grammar [CREATE TABLE IJC_SCHEMA (


SCHEMA_ID              VARCHAR2(32)     NOT NULL,


ITEM_ID                VARCHAR2(32)     NOT NULL,


ITEM_INDEX             NUMBER(6.0)      NOT NULL,


GENERIC_TYPE           VARCHAR2(200)    NOT NULL,


IMPL_TYPE              VARCHAR2(200)    NOT NULL,


PARENT_ID              VARCHAR2(32),


DESCRIPTION            VARCHAR2(1000),


ITEM_VALUE             CLOB,





CONSTRAINT PK_IJC_SCHEMA PRIMARY KEY (SCHEMA_ID, ITEM_ID),


CONSTRAINT FK_IJC_SCHEMA_SCHEMA FOREIGN KEY (SCHEMA_ID, PARENT_ID) REFERENCES IJC_SCHEMA (SCHEMA_ID, ITEM_ID) ON DELETE CASCADE


)]; nested exception is java.sql.SQLException: ORA-00955: name is already used by an existing object









Instead of creating a new schema, I also tried connecting to an existing one, and I received the same error.  I assume I'm doing something wrong, but I'm not sure what.  Can you help?





Thanks!

ChemAxon fa971619eb

07-03-2009 10:09:21

First let me explain the difference between "Connect to schema" and "New schema". IJC needs some tables in the database to store its metadata and user data. These are tables whose names start with IJC_.





When you are connecting IJC to a database for the first time these tables will not exist and will need creating. In this case you use "New schema" as you are creating a new IJC schema. If the tables have already been created and, for instance, you are connecting from a different computer, then you use "Connect to schema" which expects the IJC_* tables to be present.





In your case the tables, or something used by them, appear to be partially present and creation of the table is failing. The simplest solution will be to manually drop all the IJC_* tables from the Oracle schema (the tables that might need removing are IJC_CUSTOM_ITEMS, IJC_ITEM_INFO, IJC_ITEM_USER, IJC_SECURITY_INFO, IJC_SECURITY_AUTHORITIES, IJC_SECURITY_USERS, IJC_VIEWS, IJC_USER and IJC_SCHEMA) and try the "New schema" wizard again. Note on Oracle you will also need to delete the trigger named "IJC_VIEWS_TRIGGER" and the sequences named "IJC_USER_SEQ" and "IJC_VIEWS_SEQ" as these will also need to be re-created.





Then you can use the "New schema" wizard to connect for the first time and re-create the IJC tables, and then, when connecting on other computers, use the "Connect to schema" wizard.





I hope this helps.





Tim

ChemAxon fa971619eb

07-03-2009 10:24:13

Sorry, one more thing.


Make sure that the Oracle user account has privileges to create tables, triggers and sequences!





Tim

User f90da33c79

12-03-2009 18:43:15

Thanks for your help.  That did the trick!