User Defined Functions

User 8b9e7d3dee

08-04-2010 15:19:45

I am trying to run the user defined function in the example for MolConverter, and I'm getting the following error message:


SQL>  select molconverter(cd_smiles, 'smiles:a') from IDX_SUBSTANCE_STRUCT_JCX w
here rownum<10;
 select molconverter(cd_smiles, 'smiles:a') from IDX_SUBSTANCE_STRUCT_JCX where
rownum<10
*
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.rmi.ServerException: RemoteException occurred in server thread; nested
exception is:
java.rmi.RemoteException: MolConvert
ORA-06512: at "JCHEM.JCHEM_CORE_PKG", line 323
ORA-06512: at "CHEMREG2.MOLCONVERTER_FUNC", line 5


line 5 is the line in the stored procedure that calls send_user_func.  This was run on version 5.2.6.  I will also be running this on version 5.3.1 but haven't tested this yet. 


Also, is it possible to run the java stored procdures that use jchem.jar  on oracle 11g directly instead of using the jchem server?

ChemAxon aa7c50abf8

09-04-2010 14:44:57

Hi Charles,


I am trying to run the user defined function in the example for MolConverter, and I'm getting the following error message:

The problem may be that the documentation didn't keep up with the evolution of the JChem Server architecture (the recent concept being that users should have a "one-stop" place for configuration: jchem/cartridge/conf/jcart.properties). So instead of using the JCART_XCLASSPATH environment variable, you have to set the xclasspath property in the jcart.properties file (to point to the root directory of your chemaxon.jchem.cartridge.JChemCartModule implementation). With JChem 5.2.6, the output of the JChem server start script would look like:


[[email protected] cartridge]$ bash server.sh start
+ /opt/java/jdk/default/bin/java -Djava.util.logging.config.class=chemaxon.jchem.cartridge.util.LoggingConfigurator -Dchemaxon.jchem.cartridge.config.file=conf/jcart.properties -Djava.awt.headless=true -classpath ./../lib/jchem.jar -XX:-OmitStackTraceInFastThrow chemaxon.jchem.cartridge.server.Bootstrapper start
INFO: Server control process started
INFO: Using classpath: /home/pkovacs/chemaxon/packages/jchem-5.2.6/lib/jchem.jar::/home/pkovacs/chemaxon/work/b53/jchem/test/cartridge
INFO: Server process start-ed.
INFO: Directory licenses does not exist. Leaving it to LicenseHandler to check the default location for licenses.
INFO: Listening on network interface 0.0.0.0/0.0.0.0 at port 1099...
INFO: Using chemaxon.jchem.cartridge.util.cpool.Oracle10gDataSource
INFO: Testing connection=oracle.jdbc.driver.LogicalConnection@2814a18d

/home/pkovacs/chemaxon/work/b53/jchem/test/cartridge being the root of the JChemCartModule implementation.


If this doesn't help, please, copy-paste here the corresponding error messages (and Java stack trace) from the jchem/logs/jcart1.log file.


Also, is it possible to run the java stored procdures that use jchem.jar  on oracle 11g directly instead of using the jchem server?

JChem Cartridge basically works as documented. It is certainly possible for individual application developers to try to "short cut" through some JChem Cartridge operations by directly calling jchem.jar functions as Java stored procedures. JChem Cartridge currently doesn't do that, because initial performance measurements with Oracle 11g lead us to believe that (even though Java stored procedures show significant performance improvements starting with 11g) calling out to JChem Server is still likely to yield better overall performance. Please, let us know if your experience with Java stored procedures leads you to significantly different conclusions.


Peter

User 8b9e7d3dee

09-04-2010 15:20:42

on start, the correct folder is added to the class path


[oracle@ds8 cartridge]$ bash server.sh start &
[1] 18023
[oracle@ds8 cartridge]$ + /usr/java/jre1.6.0_12/bin/java -Djava.util.logging.con
fig.class=chemaxon.jchem.cartridge.util.LoggingConfigurator -Dchemaxon.jchem.car
tridge.config.file=conf/jcart.properties -Djava.awt.headless=true -classpath ./.
./lib/jchem.jar -XX:-OmitStackTraceInFastThrow chemaxon.jchem.cartridge.server.B
ootstrapper start
INFO: Server control process started
INFO: Using classpath: /home/oracle/ChemAxon/JChem/lib/jchem.jar::/home/oracle/C
hemAxon/JChem/UDF

INFO: Server process start-ed.
INFO: Listening on network interface 0.0.0.0/0.0.0.0 at port 1099...


In the directory specified in the classpath, I have the file MolConvert.class file which was compiled on my client machine and then transferred to the server.


-jcart1.log-


Apr 9, 2010 11:07:08 AM chemaxon.jchem.cluster.NodeManager run
INFO: Listening on network interface 0.0.0.0/0.0.0.0 at port 1099...
Apr 9, 2010 11:08:21 AM chemaxon.jchem.cartridge.rmi.impl.RmiImplUtil handleErro
r
SEVERE: Error in RMI call
java.lang.ClassNotFoundException: MolConvert
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at chemaxon.jchem.cartridge.rmi.impl.UserDefFuncImpl.singleUc(UserDefFun
cImpl.java:37)
        at chemaxon.jchem.cartridge.rmi.impl.UserDefFuncImpl.single(UserDefFuncI
mpl.java:28)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
"jcart1.log" 78L, 4741C                                       1,1           Top


Thank you for your help.

User 8b9e7d3dee

09-04-2010 15:27:30

I just changed permission to the file as the log file indicated an access error and it is now working.  Thanks for your help.