Subj : Calling host object method with java parameters To : netscape.public.mozilla.jseng From : Janusz Dalecki \(TYCO\) Date : Wed Jul 20 2005 10:54 am I am having problem with calling one of my host object method and passing a java parameter. I have a host object that I call HOUtil that has a method let's say test public void jsFunction_Test(HOTest test) { Object oo = ( (org.mozilla.javascript.Wrapper) test ).unwrap(); boolean b = oo instanceof tycoint.odyssey.response.responseHostObjects.Test; .. } The problem I am having is that when I call this function from within java script passing a Java object Test like this: HOUtil.Test(new HOTest("janusz")); it always fails with the following message : Caused by: org.mozilla.javascript.EvaluatorException: Unsupported parameter type "tycoint.odyssey.response.responseHostObjects.HOTest" in method "jsFunction_Test". at org.mozilla.javascript.DefaultErrorReporter.runtimeError(DefaultErrorReporte r.java:95) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1054) at org.mozilla.javascript.Context.reportRuntimeError(Context.java:1110) at org.mozilla.javascript.Context.reportRuntimeError2(Context.java:1080) at org.mozilla.javascript.FunctionObject.(FunctionObject.java:160) at org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:90 7) at org.mozilla.javascript.ScriptableObject.defineClass(ScriptableObject.java:73 2) at tycoint.odyssey.response.core.util.ResponseBuilder.callScriptFunction(Respon seBuilder.java:447) at tycoint.odyssey.response.core.util.ResponseBuilder.build(ResponseBuilder.jav a:110) ... 13 more If I understand the rules, first the HOTest object will be converted to Java Script object JavaObject (in the case of Rihno it is NativeJavaObject), then when passed to the Host Object HOUtil. Test function it should be converted to (I quote) "Any interface or class that is assignment-compatible with the unwrapped object". My HOTest object is compatible with the unwrapped object because the above code works if I only change the parameter type of the Test function to be Object like this: public void jsFunction_Test(Objectt test) { Object oo = ( (org.mozilla.javascript.Wrapper) test ).unwrap(); boolean b = oo instanceof tycoint.odyssey.response.responseHostObjects.Test; .. } What am I confusing here? Any help appreciated. Regards, Janusz .