Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » ClassNotFoundException for embedded activator when starting in eclipse target platform
ClassNotFoundException for embedded activator when starting in eclipse target platform [message #1705429] Sat, 15 August 2015 09:51
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
Summary of the problem:
- A bundle built with maven-bundle-plugin embeds a BundleActivator
implementation from another jar
- The embedded activator and its dependencies has a different namespace
than the actual code of the bundle
- The bundle with the embedded BundleActivator works in PAX Exam
integration tests and the service provided becomes active in the gogo
shell and the felix web console
- When adding the bundle with the embedded activator to the target
platform with the pde-target-maven-plugin and using the resulting
.target file as the target platform when starting a GEF project as an
"eclipse application" inside eclipse 4.4.2 Luna, the bundle shows up
as RESOLVED in the osgi console, and trying to start the bundle
manually gives a ClassNotFundException on the bundle activator

Is there a known problem with using bundles created with
maven-bundle-plugin from inside eclipse? Ie. activator not being

Could there be a problem with the bundle being built against Felix OSGi
instead of equinox?

Is the OSGi version I compiled the bundle with, incompatible with the
OSGi version of the equinox runtime I've tried to use? (I suspect this
may be the case and have tried to make a Luna-based target platform but
have so far been unsuccessful in making it work. I can't find the same
features as the one year old target platform attached before)

Could it be a problem the generated by the
maven-bundle-plugin? Eg. the bundle-classpath (the bundle in question
doesn't have a bundle-classpath)? I have tried setting the
Bundle-Classpath to "." but that didn't help.

More detailed information (the of the bundle, the generated file and the source code of the embedded bundleactivator, the
bundle itself, as well as the eclipse project, follows at the end of
this message)


- Steinar

Source code for the projects:
The activator:
The bundle:
The eclipse project:
(the branch "using-modelstore")

My development setup:
- Check out the code
mkdir -p $HOME/workspaces/ws02/
cd $HOME/workspaces/ws02/
git clone
cd jsr330activator
mvn clean install
cd ..
git clone
cd modelstore
mvn clean install
cd ..
git clone
cd modeler
git checkout using-modelstore
cd ..
- Open eclipse with workspaces/ws02 as the workspace (I am currently
using eclipse 4.4.2 Luna)
- Import the existing projects from the workspace (to avoid cluttering
the workspace completely, drop the gogo shell projects from the
import) as existing maven projects

Start up the gogo shell on the bundle (to verify that the activator works)
- Build the project and start the gogo shell (and the felix web
cd $HOME/workspaces/ws02/jsr330activator
mvn clean install
cd ../modelstore
mvn clean install
cd modelstore.gogoshell
mvn install pax:provision
- Check the bundle in the gogo shell,
- give the following command in the command line where "mvn pax:provision" was executed:
it should list the no.bang.priv.modeling.modelstore as ACTIVE near
the end
- give the following command:
inspect capability no.priv.bang.modeling.modelstore
it should show the bundle as providing the service
- Check the bundle in the felix web console:
- Open http://localhost:8080/system/console/ in a web browser
(username/password admin/admin)
- Open the modelstore bundle and inspect the results
- Exit the gogo shell with the following command:
exit 0

Attached are the file of the bundle, and the .target file
used for starting the the "eclipse application" runtime configuration.

The manifest:

Manifest-Version: 1.0
Bnd-LastModified: 1439629481692
Build-Jdk: 1.7.0_51
Built-By: sb
Bundle-Activator: no.steria.osgi.jsr330activator.Jsr330Activator
Bundle-ManifestVersion: 2
Bundle-Name: modelstore OSGi Bundle
Bundle-SymbolicName: no.priv.bang.modeling.modelstore
Bundle-Version: 1.0.0.SNAPSHOT
Created-By: Apache Maven Bundle Plugin
Embed-Dependency: jsr330activator.implementation;inline=true,javax.injec
Export-Package: no.priv.bang.modeling.modelstore;version="1.0.0.SNAPSHOT
Import-Package: com.fasterxml.jackson.core;version="[2.5,3)",com.fasterx
Tool: Bnd-1.50.0

The .target file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="" sequenceNumber="48">
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="" version="3.6.0.v20140117-1004"/>
<unit id="" version="3.9.2.v20140221-1700"/>
<unit id="" version=""/>
<unit id="" version="4.3.2.v20140221-1852"/>
<unit id="" version="1.2.2.v20140206-1358"/>
<repository location=""/>
<location path="C:\Users\sb\.m2\repository\javax\inject\javax.inject\1" type="Directory"/>
<location path="C:\Users\sb\.m2\repository\no\priv\bang\modeling\modelstore.implementation\1.0.0-SNAPSHOT" type="Directory"/>
<location path="C:\Users\sb\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.6.0" type="Directory"/>
Previous Topic:Get host servletcontext init param with mars servlet bridge
Next Topic:Testing an OSGI/JDT/Eclipse plugin with Pax-exam
Goto Forum:

Current Time: Sat Sep 24 22:31:54 GMT 2022

Powered by FUDForum. Page generated in 0.01924 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top