Subj : Context.newObject() can't find the constructor To : netscape.public.mozilla.jseng From : Janusz Dalecki \(TYCO\) Date : Sun Sep 11 2005 03:51 pm Hi, I need some help on creating host object with the following code: Context ctx = Context.enter(); mScope = new mporterTopLevel(ctx); ScriptableObject.defineClass(mScope, tycoint.odyssey.response.responseHostObjects.Devices.class); Scriptable devices = ctx.newObject(mScope, "Devices"); /* * Devices.java * * Created on 5 September 2005, 10:50 * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */ package tycoint.odyssey.response.responseHostObjects; import java.util.*; import org.mozilla.javascript.ScriptableObject; import org.apache.log4j.Category; import tycoint.odyssey.spatialmodel.*; import tycoint.odyssey.spatialmodel.util.*; import tycoint.odyssey.response.core.motorway.*; import tycoint.odyssey.response.core.*; import tycoint.odyssey.response.core.util.*; import org.mozilla.javascript.*; /** * * @author jdalecki */ public class Devices extends ScriptableObject { private Category logger = Category.getInstance(Devices.class); private static ResponseContext context; private static org.mozilla.javascript.Context scriptContext; private static Scriptable thisScope; /** * Creates a new instance of Devices */ public Devices() { } static public void init(Scriptable scope) { thisScope = scope; } // Method jsConstructor defines the JavaScript constructor public void jsConstructor(Object ctx) { this.context = (ResponseContext)ctx; } // The class name is defined by the getClassName method public String getClassName() { return "Devices"; } } When I call ctx.newObject() method I get: Constructor for "tycoint.odyssey.response.responseHostObjects.Devices" not found. exception. But if you look at the Device definition there is a constructor - so what is going on there? Any help much appreciated. Janusz .