Re: a problem of org.mozilla.javascript

[email protected]
Newsgroups gmane.comp.java.enhydra.shark
Message-ID <OF4337A28F.8E3EE695-ON8525703C.00464C5D-8525703C.00467285@intellicare.com>
Hi there, 

In order to use a Java class as a tool agent you need to use the 
JavaClassToolAgent. See:
http://shark.objectweb.org/doc/1.1/ToolAgents/tool_agents.html

Regards,
Geeta




[email protected] 
07/12/2005 08:38 AM
Please respond to
[email protected]


To
[email protected]
cc

Subject
[shark] a problem of org.mozilla.javascript






hi all.
I run a processes's demo with JavaScriptToolAgent.There is an application 
in the demo xpdl file.If the script is:
"
java.lang.System.out.println("run script...");
outvalue=java.lang.Math.random()*10*invalue;
java.lang.System.out.println("return value:"+outvalue);
"
then run OK. If change the script is:
"
java.lang.System.out.println("invoke com.shell.java.JavaCall");
outvalue=com.shell.java.JavaCall.calDouble(invalue);
java.lang.System.out.println("invoke com.shell.java.JavaCall and return 
value:"+outvalue);
"
/*
the JavaCall is a javabean that I use to test. its code:

package com.shell.java;
public class JavaCall {
    public static Double calDouble(Double inputValue) {
        Double db = new Double(inputValue.doubleValue() * 10.0);
        return db;
    }
}

*/

then run error:
org.mozilla.javascript.EcmaError: ReferenceError: "com" is not defined. 
(<script>#2)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230)
                 at 
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3303)
                 at 
org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1566)
                 at org.mozilla.javascript.gen.c1._c0(<script>:2)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304)
                 at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at org.mozilla.javascript.gen.c1.exec(<script>)
                 at 
org.mozilla.javascript.Context.evaluateReader(Context.java:1251)
                 at 
org.enhydra.shark.toolagent.JavaScriptToolAgent.invokeApplication(JavaScriptToolAgent.java:76)
                 at 
org.enhydra.shark.toolagent.DefaultToolAgent.invokeApplication(DefaultToolAgent.java:72)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.invokeApplication(ToolAgentManagerImpl.java:211)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.run(ToolAgentManagerImpl.java:96)
                 at 
org.enhydra.shark.ToolAgentManagerImpl.executeActivity(ToolAgentManagerImpl.java:67)
                 at 
org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1269)
                 at 
org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:1212)
                 at 
org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:1157)
                 at 
org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:816)
                 at 
org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:997)
                 at 
org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:703)
                 at 
org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:862)
                 at 
org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:373)
                 at 
org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:302)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:391)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:359)
                 at 
com.shark.util.SharkClientUtil.activityComplete(SharkClientUtil.java:227)
                 at test.SharkTest.testScript(SharkTest.java:244)
                 at test.SharkTest.main(SharkTest.java:264)
org.enhydra.shark.api.internal.toolagent.ToolAgentGeneralException: 
ReferenceError: "com" is not defined. (<script>#2)
                 at 
org.enhydra.shark.toolagent.JavaScriptToolAgent.invokeApplication(JavaScriptToolAgent.java:88)
                 at 
org.enhydra.shark.toolagent.DefaultToolAgent.invokeApplication(DefaultToolAgent.java:72)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.invokeApplication(ToolAgentManagerImpl.java:211)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.run(ToolAgentManagerImpl.java:96)
                 at 
org.enhydra.shark.ToolAgentManagerImpl.executeActivity(ToolAgentManagerImpl.java:67)
                 at 
org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1269)
                 at 
org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:1212)
                 at 
org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:1157)
                 at 
org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:816)
                 at 
org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:997)
                 at 
org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:703)
                 at 
org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:862)
                 at 
org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:373)
                 at 
org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:302)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:391)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:359)
                 at 
com.shark.util.SharkClientUtil.activityComplete(SharkClientUtil.java:227)
                 at test.SharkTest.testScript(SharkTest.java:244)
                 at test.SharkTest.main(SharkTest.java:264)
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "com" is not 
defined. (<script>#2)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230)
                 at 
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3303)
                 at 
org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1566)
                 at org.mozilla.javascript.gen.c1._c0(<script>:2)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304)
                 at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at org.mozilla.javascript.gen.c1.exec(<script>)
                 at 
