Bjoern Eilers

ArrayList instead of Vector as invokeService parameter in EJB

Discussion created by Bjoern Eilers on Jul 13, 2009
Latest reply on Aug 31, 2009 by Bjoern Eilers



We have currently a small reengineering of our Java code running in our project, which includes replacing java.util.Vector with java.util.ArrayList (because ArrayList is not synchronized and because of this may bring better performance results).

While testing these changes, I stumbled upon some strange behaviour:

We have several entrypoints that have an "array of  SomeClass" as parameter.Up until now, we defined those arrays as follows:


List someClasses = new Vector();



invokeService("ServiceName", "invokeEntrypointForSomeClass", null, new Object[] { someClasses });


Now we changes the first line to the following:


List someClasses = new ArrayList();


Now, when we call the entry point,the following exception is thrown (I had to translate part of the exception as it originally was in German):


java.lang.IllegalArgumentException: Conversion of '[SomeClass]' to type class ist nicht m÷glich.



As far as I understood, both Vector and ArrayList are supported for the "array of..." construct in Blaze Advisor.


Does anyone know if I missed something?


Best regards,