This may not help you much, but ...

I'm doing something similar (spring-managed mbean) but w/o hibernate,  
and it works as expected for me.  I am, however, using a non-standard  
third party library (Joda Time) in my MBean, and that seems to be  

How are you exporting the bean?

I have a very very simple setup, being something of an MBean newbie.   
I've got an interface that looks something like this:

public interface MyManagementMBean {

   public void anOperation(String aKey, String aDateAsString);


and an implementation class:

import org.joda.time.format.*;

public class MyManagementImpl implements MyManagementMBean {

   public void anOperation(String key, String aDateAsString) {
     // parse the date using Joda time, and do something ...


     <bean id='jmx-management'

     <bean id='exporter'
       <property name='beans'>
          <entry key='bean:name=myBean' value-ref='jmx-management'/>

I can then start jconsole, find the bean, and invoke the operation.   
It all seems to work fine.

the main thing I recall is removing everything but the most primitive  
of types from the interface.  Even java.util.Date won't work there.   
But the bean implementation certainly can use types loaded from the  
application classloader.

On Mar 25, 2008, at 12:57 PM, Karl Goldstein wrote:

> I have a Spring-managed MBean that I would like to register with  
> the resin MBeanServer (the one bound to "java:comp/env/jmx/ 
> MBeanServer" in JNDI).  This MBean defines some operations to query  
> and update some metadata in the database, using Hibernate/JPA.
> The MBean registers fine and I can see it in jconsole in the right  
> place.  However, when I tried to invoke an operation, I received an  
> error.  The underlying exception was this:
> interface org.hibernate.jdbc.ConnectionWrapper is not visible from  
> class loader
> Loading the Hibernate and Spring jars in the parent classloader  
> solved the immediate problem:
> <resin xmlns="";
>        xmlns:resin="";>
>   <class-loader>
>     <tree-loader path="lib"/>
>     <tree-loader path="/path/to/my/webapp/WEB-INF/lib/"/>
>   </class-loader>
>   ...
> However, I'd rather not do this because I want to retain the  
> ability to deploy multiple webapps with different versions of  
> dependencies like Spring and Hibernate (mainly so we can deploy a  
> new version of our webapp and leave the old one untouched so we  
> have a fallback).
> Is there some way to make it so that mbeans are registered and  
> invoked in the classloader of the webapp that registered them?
> Any suggestions are appreciated.
> Regards,
> Karl
> Looking for last minute shopping deals? Find them fast with Yahoo!  
> Search.
> _______________________________________________
> resin-interest mailing list



resin-interest mailing list

Reply via email to