16 September 2009

[38000] Unknown throwable: (java.lang.ClassCastException)

My application is running a function in Informix which calls a jar file internally, but when executing the function I get the following error:


[Error Code: -937, SQL State: 38000] Unknown throwable: (java.lang.ClassCastException)

The jar file was installed using the function sqlj.install_jar with following procedure:


EXECUTE PROCEDURE sqlj.replace_jar ('file:/app_dev/tmp/SendMessage.jar', 'sendMsgJar');


Using this procedure the jar file is installed in Informix and copied to the /tmp folder.


After long investigation I identified in informix log file "jvp.log" that one class could not be found, so the error message was thrown. I checked the JVPCLASSPATH property in the ONCONFIG file and all the necessary jars were correctly defined, so apparently there was no reason for this error. After changing the JVPCLASSPATH I restarted Informix using the command "onmode -ky; oninit -v", so the new classpath would be loaded to memory. At this point the following message was displayed:


Reading configuration file '/app/informix/etc/onconfig'...Max length of 256 exceeded for configuration parameter JVPCLASSPATH


It means that in my case the error message happened because of the length of the classpath, which in Informix can't exceed 256 characters. After updating the JVPCLASSPATH and restarting the server the function worked properly.

No comments:

Post a Comment