Java PHP problem

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Java PHP problem

  1. #1
    Join Date
    Jan 2004

    Java PHP problem


    I've started putting together a site that uses PHP to access some custom Java classes. While I'm not clear on what exactly the java classes are doing, their programmer has given me an overview of the variables that I should pass to them. However, I keep getting this error:

    java.lang.IllegalArgumentException: argument type mismatch

    The java programmer has no knowledge of PHP and so is unable to help locate the source of the problem. The code I'm writing is in the following format:

    $newobject = new Java('', $names, (String) $ssn, (int) $time);

    In the above example, $names is an object, $ssn a string and $time an integer. The object $names is created in a similar way above this example.

    I've tested a very basic class to be sure it works, and had success, however when I try to pass objects into classes, and multiple variables, it doesnt work. I hope someone can shed some light on where I might be going wrong.

    Many thanks,


  2. #2
    Join Date
    Sep 2002
    Without seeing the Java code it's going to be a little tricky. However, it's looking like some form of clash is going on... where one piece of code using (eg) an integer is asking another piece of code which is wanting to use (eg) a string to manipulate the integer... if that's vague I'm sorry.

    Try asking your Java programmer to put extra debugging code into the Java to identify where the Java is having a tantrum, and if it's possible to do similar in the PHP... that way the Java programmer and PHP scripter can work together without necessarily understanding each other's languages.

    Joyous Monkeys

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center