1
votes

i trying to deploy an osgi bundle with eclipse & jboss tools on Jboss 7.1. During start of the bundle, jboss throws an ClassNotFoundException on my plugin (Activator)

Caused by: java.lang.ClassNotFoundException: testjboss.Activator from [Module       "deployment.TestJboss:1.0.0.qualifier" from Service Module Loader] 

If i export the plugin with eclipse (export -> Deployable plug-ins and fragments) to the deployment folder of jboss and start jboss, the plugin will be started on Jboss without any exception. The OSGI-Bundle is simple one, include only the "Activator" class.

My Manifest:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TestJboss
Bundle-SymbolicName: TestJboss
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: testjboss.Activator
Import-Package: org.osgi.framework
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

my build.properties:

source.. = src/
output.. = bin/
bin.includes = META-INF/,\
           .

Nothing special, simple OSGI-Bundle. Something is going wrong with eclipse and Jboss - OSGI. Has anybody any idea what is going wrong?

Update1: The jar looks like:

jbosstest.jar
|--- META-INF
     |---MANIFEST.MF
|--- testjboss
     |---Activator.class
2
Can you list down the file tree hierarchy in JAR? That will help others to answer your query.CuriousMind
Updated my question. Adding file tree hierachy of the jar file.moohkooh
Is MANIFEST.MF actually spelt correctly? I corrected the spelling in your question.artbristol
typo on the question, but in the Jar is everythink is correctly spelt. The plugin is running, if the export the plugin, but not if i run the plugin from eclipse with jboss-tools oOmoohkooh
I get the problem with Jboss tooling. If a project is marked as "Mark as Deployable" the tooling will copy the hole project (also project stucture) to the deployments folder of jboss. Of course, jboss are not able to find the class, because the classes are in bin/ folder and not in the root folder.moohkooh

2 Answers

0
votes

I've come across a similar issue which was solved by including this in the manifest

Bundle-ClassPath: .

Seems like sometimes it'll work fine without it but sometimes not, never figured that one out but I always include it these days.

0
votes

for Jboss 7, its using modular class loader. You need to specify the dependencies as org.osgi.framework, in manifest or jboss-deployment-structure.xml