IBM NoClassDefFoundError running Java class selected from server plugin jar - United States wid; noclassdeffounderror; java; jar TECHNOTE (TROUBLESHOOTING)

PROBLEM(ABSTRACT)
 The visual snippet editor allows you to search and find methods in classes available only on a restricted basis at runtime. A runtime exception occurs when the Java™ snippet calls a method in a class found in one of the plugin JARs in the server's plugins directory. 

CAUSE
Some of the Java methods found in the JARs in the server's plugin directory are available to be called, but some of them are considered internal use only and an exception is thrown if you try to call them from user code.

DIAGNOSING THE PROBLEM
A runtime exception is detected in the server log naming a class and method called from a visual snippet in the application.

RESOLVING THE PROBLEM
The reason the method you selected in the snippet editor cannot be called in the JAR in the plugins directory is because of the architecture of the server. JARs in the plugins directory have a list that specifies what classes in the JAR can be called. This is called the exports list, and it is honored by the class loader the server uses. Classes not on the list are considered internal use only. Thus, not all classes in the server plugin JARs are available to be called by user code. 

You can call any method when the JAR is in the server's library directorym because it is not being treated as a plugin and a different class loader is used, one which does not implement the exports list.

The snippet editor is not aware of this mechanism so it treats a plugin JAR the same as a regular Java JAR file. That is it allows you to select the (unavailable) class and method to call in your program. The resolution is to make sure that classes you call in plugin JARs appear on the exports list. 

For example you may search for StringUtils and find the class org.apache.commons.lang.StringUtils in the WebSphere JAR plugin/com.ibm.ws.jpa.jar. This class is used internally by the plugin and it is not exported. In this case you must download the class you need directly from Apache and place the JAR in the server's classpath.
WAS runtime classpath does not match WAS Server Runtime library in RAD  I've run into a classpath problem in WAS 8.0 for my web application. The problem is that it compiles fine i RAD but I get a NoClassDefFoundError in Runtime.  
Some of the Java methods found in the JARs in the server's plugin directory are available to be called, but some of them are considered internal use only and an exception is thrown if you try to call them from user code.