But I get it when the ear is build in Sun's JVM using Maven and then deployed it in Websphere (IBM JVM) and run it.Why are you doing that? It's very poor practice. You should use the same JDK for development and production. Then if you have problems like this they will arise in development where you can debug them.
For any product like ours, The decision lies in the client where he/she might want to use it, in which application server, and which vendor's jdk is to be used. We can only specify the version of the JDK.Of course it's the client's decision. So you have to support all the JDKs that your clients use. So you have to use them all at development time. So that you don't get surprises like this at deployment time or execution time.
So, we have to make it executable in multiple type of JDK.See above.
Also, the only significant difference between JDK's (Sun ad IBM) is how they treat RMIC. It has been shown empirically that Sun and IBM JDK's are identical except for the RMIC and Orb components.I don't know where you got that factoid from but it is most certainly not correct. I can name at least two other differences off the top of my head. And factoids like this don't absolve you of the responsibility to test in the target environment. It's become a cliche: 'Java: write once, test everywhere'.
Mridul wrote:The other way around; from Object array to Integer.Yes I understand that it is an error on conversion from Integer to Object array.
The exception is: java.lang.ClassCastException: java.lang.Integer incompatible with [Ljava.lang.Object;
But this should not have been the problem, The code is a successfully running, even in the production environment.That cannot explain it. There must be some other difference.
The only change we have introduced is that previously the EAR was built using IBM's RAD by exporting the project as ear, but now we use MAVEN to build the ear.
This problem is in advanced for loop and once I change the for loop to an iterator based approach, it works fine.