JBoss does not starts with jamvm today with the class cast exception in the sentence: this.modelAttributes = (ModelMBeanAttributeInfo[]) super.getAttributes(); This was confirmed by the two independent observers on both JamVM and CACAO.
Created attachment 12041 [details] Stack trace and JBoss messages
Confirmed (by TWISTI)
*** Bug 28653 has been marked as a duplicate of this bug. ***
I found the reason for this: javax.management.modelmbean.ModelMBeanInfoSupport assumes that all kinds of arrays retrieved from its superclass can be cast to a specific derived type. I saw that many places in GNU Classpath use the "new array - arraycopy" idiom to copy arrays, which probably is the right thing, as you end up with the most general array type that makes sense. JBoss code in this case assumes that array _cloning_ is used in the superclass constructor, so the more derived type of the arrays is preserved. I'll attach a patch fixing this particular case.
Created attachment 12427 [details] patch fixing the ClassCastException by cloning instead of arraycopy
Does anyone know if the attached patch can be committed? Is the necessary paperwork in place?
Subject: Bug 28652 CVSROOT: /cvsroot/classpath Module name: classpath Changes by: Andrew John Hughes <gnu_andrew> 07/02/15 23:46:31 Modified files: . : ChangeLog javax/management: MBeanInfo.java Log message: 2006-10-14 Edwin Steiner <edwin.steiner@gmx.net> PR classpath/28652: * javax/management/MBeanInfo.java (MBeanInfo): Use clone to duplicate the arrays in order to preserve the array type. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/classpath/ChangeLog?cvsroot=classpath&r1=1.9111&r2=1.9112 http://cvs.savannah.gnu.org/viewcvs/classpath/javax/management/MBeanInfo.java?cvsroot=classpath&r1=1.5&r2=1.6
Patch committed. Closing.
Subject: Bug 28652 Author: tromey Date: Fri Feb 16 19:19:11 2007 New Revision: 122050 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122050 Log: 2006-10-14 Edwin Steiner <edwin.steiner@gmx.net> PR classpath/28652: * javax/management/MBeanInfo.java (MBeanInfo): Use clone to duplicate the arrays in order to preserve the array type. Modified: trunk/libjava/classpath/ChangeLog trunk/libjava/classpath/javax/management/MBeanInfo.java trunk/libjava/classpath/lib/javax/management/MBeanInfo.class
Subject: Bug 28652 Author: tromey Date: Fri Feb 16 19:21:55 2007 New Revision: 122051 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122051 Log: 2006-10-14 Edwin Steiner <edwin.steiner@gmx.net> PR classpath/28652: * javax/management/MBeanInfo.java (MBeanInfo): Use clone to duplicate the arrays in order to preserve the array type. Modified: branches/redhat/gcc-4_1-branch-java-merge-20070117/libjava/classpath/ChangeLog branches/redhat/gcc-4_1-branch-java-merge-20070117/libjava/classpath/javax/management/MBeanInfo.java