I try to describe my problem. Following configuration:
- On Servicemix I have two bundles: one with model, second with service. Model bundle exports model packages, service bundle imports model packages from model bundle.
- In the service bundle I have Web Service (CXF) with one service method: execute. This method uses two parameters: the first (String) is the name of javascript file and the second is the map (HashMap) of arguments. The service executes javascript script using javax.scipt.CompiledScript.eval(Bindings bindings). The idea is to have business logic in scripting language.
- The javascript script has access to Java objects via:
a/ bindings - without problems. I see in the script all objects' instances which I added using bindings.put(name, object)
b/ importPackage(Packages.my.java.package.from.model.bundle) - now I have the problem: when I try to create in javascript Java object from model bundle with keyword "new" I get following error:
class com.google.code.scriptengines.js.util.ExtendedScriptException: org.mozilla.javascript.EcmaError: ReferenceError: "Product" is not defined. (#4) at [4] in file
where Product is my Java class from model bundle and in line 4 i try to create this object with:
var product = new Product();
And, I think, very important information: everything was fine in Servicemix 4.2.0. Now I have to upgrade to 4.3.1 and doesn't work (both version from Fusesource)
Any help?
Regards, Jacek