When deploying a Connector Module to Glassfish through Admin Console, it would
fail to configure the Connector Module because Admin Console is unable to load
class needed by Connector Module. Same deployment is successful when using
commandline "asadmin deploy <file_name>".
The reason is because for our Connector Module, we put the classes required by
Connector Module inside jars in "glassfish/domains/domain1/lib" directory.
This is legal, since this is the Commmon Classloader as defined by Glassfish
Classloader hierachy, Connector Module would delegate classloading to its
parent Classloader, which is the Common Classloader.
However, when Admin Console is deploying the Connector Module, after the first
deployment step, in the next step it would attempt to configure the resource-
adapter-class bean as defined in ra.xml of Connector Module. In order to do
this, Admin Console will try to load the this resource-adapter-class. However
Admin Console does not use the Glassfish Classloader hierachy to load the
class, instead it uses "com.sun.enterprise.connectors.util.RARUtils" to load
the class, and this helper class only tries to load from jars inside the
Connector Module archive and jars under "glassfish/lib" directory. It ignores
the "domain1/lib" directory, thus it would catch
java.lang.ClassNotFoundException at line 105 of RARUtils, and log a harmless
message in server.log such as
However, this would not work for us, since we would like to have the Admin
Console to deploy the Connector Module and configure the adapter-class. Admin
Console needs to use the same Classloading hierachy as Glassfih container to
try to load this adapter-class.