Julian Tree | 12 Sep 11:36
Picon

dontEnum() error

I am getting following error when I try to loop through a collection
and get set of child collection. The error is not consistent. Sometime
it shows and sometimes it doesn't. And something I get a heap space
error.  Any ideas?  We are due to launch on oct 1st, so it is
important that we figure what is going on.

Error in application

dontEnum() called with non-String argument

Java Stack

org.mozilla.javascript.EvaluatorException: dontEnum() called with
non-String argument
	at helma.scripting.rhino.RhinoCore.getValidPrototype(RhinoCore.java:403)
	at helma.scripting.rhino.RhinoCore.getNodeWrapper(RhinoCore.java:650)
	at helma.scripting.rhino.RhinoCore$WrapMaker.wrap(RhinoCore.java:1039)
	at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:937)
	at org.mozilla.javascript.ScriptRuntime.toObject(ScriptRuntime.java:885)
	at org.mozilla.javascript.Context.toObject(Context.java:1528)
	at helma.scripting.rhino.RhinoEngine.setGlobals(RhinoEngine.java:203)
	at helma.framework.core.RequestEvaluator.initGlobals(RequestEvaluator.java:993)
	at helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:211)
	at java.lang.Thread.run(Thread.java:613)
Julian Tree | 1 Oct 06:34
Picon

date.js cause memory leak

Hi,

I have included the following lib http://www.datejs.com

It works great, except for when I change some code and reload a web page, then Rhino or Helma instance just keeps on running until it times out.  It takes up 180% cpu on my MacBook.  The code runs fine as long as I don't change thing, but as you guys can see this will not work.

Is this a bug in Rhino, Helma or something to do with date.js.  I know that that lib is stil in alpha and it is mostly for clientside, but one thing I like about helma is that I will be able to use clientside js lib on serverside as well.  Please let me know if there are any work around. Thanks.

Julian
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Julian Tree | 1 Oct 07:30
Picon

org.mozilla.javascript.NativeArray toJSON error

Sometimes when I have an object with arrays

I'm doing

if(!session.data.jobulousSurvey.Review.responses) session.data.jobulousSurvey.Review.responses = []

if I uneval.

uneval(session.data.jobulousSurvey.Review.responses)  // this is  end up to be org.mozilla.javascript.NativeArray

1. why is this happening?
2. this doesn't work with session.data.jobulousSurvey.Review.toJSON()

I don't really mind using a mozilla array, as long as I can use toJSON method on it.

Any recommendation or insight as why this is happening?  Is this a bug?

Julian
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Rainer Rynesch | 1 Oct 09:21
Picon

Re: date.js cause memory leak

Hi,

We had the same problem, it's because datejs overwrites the toString() method (causing an infinte loop
when done twice) of the javascript Date prototype, as soon as you put the datejs within a condition there is
no problem in chaning code (but you can't change date.js)

if(!global.dateloaded){
  global.dateloaded = true;
... Date.js code ...
}


 
Rainer
 

> -----Ursprüngliche Nachricht-----
> Von: helma-user-bounces <at> helma.org 
> [mailto:helma-user-bounces <at> helma.org] Im Auftrag von Julian Tree
> Gesendet: Mittwoch, 01. Oktober 2008 06:34
> An: Helma User Mailing List
> Betreff: [Helma-user] date.js cause memory leak
> 
> Hi, 
> 
> I have included the following lib http://www.datejs.com

> 
> It works great, except for when I change some code and reload 
> a web page, then Rhino or Helma instance just keeps on 
> running until it times out.  It takes up 180% cpu on my 
> MacBook.  The code runs fine as long as I don't change thing, 
> but as you guys can see this will not work. 
> 
> Is this a bug in Rhino, Helma or something to do with 
> date.js.  I know that that lib is stil in alpha and it is 
> mostly for clientside, but one thing I like about helma is 
> that I will be able to use clientside js lib on serverside as 
> well.  Please let me know if there are any work around. Thanks.
> 
> Julian
> 
> 
_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user
Hannes Wallnoefer | 1 Oct 13:54
Picon
Gravatar

Re: org.mozilla.javascript.NativeArray toJSON error

Hi Julian,

my first guess would have been that the parent scope or prototype of the array are wrong or null, maybe because it has been serialized/deserialized or was created in another scope.

org.mozilla.javascript.NativeArray is indeed the class Rhino uses to implement javascript arrays, but you shouldn't see that when you do an uneval() or toSource().

Hannes

PS the helma mailing list has moved to http://groups.google.com/group/helma - I just haven't managed to turn the switch on the old list yet :-) So I'm cross-posting my answer to the new list.

2008/10/1 Julian Tree <julian.tree <at> gmail.com>
Sometimes when I have an object with arrays

I'm doing

if(!session.data.jobulousSurvey.Review.responses) session.data.jobulousSurvey.Review.responses = []

if I uneval.

uneval(session.data.jobulousSurvey.Review.responses)  // this is  end up to be org.mozilla.javascript.NativeArray

1. why is this happening?
2. this doesn't work with session.data.jobulousSurvey.Review.toJSON()

I don't really mind using a mozilla array, as long as I can use toJSON method on it.

Any recommendation or insight as why this is happening?  Is this a bug?

Julian

_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user


_______________________________________________
Helma-user mailing list
Helma-user <at> helma.org
http://helma.org/mailman/listinfo/helma-user

Gmane