Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Eclipse DSDP/MTJ Bundle Loader Hooks Trouble in Galileo

Hello Eclipse Runtime experts,

In order to provide preprocessor support for low-end Java devices/ phones, EclipseME/MTJ has hooked into JDT by using a Classloader hook for a few releases. This has worked fine until recent Galileo builds. One of our users let us know that our runtime hooks are no longer working on the Galileo builds. The exception stack trace the user is seeing is:

Caused by: java.lang.NoClassDefFoundError: org/eclipse/osgi/ framework/internal/core/BundleLoader at org .eclipse .mtj.core.hooks.MTJClassLoadingHook.createClassLoader(Unknown Source) at org .eclipse.osgi.baseadaptor.BaseData.createClassLoader(BaseData.java:92) at org .eclipse .osgi.internal.loader.BundleLoader.createBCL(BundleLoader.java:821) at org .eclipse .osgi .internal.loader.BundleLoader.createBCLPrevileged(BundleLoader.java: 810) at org .eclipse .osgi .internal.loader.BundleLoader.createClassLoader(BundleLoader.java:356) at org .eclipse .osgi.internal.loader.BundleLoader.loadClass(BundleLoader.java:317) at org .eclipse .osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java: 227) at org .eclipse .osgi .framework .internal .core.AbstractBundle.loadBundleActivator(AbstractBundle.java:142)
	... 10 more

The hook is configured using:

public void addHooks(HookRegistry hookRegistry) {
        if (Debug.DEBUG_GENERAL) {
            System.out.println("Adding MTJ class loading hook");
        }

        hookRegistry.addClassLoadingHook(new MTJClassLoadingHook());
    }


The offending code:

public BaseClassLoader createClassLoader(ClassLoader parent,
ClassLoaderDelegate delegate, BundleProtectionDomain domain,
            BaseData data, String[] bundleclasspath) {
        boolean isJdtCore = "org.eclipse.jdt.core".equals(data
                .getSymbolicName());
boolean isEclipseBundleLoader = delegate instanceof BundleLoader;

        // If the bundle loader is of the current type and is for
// the JDT core bundle, we will go ahead and force an OSGi "wire"
        // back to our package implementation from the JDT plug-in.
        if (isEclipseBundleLoader && isJdtCore) {
            if (Debug.DEBUG_GENERAL) {
                System.out
.println("Adding dynamic import into JDT Core bundle");
            }

            try {
                ManifestElement[] dynamicElements = ManifestElement
                        .parseHeader("DynamicImport-Package",
"org.eclipse.mtj.core.hook.sourceMapper");
                ((BundleLoader) delegate)
                        .addDynamicImportPackage(dynamicElements);
            } catch (BundleException e) {
                if (Debug.DEBUG_GENERAL) {
                    e.printStackTrace();
                }
            }
        }

// Let the framework know that we did not create the classloader
        return null;
    }

Any insights into how we can resolve these issues would be appreciated. I've noticed discussion of the new OSGi ServiceHooks features and I didn't know if it was somewhat related.

Thanks,
Craig



Back to the top