Hello all,

I am trying to embed Little-G (geronimo 1.1) in an eclipse RCP application. I want to run it in the same JVM as plugins in eclipse. To easily deploy this feature, I created an eclipse plugin that contains all the geronimo repositories (lib, var...).
Having a look at the way tomcat is embedded in the org.eclipse.tomcat plugin, I manage to launch geronimo but it stops at 14% because of a NoClassDefFoundException while
instanciating the first GBean. To avoid to use the BundleResourceHandler of eclipse when it tries to open jars, I made a test using a dedicated ClassLoader (JarFileClassLoader from geronimo).

Do you know a way to embed geronimo in eclipse using the same JVM.

Thanks you for your help.

Following the test code used to launch geronimo in the eclipse plugin (It calls the Daemon main method).


        URL[] urls = new URL[21];
        urls[0] = resolveURL("/bin/server.jar");
        urls[1] = resolveURL("/lib/geronimo-qname_1.1_spec-1.0.1.jar");
        urls[2] = resolveURL("/lib/geronimo- common-1.1.jar");
        urls[3] = resolveURL("/lib/geronimo-kernel-1.1.jar");
        urls[4] = resolveURL("/lib/geronimo-system-1.1.jar");
        urls[5] = resolveURL("/lib/geronimo- util-1.1.jar");
        urls[6] = resolveURL("/lib/cglib-nodep-2.1_3.jar");
        urls[7] = resolveURL("/lib/concurrent-1.3.4.jar");
        urls[8] = resolveURL("/lib/commons-cli-1.0.jar ");
        urls[9] = resolveURL("/lib/commons-logging-1.0.4.jar");
        urls[10] = resolveURL("/lib/log4j-1.2.8.jar");
        urls[11] = resolveURL("/lib/mx4j-3.0.1.jar");
        urls[12] = resolveURL("/lib/mx4j-remote-3.0.1.jar");
        urls[13] = resolveURL("/lib/endorsed/xercesImpl-2.6.2.jar");
        urls[14] = resolveURL("/lib/endorsed/xmlParserAPIs-2.2.1.jar ");
        urls[15] = resolveURL("/lib/xpp3-1.1.3.3.jar");
        urls[16] = resolveURL("/lib/xstream-1.1.3.jar");
        urls[17] = resolveURL("/bin/client.jar");
        urls[18] = resolveURL("/bin/deployer.jar");
        urls[19] = resolveURL("/bin/shutdown.jar");
        urls[20] = resolveURL("/bin/upgrade.jar");
        //urls[0] = resolveURL("/");
            
        JarFileClassLoader customLoader = new JarFileClassLoader(new Artifact( XrcpActivator.PLUGIN_ID, "", "", ""), urls, this.getClass().getClassLoader(), true, new String[0], new String[0]);
                
        try {
            Class mainClass = customLoader.loadClass ("org.apache.geronimo.system.main.Daemon");
            Method m = mainClass.getMethod("main", new Class[]{String[].class});
            m.invoke(null, new Object[]{new String[0]});
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        
But I obtain the following log :

[***                        ] 12%   5s Starting geronimo/j2ee-serve...
[***-                       ] 12%   5s  Loading geronimo/j2ee-secur...
[***>                       ] 14%   5s  Loading geronimo/j2ee-secur...
[***>                       ] 14%   5s Starting geronimo/j2ee-secur...java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.eclipse.tomcat.internal.TestJob.run(TestJob.java:86)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
Caused by: java.lang.NoClassDefFoundError : org.apache.geronimo.system.rmi.RMIClassLoaderSpiImpl
    at java.rmi.server.RMIClassLoader.initializeProvider(Unknown Source)09:36:19,293 WARN  [1/car,j2eeType=GBean,name=JMXService] Failure in JMXConnector service:jmx:rmi://0.0.0.0:9999/jndi/rmi://0.0.0.0:1099/JMXConnector
09:36:19,303 ERROR [GBeanInstanceState] Error while starting; GBean is now in the FAILED state: abstractName="geronimo/j2ee-security/1.1/car?ServiceModule=geronimo/j2ee-security/1.1/car,j2eeType=GBean,name=JMXService"
java.lang.NoClassDefFoundError: org.apache.geronimo.system.rmi.RMIClassLoaderSpiImpl
    at java.rmi.server.RMIClassLoader.initializeProvider(Unknown Source)
    at java.rmi.server.RMIClassLoader.access$000(Unknown Source)
    at java.rmi.server.RMIClassLoader$1.run(Unknown Source)