Hi,
The method *announce(String)* not exists but *announce()* yes ;-)
So try something like:
$hello = new Java('mani.Hello');
$hello->announce("test");
Java Program:
package mani;
class Hello {
public void announce(*String message*) {
System.out.println("Works! Receiving message: "+message);
}
}
On Tue, Aug 26, 2008 at 9:14 AM, <
php...@li...> wrote:
> Hi,
>
> I am trying out PHP Java bridge with small example - A program to print the
> string on the screen.
>
> PHP Script:
>
> java_require("/disk2/v/apache/htdocs/VIRTUAL/
> mytoday.greynium.com/public_html/ftp/classes/");
>
> $hello = new Java('mani.Hello');
> $hello->announce("test");
>
> Java Program:
>
> package mani;
> class Hello {
> public void announce() {
> System.out.println("Works! ");
> }
> }
>
> When I am trying to execute this PHP script, getting this error:
>
> PHP Fatal error: Uncaught [o(Exception):"java.lang.Exception: Invoke
> failed: [c(Hello)]->announce(o(Request$PhpParserString)). Cause:
> java.lang.NoSuchMethodException: announce(o(Request$PhpParserString)).
> Candidates: [] Responsible VM: 1.5.0_04@http://java.sun.com/" at:
> #-5 php.java.bridge.JavaBridge.Invoke(JavaBridge.java:1117)
> #-4 php.java.bridge.Request.handleRequest(Request.java:536)
> #-3 php.java.bridge.Request.handleRequests(Request.java:582)
> #0 [internal function]: Java->__call('announce', Array)
> #1 /disk2/v/apache/htdocs/VIRTUAL/
> mytoday.greynium.com/public_html/ftp/TransferFiles.php(27)<http://mytoday.greynium.com/public_html/ftp/TransferFiles.php%2827%29>
> :
> Java->announce('Mani')
> #2 {main}]
>
>
> Can anyone please help me on this?
>
> Thanks
> Mani
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> php-java-bridge-users mailing list
> php...@li...
> https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users
>
--
Roger José Padilla Camacho
|