Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002556 [Resin] minor always 03-26-08 13:40 03-27-08 08:58
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.1.5
Summary 0002556: jmx invocation with classloader
Description (rep by Karl Goldstein)

 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="http://caucho.com/ns/resin" [^]
      xmlns:resin="http://caucho.com/ns/resin/core"> [^]

 <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?

Additional Information
Attached Files  C:\apps\resin-3.1.1\conf\bug.conf [^] (2,085 bytes) 03-27-08 08:46

- Relationships

- Notes
(0002922)
karl
03-27-08 08:48

In case it's helpful, I've uploaded the resin config I've been using for the webapp. I am registering the MBean with the object name

resin:type=WebApp,Host=default,name=/1.0,group=SiteStatus

(SiteStatus is an identifier for the MBean, and the webapp is mounted under /1.0 of the default host)
 
(0002923)
ferg
03-27-08 08:58

server/2152

The configuration doesn't really matter, since it's a fairly straightforward issue. We just didn't change the classloader context when calling the JMX bean.

Resin's admin documentation is at http://caucho.com/doc/resin-admin.xtp [^]
 

- Issue History
Date Modified Username Field Change
03-26-08 13:40 ferg New Issue
03-27-08 08:46 karl File Added: C:\apps\resin-3.1.1\conf\bug.conf
03-27-08 08:48 karl Note Added: 0002922
03-27-08 08:58 ferg Note Added: 0002923
03-27-08 08:58 ferg Assigned To  => ferg
03-27-08 08:58 ferg Status new => closed
03-27-08 08:58 ferg Resolution open => fixed
03-27-08 08:58 ferg Fixed in Version  => 3.1.6


Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker