Sounds like a ClassLoader problem.  There are a number of
ClassLoaders here.  All MBeans are loaded by one.  Each EJB JAR uses a
separate one.  Each servlet context in Tomcat uses yet another one.  What
you should try to do is determine which ClassLoader loads your factory
classes and which is current when you get the ClassNotFoundException or
NoClassDefFoundError.  Depending on the combination, you may be able to
set the correct ClassLoader to be current before you do whatever it is you
need to do.  If you're using Tomcat, make sure you include the
JDK12Interceptor in the xerver.xml file (See the Tomcat instructions on
the web page).  But if your client is the one executing the code to create
a UserTransImpl, remember that your client does not have access to
UserTransImpl unless you get it included in jboss-client.jar (jboss.jar is
not good enough).  And even if the server process creates it, it may get
serialized to the client, in which case the class still needs to be
available in the client's ClassLoader.

Aaron

On Sat, 16 Sep 2000, Charles Crain wrote:
> Ugh, I am having more toruble with this than I thought I would.  Since the
> problem of prvidign a UserTransaction to clients running in jBoss that are NOT
> beans (i.e., Tomcat servlets) is a harder thing to do, I decided to attack it
> first.  The problem I am running into is weird...I created two new classses
> under org/jboss/tm, UserTransactionFactory and UserTransImpl.  As you might
> guess, UserTransactionFactory is an ObjectFactory that creates UserTransImpl
> objects.  Again, I could not use the EnterpriseContext's getTransactionFactory,
> because I am trying to serve up UserTransaction's to ALL clients running in our
> VM.
> 
> The problem is, whenever I try to create a UserTransImpl object I get a
> NoClassDefFound exception.  This appears regardless of where/when I try to
> actually create it (at the time of the TransactionManagerService initialization,
> when it is actually looked up, etc.).  I checked and that class is DEFINITELY in
> the jboss.jar file.  Any ideas?
> 
> -Charles



Reply via email to