org.mozilla.javascript.Context.evaluateReader(Context.java:1251)
                 at 
org.enhydra.shark.toolagent.JavaScriptToolAgent.invokeApplication(JavaScriptToolAgent.java:76)
                 ... 18 more
org.enhydra.shark.api.client.wfbase.BaseException: ReferenceError: "com" 
is not defined. (<script>#2)
                 at 
org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:389)
                 at 
org.enhydra.shark.WfActivityImpl.complete(WfActivityImpl.java:302)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:391)
                 at 
org.enhydra.shark.WfActivityWrapper.complete(WfActivityWrapper.java:359)
                 at 
com.shark.util.SharkClientUtil.activityComplete(SharkClientUtil.java:227)
                 at test.SharkTest.testScript(SharkTest.java:244)
                 at test.SharkTest.main(SharkTest.java:264)
Caused by: 
org.enhydra.shark.api.internal.toolagent.ToolAgentGeneralException: 
ReferenceError: "com" is not defined. (<script>#2)
                 at 
org.enhydra.shark.toolagent.JavaScriptToolAgent.invokeApplication(JavaScriptToolAgent.java:88)
                 at 
org.enhydra.shark.toolagent.DefaultToolAgent.invokeApplication(DefaultToolAgent.java:72)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.invokeApplication(ToolAgentManagerImpl.java:211)
                 at 
org.enhydra.shark.ToolAgentManagerImpl$ToolRunner.run(ToolAgentManagerImpl.java:96)
                 at 
org.enhydra.shark.ToolAgentManagerImpl.executeActivity(ToolAgentManagerImpl.java:67)
                 at 
org.enhydra.shark.WfActivityImpl.runTool(WfActivityImpl.java:1269)
                 at 
org.enhydra.shark.WfActivityImpl.startActivity(WfActivityImpl.java:1212)
                 at 
org.enhydra.shark.WfActivityImpl.activate(WfActivityImpl.java:1157)
                 at 
org.enhydra.shark.WfProcessImpl.startActivity(WfProcessImpl.java:816)
                 at 
org.enhydra.shark.WfProcessImpl.queueNext(WfProcessImpl.java:997)
                 at 
org.enhydra.shark.WfProcessImpl.run(WfProcessImpl.java:703)
                 at 
org.enhydra.shark.WfProcessImpl.activity_complete(WfProcessImpl.java:862)
                 at 
org.enhydra.shark.WfActivityImpl.finish(WfActivityImpl.java:373)
                 ... 6 more
Caused by: org.mozilla.javascript.EcmaError: ReferenceError: "com" is not 
defined. (<script>#2)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3240)
                 at 
org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3230)
                 at 
org.mozilla.javascript.ScriptRuntime.notFoundError(ScriptRuntime.java:3303)
                 at 
org.mozilla.javascript.ScriptRuntime.name(ScriptRuntime.java:1566)
                 at org.mozilla.javascript.gen.c1._c0(<script>:2)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at 
org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:304)
                 at 
org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2769)
                 at org.mozilla.javascript.gen.c1.call(<script>)
                 at org.mozilla.javascript.gen.c1.exec(<script>)
                 at 
org.mozilla.javascript.Context.evaluateReader(Context.java:1251)
                 at 
org.enhydra.shark.toolagent.JavaScriptToolAgent.invokeApplication(JavaScriptToolAgent.java:76)
                 ... 18 more

I downloaded the last released of js.jar which from www.mozilla.org,but 
have the same problem.Why?

Thanks in advance for your answer!


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


--
You receive this message as a subscriber of the [email protected] 
mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws


CONFIDENTIALITY NOTICE:This email is intended solely for the person or 
entity to which it is addressed and may contain confidential and/or 
protected health information.  Any duplication, dissemination, action 
taken in reliance upon, or other use of this information by persons or 
entities other than the intended recipient is prohibited and may violate 
applicable laws.  If this email has been received in error, please notify 
the sender and delete the information from your system.  The views 
expressed in this email are those of the sender and may not necessarily 
represent the views of IntelliCare.
message-footer.txt (text/plain, 271 B)
--
You receive this message as a subscriber of the [email protected] mailing list.
To unsubscribe: mailto:[email protected]
For general help: mailto:[email protected]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.