|
From: Jost B. <jos...@ya...> - 2005-09-21 18:28:22
|
Hi,
> I believe one should java_require() ALL the
> WebSphere MQ jars in each
> PHP script
What about extending java_require() so that it can
load jar files from a given directory?
In the meantime it might be possible to call
initClassLoader("dir") overriding the default
phpConfigDir. Please see
http://cvs.sourceforge.net/viewcvs.py/*checkout*/php-java-bridge/php-java-bridge/server/doc/php/java/bridge/DynamicJavaBridgeClassLoader.html#initClassLoader(java.lang.String)
> >> Apparently the bridge keeps converting the second
> >> argument (an integer)
> >> to java.lang.Long while the method mandates an
> int.
> It requires an int.
[...]
> accessQueue(class
> java.lang.String, class java.lang.Integer). Cause:
> java.lang.IllegalArgumentException:
> java.lang.ClassCastException@1a786c3]
If it requires an int then I think we wouldn't see the
ClassCastException. php ints (which are actually
longs) are transferred as <L v="longval"/>. coerce can
convert the longval into a int, but it cannot convert
it into a java.lang.Integer.
> 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.
"If members matching the name, type and arguments
specified in the script are found, the arguments may
be converted to the exact types in the best matching
member's signature and the member may be invoked."
As I understand 3.3.4 we may decide if we call the
method and we may or may not coerce the argument to
the required type. IMHO the above sentence does not
say that we must not call the method (and throw a
NoSuchMethodException) if the arguments cannot be
coerced.
In general we cannot auto-convert a long to a
java.lang.Integer without altering the value. If such
a conversion is necessary I think the user must do
this, for example by calling "new
java("java.lang.Integer", $phpLongValue);"
Regards,
Jost Boekemeier
___________________________________________________________
Gesendet von Yahoo! Mail - Jetzt mit 1GB Speicher kostenlos - Hier anmelden: http://mail.yahoo.de
|