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
started?

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 manifest.mf 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 manifest.mf of the bundle, the generated
..target 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)

Thanks!


- Steinar

Source code for the projects:
The activator: https://github.com/sbang/jsr330activator
The bundle: https://github.com/sbang/jsr330activator
The eclipse project: https://github.com/steinarb/modeler
(the branch "using-modelstore")

My development setup:
- Check out the code
mkdir -p $HOME/workspaces/ws02/
cd $HOME/workspaces/ws02/
git clone https://github.com/sbang/jsr330activator.git
cd jsr330activator
mvn clean install
cd ..
git clone https://github.com/steinarb/modelstore.git
cd modelstore
mvn clean install
cd ..
git clone https://github.com/steinarb/modeler.git
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
console)
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:
bundles
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
no.priv.bang.modeling.modelstore.Modelstore
- 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 manifest.mf 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
t;inline=true
Export-Package: no.priv.bang.modeling.modelstore;version="1.0.0.SNAPSHOT
"
Import-Package: com.fasterxml.jackson.core;version="[2.5,3)",com.fasterx
ml.jackson.core.util;version="[2.5,3)",no.priv.bang.modeling.modelstore
,org.osgi.framework;version="[1.6,2)",org.osgi.framework.wiring;version
="[1.0,2)"
Tool: Bnd-1.50.0


The .target file:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?pde version="3.8"?><target name="modeler.target" sequenceNumber="48">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="true" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.equinox.executable.feature.group" version="3.6.0.v20140117-1004"/>
<unit id="org.eclipse.jdt.feature.group" version="3.9.2.v20140221-1700"/>
<unit id="org.eclipse.gef.feature.group" version="3.9.1.201308190730"/>
<unit id="org.eclipse.platform.feature.group" version="4.3.2.v20140221-1852"/>
<unit id="org.eclipse.e4.rcp.feature.group" version="1.2.2.v20140206-1358"/>
<repository location="http://download.eclipse.org/releases/kepler"/>
</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"/>
</locations>
</target>
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 Apr 27 04:14:25 GMT 2024

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

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

Back to the top