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

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -