OSGi Plugin Deployment [message #96731] |
Fri, 07 September 2007 04:10 |
Eclipse User |
|
|
|
Originally posted by: aditya.modi.ge.com
Hi..
I Exported my OSGi bundle as deployable Plugin using Eclipse IDE in the form of a JAR.I have made my activator class as a main class by adding main() method..so that I can launch the application using webstart.My application runs well in the IDE..
but when I exported it..and tried to run from command prompt as
java -jar myapplican.jar--it gave error
Exception in thread "main" java.lang.NoClassDefFoundError: org/osgi/framework/BundleActivatormain class its not able to find BundleActivator
my manifest file is like
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: BasicMovieFinder Plug-in
Bundle-SymbolicName: BasicMovieFinder
Bundle-Version: 1.0.0
Bundle-Activator: basicmoviefinder.BasicMovieFinderActivator
Bundle-Localization: plugin
Import-Package: movies;version="1.0.0",
org.osgi.framework;version="1.3.0",---here I have mentioned to import this particular package..!
org.osgi.util.tracker;version="1.3.2"
Eclipse-LazyStart: false
Main-class: basicmoviefinder.BasicMovieFinderActivator
Export-Package: basicmoviefinder,
basicmovies.impl
which means i have imported the required package..I am afraid that while exporting the bundle as JAR this osgi classes are not getting exported !!
I am totally stucked up here..
Any help would be really appreciated..
Regards
Aditya
|
|
|
Re: OSGi Plugin Deployment [message #96747 is a reply to message #96731] |
Fri, 07 September 2007 19:05 |
Eclipse User |
|
|
|
Originally posted by: alex_blewitt.yahoo.com
If you run java -jar myapplication.jar, you're not running it as an OSGi application, and therefore it's not doing the OSGi wiring to make it happen. You'll need to launch it with java -jar org.eclipse.osgi_3.3.... -console -noExit, and then at the command line 'install /path/to/myapplication.jar' and then 'start 1' (or whatever).
Or you could look at doing it via an Eclipse application.
Alex.
|
|
|
Re: OSGi Plugin Deployment [message #96788 is a reply to message #96747] |
Sun, 09 September 2007 07:52 |
Eclipse User |
|
|
|
Originally posted by: aditya.modi.ge.com
hi thanks for the reply,
What i wish is to make use of my bundle as standalone java application for which i have added a main method to it and using Eclipse starter to kick off the application.
Proble is after exporting this bundle as jar and running it.as java application by calling main method,its not able to find Bundle Activator class in my main method.
Is there some issue while exporting my application as JAR ???
|
|
|
Re: OSGi Plugin Deployment [message #96835 is a reply to message #96788] |
Mon, 10 September 2007 05:43 |
Eclipse User |
|
|
|
Originally posted by: ado.bsiag.com
Hi
> hi thanks for the reply,
> What i wish is to make use of my bundle as standalone java application for which i have added a main method to it and using Eclipse starter to kick off the application.
> Proble is after exporting this bundle as jar and running it.as java application by calling main method,its not able to find Bundle Activator class in my main method.
> Is there some issue while exporting my application as JAR ???
You still don't need a main method of your own. Launching is done by
org.eclipse.equinox.launcher.jar. Make sure it is referenced by your
main jnlp file. This will make the osgi runtime start up and you'll have
bundle 0 running. To make your bundle run at startup automatically
you've got to put the correct lines in a configuration file or give them
as system properties. I've never used that so I can't tell you what
options to set.
Have fun
Arthur
|
|
|
|
Re: OSGi Plugin Deployment [message #96860 is a reply to message #96849] |
Mon, 10 September 2007 09:09 |
Eclipse User |
|
|
|
Originally posted by: aditya.modi.ge.com
Perhaps we are making the things complex
I simply want to write a JNLP file which should be able to launch an application packaged as JAR.In present case though the packaged application is an OSGi bundle,why JNLP should be bothered by this !!
It should only know that it have been given a JAR file with a specified main class.
Now thats what I have done,by writing a class with a main function.This class extends BundleActivator,which should not be bothering my JNLP file.
Now when i try to launch this JAR file using JNLP,it gives erro org.osg.framework.BundleActivator class not found...which means..some problem is with exported JAR.Perhaps it is not able to find a refernece to org.osgi.framework.jar and hence not able to get BundleActivator..?
Please correct me if I am wrong...
I am banged by this problem again n agian :(
|
|
|
Re: OSGi Plugin Deployment [message #96873 is a reply to message #96860] |
Mon, 10 September 2007 12:11 |
Eclipse User |
|
|
|
Originally posted by: ado.bsiag.com
Hi
aditya wrote:
> Perhaps we are making the things complex
>
> I simply want to write a JNLP file which should be able to launch an
> application packaged as JAR.In present case though the packaged
> application is an OSGi bundle,why JNLP should be bothered by this !!
> It should only know that it have been given a JAR file with a
> specified main class.
>
> Now thats what I have done,by writing a class with a main
> function.This class extends BundleActivator,which should not be
> bothering my JNLP file.
>
> Now when i try to launch this JAR file using JNLP,it gives erro
> org.osg.framework.BundleActivator class not found...which means..some
> problem is with exported JAR.Perhaps it is not able to find a
> refernece to org.osgi.framework.jar and hence not able to get
> BundleActivator..? Please correct me if I am wrong...
>
> I am banged by this problem again n agian :(
I don't know why you use a bundle, but normally you would do that
because you want to reap the benefits the framework provides. It would
probably help if you would explain why you want to use a bundle *and*
start it like a common java application.
As long as you have a bundle you have to let it be managed by an OSGi
framework. You have the JVM which starts the framework and then the
framework which starts its own system bundle with number 0 and then
whatever other bundles you indicate.
Arthur
|
|
|
Re: OSGi Plugin Deployment [message #96882 is a reply to message #96873] |
Mon, 10 September 2007 13:02 |
Eclipse User |
|
|
|
Originally posted by: aditya.modi.ge.com
hi,
Thanks all for your concerns n replies !
My goal was to launch any given OSGi bundle as also a Java application form webstart .jnlp file...that is why I was doing all this.
Now I am able to
-- launch my bundle as standalone java application using jnlp file(By keeping all the JARS even the 3rd party ones,using extension mechanism and by resigning the required JARs)
-- and also able to automatic launch it from command prompt using config.ini file.
Still thanks alot to all of for all your help.
Regards
Aditya
|
|
|
Re: OSGi Plugin Deployment [message #97573 is a reply to message #96882] |
Tue, 18 September 2007 06:31 |
Eclipse User |
|
|
|
Originally posted by: aditya.modi.ge.com
Hey all,
In my earlier case I was able to launch application with JNLP and explicitly mentioning main() function in my Activator class of OSGi bundle.
Ialso launched application bundle using config.ini stuff.
Now I wish to launch the same OSGi bundle from JNLP and that also withouht explicit use of main function.
Any help regarding this appreciable
Regards
Aditya
|
|
|
Powered by
FUDForum. Page generated in 0.02594 seconds