|
From: <php...@li...> - 2008-12-14 19:32:49
|
Hi,
> 1. required jar files for Java classes A and B were
> included in java_require
> 2. PHP script was able to instantiate class B
> 3. class A was not able to instantiate that same class B?
Class B came from another class loader which has no relationship to the loader for (A,B), most likely the bootstrap loader. Which means that you have violated the module contract.
> 4. this behaviour occurred because of supplying relative
> paths to java_require
Whether or not a library has an absolute or relative path is irrelevant.
> Furthermore, doesn't that observation indicate an
> inconsistency in class loading mechanism?
Yes, definitely. This part of the Java platform is broken by design.
Compare it with .NET or with SML/NJ. -- There was a proposal for a real module system based on generics, but this needs real generics within the JVM, something that Java doesn't support either (current Java 1.5 generics are syntactic shugar, for the compiler and for marketing).
However, this doesn't have anything to do with the PHP/Java Bridge.
Regards,
Jost Boekemeier
|