FreeKB - Class loader viewer in WebSphere
Class loader viewer in WebSphere

Home > Search


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.

 

In this example, the EJBFrontend.war application's WEB-INF/lib folder contains the EJBBackend.jar. This can be seen in the WebSphere admin console by navigating to Troubleshooting > Class loader viewer and then selecting the EJBFrontend.war.

 

Then, expanding Module - com.ibm.ws.classloader.CompoundClassLoader > Classpath will show that the EJBBackend.jar file is part of the EJBFrontend.war class path.

 

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 578f5 in the box below so that we can be sure you are a human.




Comments