On 4/22/10 10:21, Justin Edelson wrote:
On 4/22/10 10:06 AM, Richard S. Hall wrote:
On 4/22/10 10:01, achuthan_prak...@emc.com wrote:
Hi,



I have deployed Perf4j as a non-OSGi jar exported via
"org.osgi.framework.system.packages.extra".  Perf4j has a dependency on
org.slf4j.Logger, which I have deployed as a bundle (as there are other
bundles dependent on this SLF4j version).  During runtime, I get
ClassNotFoundException.



How is the wiring between non-OSGi jar&   bundles handled?

How do we deal with a situation where a package A is needed by both
non-OSGI&   OSGi bundle deployed on Apache Felix?

Packages on the class path cannot "import" from bundles. You will need
to add any needed packages to the class path too and export them using
system.packages.extra as well if you want them to be shared among the
class path packages and the deployed bundles.
Although in this case, if SLF4J isn't part of the exported API, then it
need not be exported, right? In other words, if you have:

package foo.bar;

import org.slf4j.*;

public class MyClass {
   private Logger logger = LoggerFactory.getLogger(MyClass.class);

   public void doSomething() {
     // ...
   }

}

Then you can export foo.bar without exporting org.slf4j.

Yes, that's what I meant by "if you want them to be shared among ... the deployed bundles." That probably wasn't entirely clear. So, you are correct. If the package is just used by the class path packages, but not exposed by them, then just add the needed packages to the class path and do not export them from the system bundle.

-> richard

Justin

->  richard


Thanks,

Prakash



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


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


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

Reply via email to