On Dec 6, 2:40 pm, Amit Lonkar <[EMAIL PROTECTED]> wrote:
> On Dec 6, 6:50 am, Norris Boyd <[EMAIL PROTECTED]> wrote:
>
>
>
> > On Dec 5, 1:40 pm, Amit Lonkar <[EMAIL PROTECTED]> wrote:
>
> > > On Dec 5, 9:52 am, Norris Boyd <[EMAIL PROTECTED]> wrote:
>
> > > > On Dec 4, 6:47 pm, Amit Lonkar <[EMAIL PROTECTED]> wrote:
>
> > > > > Will trying to load test our application we keep getting a
> > > > > RunTimeEXception with the message java.lang.RuntimeException: Property
> > > > > already exists.
>
> > > > > Can some please shed some light on this error?
>
> > > > What's the exact message? Do you have a stack trace?
>
> > > Here is some more information.
> > > 1. Here is the piece of code that we used to execute scripts
>
> > > Context cx = Context.enter();
>
> > > // Set Optimization level to -1 so that Scripts can be run when Tomcat
> > > Security is enabled.
> > > cx.setOptimizationLevel(-1);
>
> > > // get a ref to the multi-threaded scope
> > > Global scope = new Global(cx);
>
> > > ScriptableObject.putProperty(scope, sVariableName,
> > > cx.javaToJS(variable,scope));
>
> > > FileReader oJsReader = new FileReader(oScriptFile);
>
> > > // execute the script
> > > Object oResult = cx.evaluateReader(scope, oJsReader,
> > > oScriptFile.getName(), 1, null);
>
> > > 2. It fails when we try to load another script using "load" .
>
> > > 3. Here is the stack trace.
> > > 62078 ERROR [2007-12-04 17:05:10,156] NetapsLog - [ScriptManager:
> > > executeScript()] RhinoException:
> > > org.mozilla.javascript.WrappedException: Wrapped
> > > java.lang.RuntimeException: Property already exists
> > > (PreAddScenario.js#21)
> > > 62110 ERROR [2007-12-04 17:05:10,188] NetapsLog - [NetapsAction:
> > > execute()] Exception: Error processing pre-update scripts:
> > > com.netaps.framework.NetapsException: A scripting error occured:
> > > Wrapped java.lang.RuntimeException: Property already exists
> > > (PreAddScenario.js#21)
> > > com.netaps.framework.NetapsException: Error processing pre-update
> > > scripts: com.netaps.framework.NetapsException: A scripting error
> > > occured: Wrapped java.lang.RuntimeException: Property already exists
> > > (PreAddScenario.js#21)
> > > at com.netaps.standard_view.actions.StandardViewEditAction
> > > $StandardViewEditWorker.runPreUpdateScripts(StandardViewEditAction.java:
> > > 1449)
> > > at com.netaps.standard_view.actions.StandardViewEditAction
> > > $StandardViewEditWorker.doProcess(StandardViewEditAction.java:232)
> > > at
> > > com.netaps.standard_view.actions.StandardViewEditAction.doProcess(StandardViewEditAction.java:
> > > 112)
> > > at com.netaps.root.RootAction.doRootProcess(RootAction.java:71)
> > > at
> > > com.netaps.framework.NetapsAction.execute(Lorg.apache.struts.action.ActionMapping;Lorg.apache.struts.action.ActionForm;Ljavax.servlet.http.HttpServletRequest;Ljavax.servlet.http.HttpServletResponse;)Lorg.apache.struts.action.ActionForward;
> > > (Unknown Source)
> > > at
> > > org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:
> > > 431)
> > > at
> > > org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:
> > > 236)
> > > at
> > > org.apache.struts.action.ActionServlet.process(ActionServlet.java:
> > > 1196)
> > > at
> > > org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:
> > > 432)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
> > > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
> > > 252)
> > > at
> > > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
> > > 173)
> > > at
> > > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
> > > 213)
> > > at
> > > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
> > > 178)
> > > at
> > > org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:
> > > 126)
> > > at
> > > org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:
> > > 105)
> > > at
> > > org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:
> > > 107)
> > > at
> > > org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:
> > > 148)
> > > at
> > > org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:
> > > 869)
> > > at org.apache.coyote.http11.Http11BaseProtocol
> > > $Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:
> > > 664)
> > > at
> > > org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:
> > > 527)
> > > at
> > > org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:
> > > 80)
> > > at org.apache.tomcat.util.threads.ThreadPool
> > > $ControlRunnable.run(ThreadPool.java:684)
> > > at java.lang.Thread.run()V(Unknown Source)
>
> > The string "Property already exists" doesn't exist in the Rhino
> > sources. Since it's a wrapped exception of an underlying
> > RuntimeException my guess is that it is coming from somewhere other
> > than Rhino.
>
> > --N
>
> Hi Norris,
>
> I found it in the ScriptableObject class, in the method public
> void defineProperty(String propertyName, Object delegateTo,
> Method getter, Method setter, int
> attributes).
>
> Right at the end of the method it says
> if (inserted != gslot) {
> throw new RuntimeException("Property already exists");
> }
>
> Thanks
> Amit
By the way, I am using Version 1.6 R1
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino