From: SQUILLACE M. <msq...@so...> - 2005-09-21 09:44:06
|
Jost, Thank you for the reply. >> When installing the client Java bindings, WebSphere >> puts them in /opt/mqm/java/lib > Loading them shouldn't be a problem if the application > server knows about this directory and automatically > adds its content to the classpath. If not, then one > must find another way to load the libraries. I am not using an application server, but simply start the php-java-bridge as a service. I wrote WebSphere but meant the WebSphere MQ installation scripts. Another goal of my tests is to define the lightest environment to install on a PHP webserver to enable Java class invocation. > The recommended way to load libraries is to install > them as name-version.jar in /usr/share/java or one of > its sub directories and then require them with the > name and version number. Good point, I wouldn't mind adding a java_require() statement in order to maintain a cleaner environment. This is not so easy to do in this instance, since all the samples in the WebSphere documentation assume a classpath is set as specified in the installation notes, and the product's jar files are clearly interlinked: I tried to java_require() only the libraries needed by the classes I was using in my sample and kept getting errors, that went away as soon as I created the symbolic links in /usr/share/java. I believe one should java_require() ALL the WebSphere MQ jars in each PHP script; a more elegant approach could be to centralize the java_require() statement in a PHP include file, so that when a next WebSphere MQ release adds a new jar one needs only modify one file. >> Apparently the bridge keeps converting the second >> argument (an integer) >> to java.lang.Long while the method mandates an int. > Does it require an int or does it require a > java.lang.Integer? I think this is a bug in the PHP documentation which talks about "integer"=20 > and "float" even though these are long and double. It requires an int. In one of several attempts I called the method with an object of class java.lang.Integer and the error message simply became: Fatal error: Uncaught [class java.lang.Exception: java.lang.Exception: Invoke failed: [class com.ibm.mq.MQQueueManager]->accessQueue(class java.lang.String, class java.lang.Integer). Cause: java.lang.IllegalArgumentException: java.lang.ClassCastException@1a786c3] From a brief examination of JavaBridge.java (remember I don't speak fluent Java at all) I seem to understand the conversion to int is not implemented; reading the JSR 223 conversely shows it should be, since the bridge has to "adapt" the script request to the "most closely matching" method argument list. Bye, Massimo=20 |