The "-jar" option for the java command ignores the specified class path and only uses the JAR file on the class path, so you need to do something like:

    java -cp mylib;./bin/felix.jar org.apache.felix.main.Main

-> richard

On 9/4/09 13:18, geelpheels wrote:


Felix Meschberger-2 wrote:
Hi,

geelpheels schrieb:
If I put some jar lib into classpath and start felix. Can the bundles use
the
packages and classes defined in this jar lib?
No, not automatically. You have to list the package either as
bootclasspath packages (in the org.osgi.framework.bootdelegation
property) or as system packages (in the
org.osgi.framework.system.packages).

What you choose is up to and depends on your use case. My preference is
to use system packages since such packages become regular exports of the
system bundle and content for package wiring like regular bundle exports.

Regards
Felix

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org



OK. I've added my package name into the variable
org.osgi.framework.system.packages and then modified my importer bundle's
manifest file by adding Import-Package parameter.

But it still report the Exception:org.osgi.framework.BundleException:
Activator start error in bundle com.kortide.
felix.fakeservice [5].
         at org.apache.felix.framework.Felix.startBundle(Felix.java:1506)
         at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:774)
         at
org.apache.felix.shell.impl.StartCommandImpl.execute(StartCommandImpl
.java:105)
         at
org.apache.felix.shell.impl.Activator$ShellServiceImpl.executeCommand
(Activator.java:291)
         at
org.apache.felix.shell.tui.Activator$ShellTuiRunnable.run(Activator.j
ava:177)
         at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.NoClassDefFoundError: littlejarlib/TestLittleJarLib
         at com.kortide.felix.fakeservice.Activator.start(Activator.java:13)
         at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAct
ion.java:589)
         at org.apache.felix.framework.Felix.startBundle(Felix.java:1458)
         ... 5 more
java.lang.NoClassDefFoundError: littlejarlib/TestLittleJarLib

my start command is :java -classpath
%JAVA_HOME%\lib\tools.jar;.\LittleJarLib.jar -jar bin\felix.jar


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to