FreeKB - Class loader viewer
IBM WebSphere - Class loader viewer

If you are not familiar with what a class is in Java, check out our article on Java classes. Let's say you've deployed a JAR to one of your WebSphere application servers or you've deployed an EAR or WAR application that contains a JAR in it's WEB-INF/lib folder. Using the jar command, you can display the classes in the JAR file, like this. In this example, there are two classes in EJBBackend.jar, com.ejb.businesslogic.Hello and com.ejb.remoteinterface.Greeting.

#]~ jar -tf ${WAS_INSTALL_ROOT}/profiles/your_profile/installedApps/your_profile/your.ear/EJBBackend.jar
META-INF
META-INF/MANIFEST.MF
com
com/ejb
com/ejb/businesslogic/
com/ejb/businesslogic/Hello.class
com/ejb/remoteinterface
com/ejb/remoteinterface/Greeting.class

 

Select Servers Server Types > WebSphere application servers > your application server > Class loader viewer service and select Enable service at server startup. Restart the application server for this change to take effect.

 

Navigating to Troubleshooting > Class loader viewer and then select the your WAR.

 

Expand Module - com.ibm.ws.classloader.CompoundClassLoader > Classpath to view the JAR files being loaded. Additionally, .class files below the "classes" directory will be loaded.

 

Selecting Classes will display the classes in the JAR. Notice in this example that both com.ejb.businesslogic.Hello and com.ejb.remoteinterface.Greeting are displayed, meaning that the EJBFrontend.war application is able to load the com.ejb.businesslogic.Hello and com.ejb.remoteinterface.Greeting classes.

 

Likewise, if the EJBBackend.jar is deployed to a WebSphere application server, the classes in the JAR can also be seeing using the WebSphere admin console. You would navigate to Troubleshooting > Class loader viewer, and then select the JAR file.

 



Add a Comment




We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.




Please enter c7ead in the box below so that we can be sure you are a human.




Comments