title: How to Change the Class loader order to parent last in ManageModules using IBM JAVA API?
body: <p>I want to change Web Application's class loader order to PARENT_LAST  using WebSphere Java Administration API.</p>
  
  <p>Enterprise Applications > MyAppEAR  > Manage Modules > MyApp.war</p>
  
  <p>How to get the attribute to set using ConfigService.</p>
  
  <p>Tried the below code which threw </p>
  
  <blockquote>
    <p>java.lang.ClassCastException: java.util.ArrayList cannot be cast to javax.management.AttributeList
        at com.kony.admin.deployment.websphere.KonyWebsphereDeployer.updateArtifact(KonyWebsphereDeployer.java:1854)</p>
  </blockquote>
  
  <pre><code>  AttributeList clList = (AttributeList) configService.getAttribute (session, appDeplID, "modules"); 
    ConfigServiceHelper.setAttributeValue (clList, "classloaderMode", "PARENT_LAST"); 
    attrList.add (new Attribute ("modules", clList)); 
  </code></pre>
  
  <p>Thanks,
  Kusuma</p>