[jboss-osgi-users] [JBoss OSGi] - using log4j

Thomas Joseph open4thomas at gmail.com
Thu Jun 11 03:23:43 EDT 2009


On Thu, Jun 11, 2009 at 1:28 AM, cuthbe <do-not-reply at jboss.com> wrote:

> All
>
> If I wanted to use log4j I have the following statement in my bundle
> manifest
>
> <attribute name="Import-Package" value="org.osgi.framework;version=1.3.0,
>
>                org.apache.log4j,
>
> And I have placed the log4j in the lib directory so it is in the classpath
> on startup. But my bundle still does not load it.
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.logging.LogFactory


The exception clearly says it! You need to have the commons logging also
into the  OSGi and the packages exported. You can either use  Pax Logging
http://wiki.ops4j.org//x/F  for ease or use osgified bundles of
commons-logging and log4j.

And frankly why would you want to import log4j packages, just use the
commons logging packages, it should be smart to use log4j implementation if
it is made available.

>
>
>
> Is there a set way to deploy thirdparty jars ?
>
> View the original post :
> http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4236822#4236822
>
> Reply to the post :
> http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4236822
> _______________________________________________
> jboss-osgi-users mailing list
> jboss-osgi-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jboss-osgi-users
>



HTH
-- 
Thanks and Regards,
/Thomas Joseph

LinkedIn: http://www.linkedin.com/in/ethomasjoseph
Twitter: http://twitter.com/ethomasjoseph
Blog: http://openthoughtworks.blogspot.com

------------------------------------------------------------
Promote Open Source - Promote Liberty of Ideas and Software.
------------------------------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-osgi-users/attachments/20090611/c4fb319e/attachment.html 


More information about the jboss-osgi-users mailing list