Hello!

I've been playing with apache felix for some months. Now I am building a bundle that depends on external jars and use a bit of reflection.

To overcome the problem of the external library I have used the Bundle-ClassPath: manifest header.

Currently my problem is when I tried to load a class using reflection and I get a class not found exception.


javax.management.ReflectionException: The MBean class could not be loaded by the default loader repository at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.findClassWithDefaultLoaderRepository(MBeanInstantiatorImpl.java:61) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:271) at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.createMBean(DefaultMBeanServerInterceptor.java:211) at com.sun.jmx.mbeanserver.JmxMBeanServer.createMBean(JmxMBeanServer.java:408)
       at kAdapt.mbeanServer.MainServer.registerMBean(MainServer.java:131)


Caused by: java.lang.ClassNotFoundException: kAdapt.mbeanServer.InfoMBean
at com.sun.jmx.mbeanserver.ClassLoaderRepositorySupport.loadClass(ClassLoaderRepositorySupport.java:208) at com.sun.jmx.mbeanserver.ClassLoaderRepositorySupport.loadClass(ClassLoaderRepositorySupport.java:128) at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.findClassWithDefaultLoaderRepository(MBeanInstantiatorImpl.java:58)
       ... 18 more


The class in question kAdapt.mbeanServer.InfoMBean is of course in the package hierarchy but the osgi classloader seems to miss it ...
 I would like to know why this happens and the solution.

( In this particular problem the class failing to load is an MBean when trying to create it -->> at com.sun.jmx.mbeanserver.MBeanInstantiatorImpl.findClassWithDefaultLoaderRepository(MBeanInstantiatorImpl.java:61) but I think that this problem will happen whenever one uses reflection ... Am I right ?
)

I tried with DynamicImport-Package but without success too ...

Here is my manifest

Manifest-Version: 1.0
Archiver-Version: Plexus Archiver
Created-By: Apache Maven
Build-Jdk: 1.5.0_12
Bundle-Activator: kAdapt.Activator
DynamicImport-Package: kAdapt.mbeanServer <<---- the class not found is here
Bundle-ClassPath: .,kAdapt,js-1.6R5.jar
Import-Package: org.osgi.framework;version=1.3,org.osgi.service.log;ve
rsion=1.3,javax.management.remote,javax.management,javax.xml.parsers,
org.w3c.dom,org.xml.sax
Bundle-ManifestVersion: 2

Any guidance will be greatly appreciated.

Miguel Matos

PS: I think I could use the jmx facilities provided by felix ( I am already doing that in another bundle, but that is not the point in my question....))

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to