java - OSGi can't find the activator -
manifest:
manifest-version: 1.0 bundle-name: mahjong bundle-activator: mahjongactivator bundle-symbolicname: mahjong bundle-version: 1.0.0 import-package: org.osgi.framework
compiling & jarring:
$ javac -classpath equinox.jar src/start/*java $ jar -cfm mahjong.jar mahjongmanifest.mf src/start/*class
the activator:
package start; import org.osgi.framework.*; public class mahjongactivator implements bundleactivator { public void start(bundlecontext context) { system.out.println("hi!"); } public void stop(bundlecontext context) { system.out.println("bye!"); } }
then load .jar in osgi , when try start()
it, says:
org.osgi.framework.bundleexception: activator mahjongactivator bundle mahjong invalid @ org.eclipse.osgi.framework.internal.core.abstractbundle.loadbundleactivator(abstractbundle.java:156) @ org.eclipse.osgi.framework.internal.core.bundlecontextimpl.start(bundlecontextimpl.java:751) @ org.eclipse.osgi.framework.internal.core.bundlehost.startworker(bundlehost.java:370) @ org.eclipse.osgi.framework.internal.core.abstractbundle.start(abstractbundle.java:284) @ org.eclipse.osgi.framework.internal.core.abstractbundle.start(abstractbundle.java:276) ... caused by: java.lang.classnotfoundexception: mahjongactivator ... more classnotfounds...
why?
it should "bundle-activator: start.mahjongactivator" -- you've omitted package name.
Comments
Post a Comment