[Helma-user] Bug with getOrderedView ?
Hannes Wallnoefer
hannesw at gmail.com
Fri Dec 1 14:29:33 CET 2006
Hi Jonathan,
thanks for the report. Unfortunately, floats and integer sometimes get
mixed up in Rhino/Helma for various reasons. I just committed a patch
to Helma CVS (both HEAD and helma_1_5) that should fix the problem.
Let me know if you need help building from CVS, alternatively you can
wait for new snapshows to appear at
<http://adele.helma.org/download/helma/nightly/>.
hannes
2006/12/1, Jonathan Puckey <me at jonathanpuckey.com>:
> Hey guys,
>
> I'm working on website ( http://smba.webtic.nl:8888/smba/ ) and I'm
> getting some exceptions every now and again.. I need to launch soon,
> but can't with these going on : (
>
> here are few (example of a full exception at the bottom of this mail):
> JavaException: java.lang.ClassCastException: uncomparable values 62.0
> (5) : 357(4)
> JavaException: java.lang.ClassCastException: uncomparable values 81
> (4) : 55.0(5)
> JavaException: java.lang.ClassCastException: uncomparable values 63.0
> (5) : 65(4)
>
> It happens when I call the following function:
> function orderWords(){
> res.data.words = res.data.words.getOrderedView("occurrence
> desc").list();
> }
>
> It looks like it's seeing one of the values as an Integer and the
> other as a Float.. But the values are coming from the same database
> column, and when I save the value that it's ordering on, I'm making
> sure that it's an integer: word.occurrence = parseInt(k);
>
> res.data.words is a hopobject that I'm adding a number of objects (of
> the same type) to:
> if(b.length!=oldl) res.data.words.add(o);
>
> I'm calling the orderWords function when I render my navigation
> template (jstl):
> <%= orderWords() %>
>
> Does anyone have any idea what could be wrong here?
>
> Thanks alot! -
> Jonathan
>
> Full exception below:
>
> Template error in /data/web/sites/smba.nl/www/code/Root/nav.jstl,
> line: 43, in <%= orderWords() %>: JavaException:
> java.lang.ClassCastException: uncomparable values 62.0(5) : 357(4)
> Stacktrace: java.lang.ClassCastException: uncomparable values 62.0
> (5) : 357(4) at helma.objectmodel.db.Property.compareTo(Property.java:
> 516) at helma.objectmodel.db.OrderedSubnodeList.compareNodes
> (OrderedSubnodeList.java:345) at
> helma.objectmodel.db.OrderedSubnodeList.determineNodePosition
> (OrderedSubnodeList.java:275) at
> helma.objectmodel.db.OrderedSubnodeList.sortIn
> (OrderedSubnodeList.java:145) at
> helma.objectmodel.db.OrderedSubnodeList.sortIn
> (OrderedSubnodeList.java:199) at
> helma.objectmodel.db.OrderedSubnodeList.(OrderedSubnodeList.java:63)
> at helma.objectmodel.db.SubnodeList.getOrderedView(SubnodeList.java:
> 116) at helma.scripting.rhino.HopObject.jsFunction_getOrderedView
> (HopObject.java:1074) at inv52.invoke() at
> org.mozilla.javascript.MemberBox.invoke(MemberBox.java:164) at
> org.mozilla.javascript.FunctionObject.call(FunctionObject.java:452)
> at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1442)
> at org.mozilla.javascript.gen.c1745._c2(/data/web/sites/smba.nl/www/
> code/Global/functions.js:29) at org.mozilla.javascript.gen.c1745.call
> (/data/web/sites/smba.nl/www/code/Global/functions.js) at
> org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2646)
> at org.mozilla.javascript.InterpretedFunction.call
> (InterpretedFunction.java:57) at
> org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1442) at
> org.mozilla.javascript.BaseFunction.applyOrCall(BaseFunction.java:
> 501) at org.mozilla.javascript.BaseFunction.execMethod
> (BaseFunction.java:205) at org.mozilla.javascript.IdFunction.call
> (IdFunction.java:93) at org.mozilla.javascript.ScriptRuntime.call
> (ScriptRuntime.java:1442) at org.mozilla.javascript.gen.c1750._c16(/
> data/web/server/helma/modules/Global/Template.js:634) at
> org.mozilla.javascript.gen.c1750.call(/data/web/server/helma/modules/
> Global/Template.js) at org.mozilla.javascript.ScriptRuntime.call
> (ScriptRuntime.java:1442) at org.mozilla.javascript.gen.c1725._c1(/
> data/web/sites/smba.nl/www/code/Dictionary/functions.js:45) at
> org.mozilla.javascript.gen.c1725.call(/data/web/sites/smba.nl/www/
> code/Dictionary/functions.js) at
> org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1442) at
> org.mozilla.javascript.gen.c1726._c1(/data/web/sites/smba.nl/www/code/
> Word/functions.js:29) at org.mozilla.javascript.gen.c1726.call(/data/
> web/sites/smba.nl/www/code/Word/functions.js) at
> helma.scripting.rhino.RhinoEngine.invoke(RhinoEngine.java:319) at
> helma.framework.core.RequestEvaluator.run(RequestEvaluator.java:377)
> at java.lang.Thread.run(Thread.java:595) (/data/web/server/helma/
> modules/Global/Template.js#561)
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>
More information about the Helma-user
mailing list