Back to DevDoc

Here are some documentation about integrating equinox in the Netbeans platform-based GUI. After testing to patch netigso, Jaroslav has published NetBinox that accomplish equinox integration into NBP. See our tests with Netbinox.

References

Attempt to patch Netigso

Here are notes about my first attemps with felix-based netigso.

  • Retrieve netisgo with mercurial
    hg clone http://hg.netbeans.org/netigso/ netigso/
    
  • Build the platform
    cd netigso; ant build -Dpermit.jdk6.builds=true
    
  • Replace Felix jar by Equinox jar and remove binaries-list file to prevent felix.jar download at each build.
    wget -O core.netigso/external/felix.jar 'http://download.eclipse.org/equinox/drops/M20090824-0800/org.eclipse.osgi_3.5.1.R35x_v20090817.jar'
    rm core.netigso/external/binaries-list
    
  • Adapt NetigsoModuleFactory.java code to use equinox (Diff). Some interesting equinox classes:
    • org.eclipse.osgi.launch.EquinoxFactory
    • org.osgi.framework.launch.Framework
    • TODO how to put NetigsoActivator in equinox ? Is it needed ?
  • TODO Adapt the method join in NetigsoActivator.java
  • Rebuild the platform
    cd netigso; ant build -Dpermit.jdk6.builds=true
    
  • Test the module
    • Add the platform built in netigso/nbbuild/netbeans/ in your Netbeans IDE through the menu Tools -> NetBeans Platform
    • Create a new NetBeans Platform Application and choose in the wizard the previous added platform
    • Create a new module in this application, and add in the properties the library NetBeans OSGi integration
    • TODO

State

I use this code to give equinox to netigso:

            Map<String,Object> configMap = new HashMap<String,Object>();
            // Add core OSGi packages to be exported from the class path
            // via the system bundle.
            configMap.put(Constants.FRAMEWORK_SYSTEMPACKAGES,
                    "org.osgi.framework; version=1.4.0," +
                    "org.osgi.service.packageadmin; version=1.2.0," +
                    "org.osgi.service.startlevel; version=1.1.0," +
                    "org.osgi.util.tracker; version=1.3.3," +
                    "org.osgi.service.url; version=1.0.0");
            configMap.put(Constants.FRAMEWORK_STORAGE_CLEAN, "onFirstInit");
            activator = new NetigsoActivator();
            List<BundleActivator> activators = new ArrayList<BundleActivator>();
            activators.add(activator);
            configMap.put("felix.systembundle.activators", activators);
            System.setProperty("osgi.install.area","/home/dumoulin/tmp/eclipse/");
            configMap.put("osgi.install.area","/home/dumoulin/tmp/eclipse/");
            EquinoxFactory ef = new EquinoxFactory();
            equinoxFramework = ef.newFramework(configMap);
            equinoxFramework.init();

I've in /home/dumoulin/tmp/eclipse/ an equinox environment exported from Eclipse that works when launching from a shell with the command java -jar plugins/org.eclipse.equinox.launcher_1.0.200.v20090520.jar.

But, I've this exception:

java.lang.NullPointerException
        at java.io.File.<init>(File.java:305)
        at 
org.eclipse.osgi.internal.baseadaptor.BaseStorage.getBundleContent(BaseStorage.java:656)
        at 
org.eclipse.osgi.internal.baseadaptor.BaseStorage.createBundleFile(BaseStorage.java:665)
        at 
org.eclipse.osgi.baseadaptor.BaseAdaptor.createBundleFile(BaseAdaptor.java:466)
        at 
org.eclipse.osgi.baseadaptor.BaseData.getBundleFile(BaseData.java:394)
        at org.eclipse.osgi.baseadaptor.BaseData.getEntry0(BaseData.java:111)
        at org.eclipse.osgi.baseadaptor.BaseData.getEntry(BaseData.java:102)
        at 
org.eclipse.osgi.framework.internal.core.AbstractBundle.getEntry0(AbstractBundle.java:1232)
        at 
org.eclipse.osgi.framework.internal.core.Framework.findInSystemBundle(Framework.java:558)
        at 
org.eclipse.osgi.framework.internal.core.Framework.findVMProfile(Framework.java:504)
        at 
org.eclipse.osgi.framework.internal.core.Framework.loadVMProfile(Framework.java:420)
        at 
org.eclipse.osgi.framework.internal.core.Framework.initialize(Framework.java:224)
        at 
org.eclipse.osgi.framework.internal.core.Framework.<init>(Framework.java:157)
        at 
org.eclipse.osgi.framework.internal.core.EquinoxLauncher.internalInit(EquinoxLauncher.java:68)
        at 
org.eclipse.osgi.framework.internal.core.EquinoxLauncher.init(EquinoxLauncher.java:38)
        at org.eclipse.osgi.launch.Equinox.init(Equinox.java:89)
        at 
org.netbeans.core.netigso.NetigsoModuleFactory.getContainer(NetigsoModuleFactory.java:180)

After some investigation, the exception is thrown because the equinox bundle (org.eclipse.osgi) has a StorageHook with a null filename. The context is that in the class BaseStorage, the method getBundleContent(BaseData bundledata) is called from createBundleFile(Object , BaseData ), with

bundledata (SystemBundleData) = org.eclipse.osgi_3.6.0.20090825

Anton Epple has noticed that it seems that Equinox is not yet ready for this kind of muddle.

logo cemagref

logo iscpif

logo lifegrid

logo region auvergne

logo patres project