Error running test.sql

User 4140faeba5

12-07-2005 07:47:41

Hi.


I've installed version 3.0.12 of Jchem together with Oracle 9.2.0.6, Java 1.4.2 and Tomcat 4.1.31





The installation went fine, but when I try to run the test.sql


I get the following error.





SQL> select jchem_core_pkg.getenvironment() from dual;


select jchem_core_pkg.getenvironment() from dual


*


ERROR at line 1:


ORA-29532: Java call terminated by uncaught Java exception:


java.lang.StringIndexOutOfBoundsException: String index out of range: -1


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 0


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 108








I traced the error to the following in the body JCHEM_CORE_PKG





FUNCTION getEnvironment RETURN VARCHAR2 IS


TYPE EmpCurTyp IS REF CURSOR;


cur EmpCurTyp;


res VARCHAR2(32767);


tmp VARCHAR2(32767);


BEGIN


check_master_table();


OPEN cur FOR 'select banner from sys.v_$version';


LOOP


FETCH cur INTO res;


tmp := tmp || res || CHR(10);


EXIT WHEN cur%NOTFOUND;


END LOOP;


dbms_output.put_line(tmp);


res := 'JChem version in the database: '||


Jchem_Core_Pkg.getJChemVersion() || CHR(10);


res := res || 'JChem version in the Tomcat server: ' ||


get_param('JCHEM_SERVLET_URL', 'JChemVer', '');


res := res || CHR(10) ||


get_param('JCHEM_SERVLET_URL', 'ToolVer', '');


dbms_output.put_line(res);


res := TRIM(CHR(10) FROM res);


RETURN tmp || res;


END;





If I comment out the call for get_param it works.


Also the following fails.


SQL> exec jchem_core_pkg.use_password('CHEMICAL');


BEGIN jchem_core_pkg.use_password('CHEMICAL'); END;





*


ERROR at line 1:


ORA-29532: Java call terminated by uncaught Java exception:


java.lang.StringIndexOutOfBoundsException: String index out of range: -1


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 0


ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 119


ORA-06512: at line 1





Attached is the trace file for test.sql








Help please,


Regards


Mikael

ChemAxon aa7c50abf8

12-07-2005 08:10:30

Mikael,





Based on the trace file attached, I have the impression that you were "manually" installing the jchem_cart.sql file containing the JChem stored procedures. During installation, the install.sh script creates a jchem_cart.sql_ file from the original jchem_cart.sql. The jchem_cart.sql_ file has some additional string literals inserted. The jchem_cart.sql_ file will be installed by the install.sh script. The source of the problem seems to be that one of these additional string literals are missing from the jchem_core_pkg installed. Notably the string "{SESSION_ID_START}" seems to be missing.





Did the install.sh script complete without problems during installation?





Peter

User 4140faeba5

12-07-2005 08:36:18

No it did not.


For some reason, my sun server did not like the syntax for the last two rows (except exit)


"echo -e "$1\\n@jchem_" ... etc.


Should I try to unitinstall, and reinstall but using the jchem_cart.sql_ ?

User 4140faeba5

12-07-2005 08:42:13

No it did not.


For some reason, my sun server did not like the syntax for the last two rows (except exit)


"echo -e "$1\\n@jchem_" ... etc.


Should I try to unitinstall, and reinstall but using the jchem_cart.sql_ ?

ChemAxon aa7c50abf8

12-07-2005 08:47:19

I suggest to





(1) execute:


Code:
sqlplus <your-connect-string> @drop.sql



to drop the packages installed, then


(2) execute:


Code:
sqlplus <your-connect-string> @jchem_cart.sql_






You have not yet created any jc_idxtype index, have you? If you have, you have to drop them in order to be able to drop the jchem packages.





Peter

User 4140faeba5

12-07-2005 10:04:03

Thanks.


Now it works.


/Mikael