Hi!
with regards to your commandline building the jar i think the problem is
the java-package which is not reflected inside the jar.
try "jar cfm myJarfile.jar Manifest.MF
/tmp/getpressedcode/getPressedCode.class" from the "/" directory.
Try to succeed with a plain Main- Starter (no osgi) accessing your class
before throwing it into the osgi container.
here are some more things that might help digging deeper into osgi:
- verify the contents of your jar (jar tf yourjar.jar)
- use tools like bnd (http://www.aqute.biz/Code/Bnd) to get a detailed
problems view (and use this to get a clean manifest to compare to)
- did you tried to deploy your eclipse-made bundle into knopflerfish before?
Do not hesitate to ask.. ;-)
Toni
---
Toni Menzel
[EMAIL PROTECTED]
go http://ops4j.org
Xi Jiarong schrieb:
I use eclipse to build bunle before, now just try to build bundle
without eclispe!
I found some problems which puzzles me greatly, hope to get your help
and suggestion!
Now, I creat one Java file: getPressedCode.java under the folder:
/tmp/getpressedcode,
the programming code of /tmp/getpressedcode/getPressedCode.java is as
follows:
/*********************************************************************************/
//getPressedCode.java:
package tmp.getpressedcode;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class getPressedCode implements BundleActivator
{
public void start(BundleContext context) throws Exception
{
System.out.println("Try to use bundle application!");
}
public void stop(BundleContext context) throws Exception
{
}
}
/*********************************************************************************/
////////////////Manifest.MF
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: GetPressedCode03JulyV3
Bundle-SymbolicName: getPressedCode
Bundle-Version: 1.0.0
Bundle-Activator: tmp.getpressedcode.getPressedCode
Bundle-Vendor: sp
Bundle-Localization: plugin
Import-Package: org.osgi.framework;version=" 1.3.0"
////////////////
and in the terminal, I use the following command to compile and get
the bundle file: myJarfile;
[EMAIL PROTECTED] getpressedcode]$ javac -cp
/home/mythtv/Desktop/knopflerfish_osgi_2.0.1/knopflerfish.org/osgi/framework.jar
getPressedCode.java
[EMAIL PROTECTED] getpressedcode]$ jar cfm myJarfile.jar Manifest.MF
getPressedCode.class
However, when I install this bundle on knopflerfish, it
indicate"failed to start bundle
GetPressedCode03JulyV3,..tmp.getpressedcode.getPressedCode ".
What's wrong withi this bundle, and how to solve this problem?
Any suggestion would be welcome!
Jerry
------------------------------------------------------------------------
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev
_______________________________________________
OSGi Developer Mail List
[email protected]
http://www2.osgi.org/mailman/listinfo/osgi-dev