logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nipuni Piyabasi Perera <nipuni880...@gmail.com>
Subject ClassNotFoundException thrown in Log4J-2.5 OSGi environment
Date Fri, 29 Jan 2016 12:57:45 GMT
Hi all,

I am trying to start a TCPSocketServer (offered by Log4j 2.5) when
activating an osgi bundle. I am using both log4j2-core and log4j2-api
with version
2.5 in my environment. I received the error below, which is already
reported for Log4j v2.3 [1] in my osgi environment (but my custom bundle is
in active state).
Is this fixed (or does not exist in previous releases)? Or is there a
workaround for this issue?

2016-01-29 17:53:23,225 main ERROR Unable to create custom ContextSelector.
Falling back to default. java.lang.ClassNotFoundException:
org.apache.logging.log4j.core.osgi.BundleContextSelector cannot be found by
org.apache.logging.log4j.api_2.5.0
at
org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)
at
org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)
at
org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at org.apache.logging.log4j.util.LoaderUtil.loadClass(LoaderUtil.java:122)
at
org.apache.logging.log4j.util.LoaderUtil.newInstanceOf(LoaderUtil.java:140)
at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:167)
at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:192)
at
org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:93)
at
org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:54)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at java.lang.Class.newInstance(Class.java:442)
....

[1] https://issues.apache.org/jira/browse/LOG4J2-920

Thanks,
Nipuni

-- 
Nipuni Perera
Software Engineer; WSO2 Inc.; http://wso2.com
Email: nipuni@wso2.com
Git hub profile: https://github.com/nipuni
Blog : http://nipunipererablog.blogspot.com/
Mobile: +94 (71) 5626680

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message