DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2004
    Posts
    1

    Java PHP problem

    Hi,

    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('com.company.Class', $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,

    Don

  2. #2
    Join Date
    Sep 2002
    Posts
    124
    Hi.
    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.

    Regards,
    Joyous Monkeys

Bookmarks

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
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links