Ok, now I feel stupid. A previous script in our project was importing java.lang.reflect.Array. :p

List-searchers beware, importing this class will break your javascript!!!

Sorry for the frivolous post.

Greg Weinger wrote:
Ok, I did more testing, and this array creation works in normal samples (cocoon 2.1.5.1). So I did something to my current script that causes this behavior. Has anyone seen this before? I can't find anything in the archives about it.

I guess I'll try to see what causes it.

Greg Weinger wrote:

Hi,

I am simply trying to create a javascript array in flowscript, Cocoon 2.1.5. The standard javascript syntax doesn't seem to work:

   var array = ["one","two","three"];

 Or:

    var array = new Array(3);
    array[0] = "blah";

For me, this throws a:

-----------------------------------------------------------
org.mozilla.javascript.EvaluatorException: file:/home/knoppix/workspace/DataServer_v2_1/build/webapp/admin/flow/model.js",


 line 154: Java constructor for "java.lang.reflect.Array" with arguments
"number" not found
-----------------------------------------------------------

Is this expected behavior?  Any clues what I'm doing wrong?

Note, I can create a **JAVA** array using Packages.java.lang.reflect.Array.newInstance(class,number). But this seems wrong.

Thanks,
Greg

Reply via email to