Subj : Problem with ambiguous method - under Solaris, works in Windows To : netscape.public.mozilla.jseng From : Merten Schumann Date : Thu Aug 12 2004 05:43 pm Hello, ran into a strange problem: a script works when executed with Sun JDK 1.4.2 under Windows but not under Solaris. Besides from the JDK, I used the same environment, I mean, my application's .jar, same Rhino js.jar .... Under Solaris, I do get when I call a (public static) method getResultSet("bla", null, null) org.mozilla.javascript.EvaluatorException: The choice of Java constructor getResultSet matching JavaScript argument types (string,null,null) is ambiguous; candidate constructors are: interface de.rochade.srap.ResultSet getResultSet(java.lang.String[],java.lang.String[],java.lang.String), interface de.rochade.srap.ResultSet getResultSet(java.lang.String,java.lang.String,java.lang.String) According to http://www.mozilla.org/rhino/ScriptingJava.html, I think I could understand why Rhino cannot decide due to it's dynamic behaviour at Runtime some method overloading things. So, let's say with given getResultSet("foo", null, null) it cannot decide what to take from getResultSet(String, String, String) getResult(String[], String[], String) (although this would be not nice for me, anyway, I would have a work-around for this) But, the strange thing: if Rhino cannot decide which method to take, why is it different under Windows and Solaris??? I think this is an JVM issue then ... When I call getResultSet("foo", "foo", null), it works. That's strange too. I mean, if Rhino cannot distinguish String from String[], shouldn't it throw "ambiguous" all the time here? Or, does it think "ok, we have two Strings here, this can only be the method (String, String, String) since in (String[], String[], String) is only one String" :-) And if so, there's still the different behaviour under Windows and Solaris ... (I don't think it matters, but my application is a servlet in Tomcat servlet container) I will try to write some sample code to reproduce the problem ... Merten .