From: <php...@li...> - 2008-03-09 11:28:36
|
Hi, I am sorry, but I could not reproduce these problems. I have tested with IBM Java 1.5 on a Linux machine with the latest version of jFuzzyLogic. Everything works as expected. If you have any problems with the PHP/Java Bridge or its documentation, please open a problem report, please use http://sourceforge.net/tracker/?func=add&group_id=117793&atid=679233). > Thanks again! I tried another approach and I guess I found the reason. The reason why the procedure returns a NULL object is that the file could not be found in Java's current working directory (or class path). Since your NULL checks are completely wrong, they return false results and pretend that the file exists. > Right now I put everything inside a java class and it runs in java You don't need to write such a wrapper class. > public String setRule(double x, double y){ > echo "<p>" . $temp->setRule(3, 7) . "</p>"; > Can't load file: 'tipper.fcl' Correct. tipper.fcl is not in Java's working directory (or not accessible by the current class loader). > Exception occured; mixed trace: java.lang.Exception: Invoke failed: > [[o:Test1]]->setRule((o:double)[o:PhpExactNumber], > (o:double)[o:PhpExactNumber]). Cause: > java.lang.IllegalArgumentException VM: 1.5.0@http://www.ibm.com/ Please take a look at what you have passed and what is expected. setRule expects two double values, not two Integer values. In the end this may be a Java class loading issue. Since class loading is outside of the scope of the PHP/Java Bridge, this is not a PHP/Java Bridge problem. (Use the bug tracker, if you think this is a bug in the DynamicClassLoader. But I am quite certain that this will be closed, as dynamic class loading is not really possible in Java -- I'd rather like to remove java_require() instead.) It is debatable if the bridge should automatically convert an object into a boolean ($object==null) or to automatically convert an exact into an inexact number. But I think the error messages are okay: A NullPointerException means that you have passed NULL, which in turn means that some earlier call failed to produce a result. In this case the lookup for "tipper.tcl" failed. -- If you look at the log file, you see a clear error message ("tipper.tcl not found") from your library. The other problem is also obvious; if you pass an integer to a procedure expecting a double, you'll get an IllegalArgumentException. If there's anything we could do to improve the bridge or its documentation, please let us know. Regards, Jost Boekemeier Machen Sie Yahoo! zu Ihrer Startseite. Los geht's: http://de.yahoo.com/set |