The attached patch contains a fix for the split package problem. The patch makes the org.apache.openejb.client NOT to be exported from the openejb-core bundle and instead it exports a new org.apache.openejb.osgi.client package that contains a LocalInitialContextFactory that should be used in OSGi environment. That way, the existing code using the LocalInitialContextFactory in non-OSGI environment will continue to work as before and only the code running in OSGI environment will need to be updated to use the LocalInitialContextFactory from org.apache.openejb.osgi.client package.
The patch also cleans up the openejb-client module pom a little to remove the unnecessary maven-bundle-plugin entry (the maven-bundle-plugin is already enabled in parent pom).
Btw, this patch only fixes the split package problem. I haven't tried yet if the new LocalInitialContextFactory actually works in the OSGi environment.