简体   繁体   中英

Jboss 7.1, Eclipse 4,2 and OSGI - ClassNotFoundException

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

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM