Buggy code:
public class JGroupsExtension implements Extension , DescriptionProvider , XMLElementReader < List < ModelNode > > , XMLElementWriter < SubsystemMarshallingContext > { static final String SUBSYSTEM_NAME = "jgroups" ; private static final PathElement stacksPath = PathElement . pathElement ( STACK ) ; private static final JGroupsSubsystemAdd add = new JGroupsSubsystemAdd ( ) ; private static final JGroupsSubsystemDescribe describe = new JGroupsSubsystemDescribe ( ) ; private static final ProtocolStackAdd stackAdd = new ProtocolStackAdd ( ) ; private static final ProtocolStackRemove stackRemove = new ProtocolStackRemove ( ) ; private static final DescriptionProvider stackDescription = new DescriptionProvider ( ) { @ Override public ModelNode getModelDescription ( Locale locale ) { } } ; @ Override public void initialize ( ExtensionContext context ) { } @ Override public void initializeParsers ( ExtensionParsingContext context ) { } @ Override public ModelNode getModelDescription ( Locale locale ) { } @ Override public void readElement ( XMLExtendedStreamReader reader , List < ModelNode > operations ) throws XMLStreamException { } private ModelNode parseStack ( XMLExtendedStreamReader reader , ModelNode address ) throws XMLStreamException { } private void parseProtocol ( XMLExtendedStreamReader reader , ModelNode protocol , Class < ? extends Protocol > targetClass ) throws XMLStreamException { for ( int i = 0 ; i < ( reader . getAttributeCount ( ) ) ; i ++ ) { String value = reader . getAttributeValue ( i ) ; Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case TYPE : { try { <START_BUG> this . getClass ( ) . getClassLoader ( ) . loadClass ( ( ( ( ProtocolConfiguration . protocol_prefix ) + '.' ) + value ) ) . asSubclass ( targetClass ) . newInstance ( ) ; <END_BUG> protocol . get ( TYPE ) . set ( value ) ; } catch ( Exception e ) { throw ParseUtils . invalidAttributeValue ( reader , i ) ; } break ; } case SHARED : { protocol . get ( SHARED ) . set ( Boolean . parseBoolean ( value ) ) ; break ; } case SOCKET_BINDING : { protocol . get ( SOCKET_BINDING ) . set ( value ) ; break ; } case DIAGNOSTICS_SOCKET_BINDING : { protocol . get ( DIAGNOSTICS_SOCKET_BINDING ) . set ( value ) ; break ; } case DEFAULT_EXECUTOR : { protocol . get ( DEFAULT_EXECUTOR ) . set ( value ) ; break ; } case OOB_EXECUTOR : { protocol . get ( OOB_EXECUTOR ) . set ( value ) ; break ; } case TIMER_EXECUTOR : { protocol . get ( TIMER_EXECUTOR ) . set ( value ) ; break ; } case THREAD_FACTORY : { protocol . get ( THREAD_FACTORY ) . set ( value ) ; break ; } default : { throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } } if ( ! ( protocol . hasDefined ( TYPE ) ) ) { throw ParseUtils . missingRequired ( reader , Collections . singleton ( Attribute . TYPE ) ) ; } while ( ( reader . hasNext ( ) ) && ( ( reader . nextTag ( ) ) != ( XMLStreamConstants . END_ELEMENT ) ) ) { if ( ( Element . forName ( reader . getLocalName ( ) ) ) != ( Element . PROPERTY ) ) { throw ParseUtils . unexpectedElement ( reader ) ; } int attributes = reader . getAttributeCount ( ) ; String property = null ; for ( int i = 0 ; i < attributes ; i ++ ) { String value = reader . getAttributeValue ( i ) ; Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case NAME : { property = value ; break ; } default : { throw ParseUtils . unexpectedAttribute ( reader , i ) ; } } } if ( property == null ) { throw ParseUtils . missingRequired ( reader , Collections . singleton ( NAME ) ) ; } String value = reader . getElementText ( ) ; protocol . get ( ModelKeys . PROPERTY ) . add ( property , value ) ; } } @ Override public void writeContent ( XMLExtendedStreamWriter writer , SubsystemMarshallingContext context ) throws XMLStreamException { } private void writeProtocol ( XMLExtendedStreamWriter writer , ModelNode protocol , Element element ) throws XMLStreamException { } private void writeRequired ( XMLExtendedStreamWriter writer , Attribute attribute , ModelNode model , String key ) throws XMLStreamException { } private void writeOptional ( XMLExtendedStreamWriter writer , Attribute attribute , ModelNode model , String key ) throws XMLStreamException { } }

Fix:
targetClass . getClassLoader ( ) . loadClass ( ( ( ( ProtocolConfiguration . protocol_prefix ) + '.' ) + value ) ) . asSubclass ( targetClass ) . newInstance ( ) ;