You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by Remko Popma <re...@gmail.com> on 2016/12/11 10:30:36 UTC

Build fails in OSGi module

The build failed three times in a row on my Windows 10 machine now.

FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext

ERROR StatusLogger Unable to create custom ContextSelector. Falling back to
default.
 java.lang.ClassCastException: Cannot cast
org.apache.logging.log4j.core.osgi.BundleContextSelector to
org.apache.logging.log4j.core.selector.ContextSelector


Full stacktrace:
ERROR StatusLogger No log4j2 configuration file found. Using default
configuration: logging only errors to the console.
ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock
bundle cache: java.nio.channels.OverlappingFileLockException)
java.lang.Exception: Unable to lock bundle cache:
java.nio.channels.OverlappingFileLockException
        at
org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
        at org.apache.felix.framework.Felix.init(Felix.java:689)
        at org.apache.felix.framework.Felix.init(Felix.java:624)
        at
org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(OsgiRule.java:63)
        at
org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
        at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
        at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec
<<< FAILURE! - in
org.apache.logging.log4j.osgi.tests.felix.FelixLoadApiBundleTest
testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.tests.felix.FelixLoadApiBundleTest)
 Time elapsed: 0.012 sec  <<< ERROR!
org.osgi.framework.BundleException: Error creating bundle cache.
Caused by: java.lang.Exception: Unable to lock bundle cache:
java.nio.channels.OverlappingFileLockException

ERROR StatusLogger No log4j2 configuration file found. Using default
configuration: logging only errors to the console.
ERROR StatusLogger Unable to create custom ContextSelector. Falling back to
default.
 java.lang.ClassCastException: Cannot cast
org.apache.logging.log4j.core.osgi.BundleContextSelector to
org.apache.logging.log4j.core.selector.ContextSelector
        at java.lang.Class.cast(Class.java:3369)
        at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
        at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
        at
org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
        at
org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
        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)
        at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at
org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
        at
org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at
org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
        at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
        at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
ERROR StatusLogger Unable to create custom ContextSelector. Falling back to
default.
 java.lang.ClassCastException: Cannot cast
org.apache.logging.log4j.core.osgi.BundleContextSelector to
org.apache.logging.log4j.core.selector.ContextSelector
        at java.lang.Class.cast(Class.java:3369)
        at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
        at
org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
        at
org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
        at
org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
        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)
        at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at
org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
        at
org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:497)
        at
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
        at
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
        at
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at
org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
        at org.junit.rules.RunRules.evaluate(RunRules.java:20)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
        at
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
        at
org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
        at
org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
        at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
        at
org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162 sec -
in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBundleTest

Results :

Tests in error:
  FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
creating bu...

Tests run: 6, Failures: 0, Errors: 1, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Log4j 2 ..................................... SUCCESS [
 1.128 s]
[INFO] Apache Log4j API ................................... SUCCESS [
28.171 s]
[INFO] Apache Log4j Core .................................. SUCCESS [16:07
min]
[INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
17.317 s]
[INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
13.112 s]
[INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
 6.675 s]
[INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
 6.340 s]
[INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
42.596 s]
[INFO] Apache Log4j Web ................................... SUCCESS [
17.932 s]
[INFO] Apache Log4j Tag Library ........................... SUCCESS [
32.874 s]
[INFO] Apache Log4j JMX GUI ............................... SUCCESS [
 5.310 s]
[INFO] Apache Log4j Samples ............................... SUCCESS [
 0.285 s]
[INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
 5.531 s]
[INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
 3.135 s]
[INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
 6.186 s]
[INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
 5.262 s]
[INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
 5.167 s]
[INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
35.346 s]
[INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
 5.523 s]
[INFO] Apache Log4j OSGi .................................. FAILURE [
 6.002 s]
[INFO] Apache Log4j BOM ................................... SKIPPED
[INFO] Apache Log4j NoSQL ................................. SKIPPED
[INFO] Apache Log4J Performance Tests ..................... SKIPPED
[INFO] Apache Log4j Streaming Interface ................... SKIPPED
[INFO] Apache Log4j JUL Adapter ........................... SKIPPED
[INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
[INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
[INFO]
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 20:13 min
[INFO] Finished at: 2016-12-11T19:22:07+09:00
[INFO] Final Memory: 39M/379M

Re: Build fails in OSGi module

Posted by Matt Sicker <bo...@gmail.com>.
If that's running in multiple threads, the OSGi framework is probably
static or cannot be instantiated multiple times like that. Very strange!

On 11 December 2016 at 04:49, Remko Popma <re...@gmail.com> wrote:

> Actually probably caused by
> Caused by: java.lang.Exception: Unable to lock bundle cache:
> java.nio.channels.OverlappingFileLockException
>
> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
> wrote:
>
>> The build failed three times in a row on my Windows 10 machine now.
>>
>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>
>>
>> Full stacktrace:
>> ERROR StatusLogger No log4j2 configuration file found. Using default
>> configuration: logging only errors to the console.
>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock
>> bundle cache: java.nio.channels.OverlappingFileLockException)
>> java.lang.Exception: Unable to lock bundle cache:
>> java.nio.channels.OverlappingFileLockException
>>         at org.apache.felix.framework.cache.BundleCache.<init>(BundleCa
>> che.java:176)
>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(Os
>> giRule.java:63)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:46)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec
>> <<< FAILURE! - in org.apache.logging.log4j.osgi.
>> tests.felix.FelixLoadApiBundleTest
>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<< ERROR!
>> org.osgi.framework.BundleException: Error creating bundle cache.
>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>> java.nio.channels.OverlappingFileLockException
>>
>> ERROR StatusLogger No log4j2 configuration file found. Using default
>> configuration: logging only errors to the console.
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>         at java.lang.Class.cast(Class.java:3369)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> f(LoaderUtil.java:201)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> fProperty(LoaderUtil.java:226)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>> eContextSelector(Log4jContextFactory.java:97)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>> >(Log4jContextFactory.java:58)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>> ConstructorAccessorImpl.java:62)
>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>> legatingConstructorAccessorImpl.java:45)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>> 22)
>>         at java.lang.Class.newInstance(Class.java:442)
>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.
>> java:94)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>> og(AbstractLoadBundleTest.java:95)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> FrameworkMethod.java:50)
>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>> ectiveCallable.java:12)
>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>> ameworkMethod.java:47)
>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>> InvokeMethod.java:17)
>>         at org.junit.internal.runners.statements.RunBefores.evaluate(
>> RunBefores.java:26)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:48)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>         at java.lang.Class.cast(Class.java:3369)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> f(LoaderUtil.java:201)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> fProperty(LoaderUtil.java:226)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>> eContextSelector(Log4jContextFactory.java:97)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>> >(Log4jContextFactory.java:58)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>> ConstructorAccessorImpl.java:62)
>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>> legatingConstructorAccessorImpl.java:45)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>> 22)
>>         at java.lang.Class.newInstance(Class.java:442)
>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.
>> java:94)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>> og(AbstractLoadBundleTest.java:95)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> FrameworkMethod.java:50)
>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>> ectiveCallable.java:12)
>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>> ameworkMethod.java:47)
>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>> InvokeMethod.java:17)
>>         at org.junit.internal.runners.statements.RunBefores.evaluate(
>> RunBefores.java:26)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:48)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162 sec
>> - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBundleTest
>>
>> Results :
>>
>> Tests in error:
>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>> creating bu...
>>
>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>  1.128 s]
>> [INFO] Apache Log4j API ................................... SUCCESS [
>> 28.171 s]
>> [INFO] Apache Log4j Core .................................. SUCCESS
>> [16:07 min]
>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>> 17.317 s]
>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>> 13.112 s]
>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>  6.675 s]
>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>  6.340 s]
>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>> 42.596 s]
>> [INFO] Apache Log4j Web ................................... SUCCESS [
>> 17.932 s]
>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>> 32.874 s]
>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>  5.310 s]
>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>  0.285 s]
>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>  5.531 s]
>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>  3.135 s]
>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>  6.186 s]
>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>  5.262 s]
>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>  5.167 s]
>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>> 35.346 s]
>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>  5.523 s]
>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>  6.002 s]
>> [INFO] Apache Log4j BOM ................................... SKIPPED
>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] BUILD FAILURE
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Total time: 20:13 min
>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>> [INFO] Final Memory: 39M/379M
>>
>
>


-- 
Matt Sicker <bo...@gmail.com>

Re: Build fails in OSGi module

Posted by Remko Popma <re...@gmail.com>.
I've seen this particular one before and it would go away when I tried
again. Transient. No time to run again now though...

On Tue, Dec 13, 2016 at 8:25 AM, Gary Gregory <ga...@gmail.com>
wrote:

> Oh but I should say that it was OK from Maven but I did see one failure
> running from Eclipse, which I think ran all the tests for the source folder
> I selected in the same JVM.
>
> Gary
>
> On Dec 12, 2016 3:23 PM, "Gary Gregory" <ga...@gmail.com> wrote:
>
>> The build was ok for me locally. odd.
>>
>> Gary
>>
>> On Dec 12, 2016 3:21 PM, "Remko Popma" <re...@gmail.com> wrote:
>>
>>> After the Gary applied the remaining patch for LOG4J2-1664, things look
>>> a bit better.
>>>
>>> I now see the error below. I think I have seen this before as a
>>> transient error...
>>>
>>> Tests in error:
>>>   FelixLoadApiBundleTest.testApiCoreStartStopStartStop ≫ Bundle Error
>>> creating b...
>>>   FelixLoadApiBundleTest.testClassNotFoundErrorLogger ≫ Bundle Error
>>> creating bu...
>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>>> creating bu...
>>>
>>> Tests run: 10, Failures: 0, Errors: 3, Skipped: 0
>>>
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] Reactor Summary:
>>> [INFO]
>>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>>  1.564 s]
>>> [INFO] Apache Log4j API ................................... SUCCESS [
>>> 53.324 s]
>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>> [17:36 min]
>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>>> 17.501 s]
>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>>> 10.763 s]
>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>>  6.457 s]
>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>>  5.572 s]
>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>>> 30.051 s]
>>> [INFO] Apache Log4j Web ................................... SUCCESS [
>>> 12.471 s]
>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>>> 25.134 s]
>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>>  3.526 s]
>>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>>  0.216 s]
>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>>  3.948 s]
>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>>  2.687 s]
>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>>  5.618 s]
>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>>  4.575 s]
>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>>  4.819 s]
>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>>> 32.496 s]
>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>>  5.426 s]
>>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>>  6.967 s]
>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] BUILD FAILURE
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] Total time: 21:33 min
>>> [INFO] Finished at: 2016-12-13T08:14:16+09:00
>>> [INFO] Final Memory: 38M/276M
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>>
>>>
>>> On Mon, Dec 12, 2016 at 7:13 AM, Remko Popma <re...@gmail.com>
>>> wrote:
>>>
>>>> I can take a look later but need to get ready for work now.
>>>>
>>>> Sent from my iPhone
>>>>
>>>> On 12 Dec 2016, at 7:09, Matt Sicker <bo...@gmail.com> wrote:
>>>>
>>>> The patch added in LOG4J2-1664 should fix that issue Remko was seeing.
>>>> I'm not around a development machine to test it out, but I looked at the
>>>> patch and it should address the issue I believe.
>>>>
>>>> On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:
>>>>
>>>>> Since we're not relying on any newer APIs, there's no need to upgrade
>>>>> the OSGi API dependencies themselves, but testing with newer frameworks
>>>>> would be good. I still have a todo item somewhere about trying out the
>>>>> pax-exam OSGi testing framework for something in Commons, though I haven't
>>>>> used OSGi professionally in a while, now, so I keep forgetting about it.
>>>>> (it's usually hard to convince people to embrace physical modularity like
>>>>> OSGi or Jigsaw when they're used to writing things without that assumption
>>>>> in place)
>>>>>
>>>>> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> I wonder if we should also update the versions of the OSGi containers
>>>>>> we test with...
>>>>>>
>>>>>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>>>>>
>>>>>>> Actually probably caused by
>>>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>>
>>>>>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>>>>>
>>>>>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>>>>>
>>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>>> back to default.
>>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>>
>>>>>>>>
>>>>>>>> Full stacktrace:
>>>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using
>>>>>>>> default configuration: logging only errors to the console.
>>>>>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to
>>>>>>>> lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>>>>>> java.lang.Exception: Unable to lock bundle cache:
>>>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>>>         at org.apache.felix.framework.cac
>>>>>>>> he.BundleCache.<init>(BundleCache.java:176)
>>>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>>> tests.junit.OsgiRule.before(OsgiRule.java:63)
>>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>>> ce$1.evaluate(ExternalResource.java:46)
>>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .run(ParentRunner.java:363)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>>> .java:290)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
>>>>>>>> 2.59 sec <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>>>>>>> tests.felix.FelixLoadApiBundleTest
>>>>>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>>>>>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<<
>>>>>>>> ERROR!
>>>>>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>>>
>>>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using
>>>>>>>> default configuration: logging only errors to the console.
>>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>>> back to default.
>>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>>>> actory.java:97)
>>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>>>> l.java:45)
>>>>>>>>         at java.lang.reflect.Constructor.
>>>>>>>> newInstance(Constructor.java:422)
>>>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>>> Method)
>>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>>>> stractLoadBundleTest.java:224)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>>> Method)
>>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>>         at org.junit.runners.model.Framew
>>>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>>>         at org.junit.internal.runners.mod
>>>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>>>         at org.junit.runners.model.Framew
>>>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>>>         at org.junit.internal.runners.sta
>>>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>>>         at org.junit.internal.runners.sta
>>>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .run(ParentRunner.java:363)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>>> .java:290)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>>> back to default.
>>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>>>> actory.java:97)
>>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>>>> l.java:45)
>>>>>>>>         at java.lang.reflect.Constructor.
>>>>>>>> newInstance(Constructor.java:422)
>>>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>>> Method)
>>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>>>> stractLoadBundleTest.java:224)
>>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>>> Method)
>>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>>         at org.junit.runners.model.Framew
>>>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>>>         at org.junit.internal.runners.mod
>>>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>>>         at org.junit.runners.model.Framew
>>>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>>>         at org.junit.internal.runners.sta
>>>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>>>         at org.junit.internal.runners.sta
>>>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>>> .run(ParentRunner.java:363)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>>> .java:290)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>>>>>>> 3.162 sec - in org.apache.logging.log4j.osgi.
>>>>>>>> tests.equinox.EquinoxLoadApiBundleTest
>>>>>>>>
>>>>>>>> Results :
>>>>>>>>
>>>>>>>> Tests in error:
>>>>>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle
>>>>>>>> Error creating bu...
>>>>>>>>
>>>>>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>>>>>
>>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>>> ------------
>>>>>>>> [INFO] Reactor Summary:
>>>>>>>> [INFO]
>>>>>>>> [INFO] Apache Log4j 2 .....................................
>>>>>>>> SUCCESS [  1.128 s]
>>>>>>>> [INFO] Apache Log4j API ...................................
>>>>>>>> SUCCESS [ 28.171 s]
>>>>>>>> [INFO] Apache Log4j Core ..................................
>>>>>>>> SUCCESS [16:07 min]
>>>>>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS
>>>>>>>> [ 17.317 s]
>>>>>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS
>>>>>>>> [ 13.112 s]
>>>>>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS
>>>>>>>> [  6.675 s]
>>>>>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS
>>>>>>>> [  6.340 s]
>>>>>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS
>>>>>>>> [ 42.596 s]
>>>>>>>> [INFO] Apache Log4j Web ...................................
>>>>>>>> SUCCESS [ 17.932 s]
>>>>>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS
>>>>>>>> [ 32.874 s]
>>>>>>>> [INFO] Apache Log4j JMX GUI ...............................
>>>>>>>> SUCCESS [  5.310 s]
>>>>>>>> [INFO] Apache Log4j Samples ...............................
>>>>>>>> SUCCESS [  0.285 s]
>>>>>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS
>>>>>>>> [  5.531 s]
>>>>>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS
>>>>>>>> [  3.135 s]
>>>>>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS
>>>>>>>> [  6.186 s]
>>>>>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS
>>>>>>>> [  5.262 s]
>>>>>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS
>>>>>>>> [  5.167 s]
>>>>>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS
>>>>>>>> [ 35.346 s]
>>>>>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS
>>>>>>>> [  5.523 s]
>>>>>>>> [INFO] Apache Log4j OSGi ..................................
>>>>>>>> FAILURE [  6.002 s]
>>>>>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>>>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>>>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>>>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>>>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>>>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>>>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>>> ------------
>>>>>>>> [INFO] BUILD FAILURE
>>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>>> ------------
>>>>>>>> [INFO] Total time: 20:13 min
>>>>>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>>>>>> [INFO] Final Memory: 39M/379M
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Matt Sicker <bo...@gmail.com>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Matt Sicker <bo...@gmail.com>
>>>>
>>>>
>>>

Re: Build fails in OSGi module

Posted by Gary Gregory <ga...@gmail.com>.
Oh but I should say that it was OK from Maven but I did see one failure
running from Eclipse, which I think ran all the tests for the source folder
I selected in the same JVM.

Gary

On Dec 12, 2016 3:23 PM, "Gary Gregory" <ga...@gmail.com> wrote:

> The build was ok for me locally. odd.
>
> Gary
>
> On Dec 12, 2016 3:21 PM, "Remko Popma" <re...@gmail.com> wrote:
>
>> After the Gary applied the remaining patch for LOG4J2-1664, things look
>> a bit better.
>>
>> I now see the error below. I think I have seen this before as a transient
>> error...
>>
>> Tests in error:
>>   FelixLoadApiBundleTest.testApiCoreStartStopStartStop ≫ Bundle Error
>> creating b...
>>   FelixLoadApiBundleTest.testClassNotFoundErrorLogger ≫ Bundle Error
>> creating bu...
>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>> creating bu...
>>
>> Tests run: 10, Failures: 0, Errors: 3, Skipped: 0
>>
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>  1.564 s]
>> [INFO] Apache Log4j API ................................... SUCCESS [
>> 53.324 s]
>> [INFO] Apache Log4j Core .................................. SUCCESS
>> [17:36 min]
>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>> 17.501 s]
>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>> 10.763 s]
>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>  6.457 s]
>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>  5.572 s]
>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>> 30.051 s]
>> [INFO] Apache Log4j Web ................................... SUCCESS [
>> 12.471 s]
>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>> 25.134 s]
>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>  3.526 s]
>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>  0.216 s]
>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>  3.948 s]
>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>  2.687 s]
>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>  5.618 s]
>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>  4.575 s]
>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>  4.819 s]
>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>> 32.496 s]
>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>  5.426 s]
>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>  6.967 s]
>> [INFO] Apache Log4j BOM ................................... SKIPPED
>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] BUILD FAILURE
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Total time: 21:33 min
>> [INFO] Finished at: 2016-12-13T08:14:16+09:00
>> [INFO] Final Memory: 38M/276M
>> [INFO] ------------------------------------------------------------
>> ------------
>>
>>
>> On Mon, Dec 12, 2016 at 7:13 AM, Remko Popma <re...@gmail.com>
>> wrote:
>>
>>> I can take a look later but need to get ready for work now.
>>>
>>> Sent from my iPhone
>>>
>>> On 12 Dec 2016, at 7:09, Matt Sicker <bo...@gmail.com> wrote:
>>>
>>> The patch added in LOG4J2-1664 should fix that issue Remko was seeing.
>>> I'm not around a development machine to test it out, but I looked at the
>>> patch and it should address the issue I believe.
>>>
>>> On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:
>>>
>>>> Since we're not relying on any newer APIs, there's no need to upgrade
>>>> the OSGi API dependencies themselves, but testing with newer frameworks
>>>> would be good. I still have a todo item somewhere about trying out the
>>>> pax-exam OSGi testing framework for something in Commons, though I haven't
>>>> used OSGi professionally in a while, now, so I keep forgetting about it.
>>>> (it's usually hard to convince people to embrace physical modularity like
>>>> OSGi or Jigsaw when they're used to writing things without that assumption
>>>> in place)
>>>>
>>>> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com>
>>>> wrote:
>>>>
>>>>> I wonder if we should also update the versions of the OSGi containers
>>>>> we test with...
>>>>>
>>>>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>>>>
>>>>>> Actually probably caused by
>>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>
>>>>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>>>>>> wrote:
>>>>>>
>>>>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>>>>
>>>>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>>>>
>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>> back to default.
>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>
>>>>>>>
>>>>>>> Full stacktrace:
>>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>>>> configuration: logging only errors to the console.
>>>>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to
>>>>>>> lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>>>>> java.lang.Exception: Unable to lock bundle cache:
>>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>>         at org.apache.felix.framework.cac
>>>>>>> he.BundleCache.<init>(BundleCache.java:176)
>>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>> tests.junit.OsgiRule.before(OsgiRule.java:63)
>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>> ce$1.evaluate(ExternalResource.java:46)
>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>> .java:290)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59
>>>>>>> sec <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>>>>>> tests.felix.FelixLoadApiBundleTest
>>>>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>>>>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<<
>>>>>>> ERROR!
>>>>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>>
>>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>>>> configuration: logging only errors to the console.
>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>> back to default.
>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>>> actory.java:97)
>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>>> l.java:45)
>>>>>>>         at java.lang.reflect.Constructor.
>>>>>>> newInstance(Constructor.java:422)
>>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>> Method)
>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>>> stractLoadBundleTest.java:224)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>> Method)
>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>         at org.junit.runners.model.Framew
>>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>>         at org.junit.internal.runners.mod
>>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>>         at org.junit.runners.model.Framew
>>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>>         at org.junit.internal.runners.sta
>>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>>         at org.junit.internal.runners.sta
>>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>> .java:290)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>>> back to default.
>>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>>         at org.apache.logging.log4j.util.
>>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>>> actory.java:97)
>>>>>>>         at org.apache.logging.log4j.core.
>>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>>         at sun.reflect.NativeConstructorA
>>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>>> l.java:45)
>>>>>>>         at java.lang.reflect.Constructor.
>>>>>>> newInstance(Constructor.java:422)
>>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>> Method)
>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>>> stractLoadBundleTest.java:224)
>>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>>> Method)
>>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>>         at org.junit.runners.model.Framew
>>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>>         at org.junit.internal.runners.mod
>>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>>         at org.junit.runners.model.Framew
>>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>>         at org.junit.internal.runners.sta
>>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>>         at org.junit.internal.runners.sta
>>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>>         at org.junit.rules.ExternalResour
>>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $3.run(ParentRunner.java:290)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> .access$000(ParentRunner.java:58)
>>>>>>>         at org.junit.runners.ParentRunner
>>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>>         at org.apache.maven.surefire.juni
>>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>>> .java:290)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>>         at org.apache.maven.surefire.boot
>>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed:
>>>>>>> 3.162 sec - in org.apache.logging.log4j.osgi.
>>>>>>> tests.equinox.EquinoxLoadApiBundleTest
>>>>>>>
>>>>>>> Results :
>>>>>>>
>>>>>>> Tests in error:
>>>>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle
>>>>>>> Error creating bu...
>>>>>>>
>>>>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>>>>
>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>> ------------
>>>>>>> [INFO] Reactor Summary:
>>>>>>> [INFO]
>>>>>>> [INFO] Apache Log4j 2 ..................................... SUCCESS
>>>>>>> [  1.128 s]
>>>>>>> [INFO] Apache Log4j API ................................... SUCCESS
>>>>>>> [ 28.171 s]
>>>>>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>>>>>> [16:07 min]
>>>>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS
>>>>>>> [ 17.317 s]
>>>>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS
>>>>>>> [ 13.112 s]
>>>>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS
>>>>>>> [  6.675 s]
>>>>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS
>>>>>>> [  6.340 s]
>>>>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS
>>>>>>> [ 42.596 s]
>>>>>>> [INFO] Apache Log4j Web ................................... SUCCESS
>>>>>>> [ 17.932 s]
>>>>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS
>>>>>>> [ 32.874 s]
>>>>>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS
>>>>>>> [  5.310 s]
>>>>>>> [INFO] Apache Log4j Samples ............................... SUCCESS
>>>>>>> [  0.285 s]
>>>>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS
>>>>>>> [  5.531 s]
>>>>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS
>>>>>>> [  3.135 s]
>>>>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS
>>>>>>> [  6.186 s]
>>>>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS
>>>>>>> [  5.262 s]
>>>>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS
>>>>>>> [  5.167 s]
>>>>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS
>>>>>>> [ 35.346 s]
>>>>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS
>>>>>>> [  5.523 s]
>>>>>>> [INFO] Apache Log4j OSGi .................................. FAILURE
>>>>>>> [  6.002 s]
>>>>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>> ------------
>>>>>>> [INFO] BUILD FAILURE
>>>>>>> [INFO] ------------------------------------------------------------
>>>>>>> ------------
>>>>>>> [INFO] Total time: 20:13 min
>>>>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>>>>> [INFO] Final Memory: 39M/379M
>>>>>>>
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> Matt Sicker <bo...@gmail.com>
>>>>
>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>>
>>

Re: Build fails in OSGi module

Posted by Gary Gregory <ga...@gmail.com>.
The build was ok for me locally. odd.

Gary

On Dec 12, 2016 3:21 PM, "Remko Popma" <re...@gmail.com> wrote:

> After the Gary applied the remaining patch for LOG4J2-1664, things look a
> bit better.
>
> I now see the error below. I think I have seen this before as a transient
> error...
>
> Tests in error:
>   FelixLoadApiBundleTest.testApiCoreStartStopStartStop ≫ Bundle Error
> creating b...
>   FelixLoadApiBundleTest.testClassNotFoundErrorLogger ≫ Bundle Error
> creating bu...
>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
> creating bu...
>
> Tests run: 10, Failures: 0, Errors: 3, Skipped: 0
>
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>  1.564 s]
> [INFO] Apache Log4j API ................................... SUCCESS [
> 53.324 s]
> [INFO] Apache Log4j Core .................................. SUCCESS
> [17:36 min]
> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
> 17.501 s]
> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
> 10.763 s]
> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>  6.457 s]
> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>  5.572 s]
> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
> 30.051 s]
> [INFO] Apache Log4j Web ................................... SUCCESS [
> 12.471 s]
> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
> 25.134 s]
> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>  3.526 s]
> [INFO] Apache Log4j Samples ............................... SUCCESS [
>  0.216 s]
> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>  3.948 s]
> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>  2.687 s]
> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>  5.618 s]
> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>  4.575 s]
> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>  4.819 s]
> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
> 32.496 s]
> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>  5.426 s]
> [INFO] Apache Log4j OSGi .................................. FAILURE [
>  6.967 s]
> [INFO] Apache Log4j BOM ................................... SKIPPED
> [INFO] Apache Log4j NoSQL ................................. SKIPPED
> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Total time: 21:33 min
> [INFO] Finished at: 2016-12-13T08:14:16+09:00
> [INFO] Final Memory: 38M/276M
> [INFO] ------------------------------------------------------------
> ------------
>
>
> On Mon, Dec 12, 2016 at 7:13 AM, Remko Popma <re...@gmail.com>
> wrote:
>
>> I can take a look later but need to get ready for work now.
>>
>> Sent from my iPhone
>>
>> On 12 Dec 2016, at 7:09, Matt Sicker <bo...@gmail.com> wrote:
>>
>> The patch added in LOG4J2-1664 should fix that issue Remko was seeing.
>> I'm not around a development machine to test it out, but I looked at the
>> patch and it should address the issue I believe.
>>
>> On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:
>>
>>> Since we're not relying on any newer APIs, there's no need to upgrade
>>> the OSGi API dependencies themselves, but testing with newer frameworks
>>> would be good. I still have a todo item somewhere about trying out the
>>> pax-exam OSGi testing framework for something in Commons, though I haven't
>>> used OSGi professionally in a while, now, so I keep forgetting about it.
>>> (it's usually hard to convince people to embrace physical modularity like
>>> OSGi or Jigsaw when they're used to writing things without that assumption
>>> in place)
>>>
>>> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com>
>>> wrote:
>>>
>>>> I wonder if we should also update the versions of the OSGi containers
>>>> we test with...
>>>>
>>>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>>>
>>>>> Actually probably caused by
>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>> java.nio.channels.OverlappingFileLockException
>>>>>
>>>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>>>>> wrote:
>>>>>
>>>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>>>
>>>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>>>
>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>> back to default.
>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>
>>>>>>
>>>>>> Full stacktrace:
>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>>> configuration: logging only errors to the console.
>>>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to
>>>>>> lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>>>> java.lang.Exception: Unable to lock bundle cache:
>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>         at org.apache.felix.framework.cac
>>>>>> he.BundleCache.<init>(BundleCache.java:176)
>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>> tests.junit.OsgiRule.before(OsgiRule.java:63)
>>>>>>         at org.junit.rules.ExternalResour
>>>>>> ce$1.evaluate(ExternalResource.java:46)
>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $3.run(ParentRunner.java:290)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .access$000(ParentRunner.java:58)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>> .java:290)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59
>>>>>> sec <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>>>>> tests.felix.FelixLoadApiBundleTest
>>>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>>>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<<
>>>>>> ERROR!
>>>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>>> java.nio.channels.OverlappingFileLockException
>>>>>>
>>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>>> configuration: logging only errors to the console.
>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>> back to default.
>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>         at org.apache.logging.log4j.util.
>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>         at org.apache.logging.log4j.util.
>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>         at org.apache.logging.log4j.core.
>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>> actory.java:97)
>>>>>>         at org.apache.logging.log4j.core.
>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>         at sun.reflect.NativeConstructorA
>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>         at sun.reflect.NativeConstructorA
>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>> l.java:45)
>>>>>>         at java.lang.reflect.Constructor.
>>>>>> newInstance(Constructor.java:422)
>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>> Method)
>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>> stractLoadBundleTest.java:224)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>> Method)
>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>         at org.junit.runners.model.Framew
>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>         at org.junit.internal.runners.mod
>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>         at org.junit.runners.model.Framew
>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>         at org.junit.internal.runners.sta
>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>         at org.junit.internal.runners.sta
>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>         at org.junit.rules.ExternalResour
>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $3.run(ParentRunner.java:290)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .access$000(ParentRunner.java:58)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>> .java:290)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>>> back to default.
>>>>>>  java.lang.ClassCastException: Cannot cast
>>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>>         at org.apache.logging.log4j.util.
>>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>>         at org.apache.logging.log4j.util.
>>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>>         at org.apache.logging.log4j.core.
>>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>>> actory.java:97)
>>>>>>         at org.apache.logging.log4j.core.
>>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>>         at sun.reflect.NativeConstructorA
>>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>>         at sun.reflect.NativeConstructorA
>>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingConstruc
>>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImp
>>>>>> l.java:45)
>>>>>>         at java.lang.reflect.Constructor.
>>>>>> newInstance(Constructor.java:422)
>>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>>         at org.apache.logging.log4j.LogMa
>>>>>> nager.<clinit>(LogManager.java:94)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>> Method)
>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>>         at org.apache.logging.log4j.osgi.
>>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>>> stractLoadBundleTest.java:224)
>>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>>>>> Method)
>>>>>>         at sun.reflect.NativeMethodAccess
>>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>>         at sun.reflect.DelegatingMethodAc
>>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>>         at org.junit.runners.model.Framew
>>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>>         at org.junit.internal.runners.mod
>>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>>         at org.junit.runners.model.Framew
>>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>>         at org.junit.internal.runners.sta
>>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>>         at org.junit.internal.runners.sta
>>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>>         at org.junit.rules.ExternalResour
>>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runLeaf(ParentRunner.java:325)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>>         at org.junit.runners.BlockJUnit4C
>>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $3.run(ParentRunner.java:290)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $1.schedule(ParentRunner.java:71)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .runChildren(ParentRunner.java:288)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> .access$000(ParentRunner.java:58)
>>>>>>         at org.junit.runners.ParentRunner
>>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>>         at org.apache.maven.surefire.juni
>>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter
>>>>>> .java:290)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>>         at org.apache.maven.surefire.boot
>>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162
>>>>>> sec - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBu
>>>>>> ndleTest
>>>>>>
>>>>>> Results :
>>>>>>
>>>>>> Tests in error:
>>>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>>>>>> creating bu...
>>>>>>
>>>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>>>
>>>>>> [INFO] ------------------------------------------------------------
>>>>>> ------------
>>>>>> [INFO] Reactor Summary:
>>>>>> [INFO]
>>>>>> [INFO] Apache Log4j 2 ..................................... SUCCESS
>>>>>> [  1.128 s]
>>>>>> [INFO] Apache Log4j API ................................... SUCCESS
>>>>>> [ 28.171 s]
>>>>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>>>>> [16:07 min]
>>>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>>>>>> 17.317 s]
>>>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>>>>>> 13.112 s]
>>>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>>>>>  6.675 s]
>>>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>>>>>  6.340 s]
>>>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>>>>>> 42.596 s]
>>>>>> [INFO] Apache Log4j Web ................................... SUCCESS
>>>>>> [ 17.932 s]
>>>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>>>>>> 32.874 s]
>>>>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS
>>>>>> [  5.310 s]
>>>>>> [INFO] Apache Log4j Samples ............................... SUCCESS
>>>>>> [  0.285 s]
>>>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>>>>>  5.531 s]
>>>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>>>>>  3.135 s]
>>>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>>>>>  6.186 s]
>>>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>>>>>  5.262 s]
>>>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>>>>>  5.167 s]
>>>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>>>>>> 35.346 s]
>>>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>>>>>  5.523 s]
>>>>>> [INFO] Apache Log4j OSGi .................................. FAILURE
>>>>>> [  6.002 s]
>>>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>>>> [INFO] ------------------------------------------------------------
>>>>>> ------------
>>>>>> [INFO] BUILD FAILURE
>>>>>> [INFO] ------------------------------------------------------------
>>>>>> ------------
>>>>>> [INFO] Total time: 20:13 min
>>>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>>>> [INFO] Final Memory: 39M/379M
>>>>>>
>>>>>
>>>>>
>>>
>>>
>>> --
>>> Matt Sicker <bo...@gmail.com>
>>>
>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>>
>

Re: Build fails in OSGi module

Posted by Remko Popma <re...@gmail.com>.
After the Gary applied the remaining patch for LOG4J2-1664, things look a
bit better.

I now see the error below. I think I have seen this before as a transient
error...

Tests in error:
  FelixLoadApiBundleTest.testApiCoreStartStopStartStop ≫ Bundle Error
creating b...
  FelixLoadApiBundleTest.testClassNotFoundErrorLogger ≫ Bundle Error
creating bu...
  FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
creating bu...

Tests run: 10, Failures: 0, Errors: 3, Skipped: 0

[INFO] ------------------------------------------------------------
------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Log4j 2 ..................................... SUCCESS [
 1.564 s]
[INFO] Apache Log4j API ................................... SUCCESS [
53.324 s]
[INFO] Apache Log4j Core .................................. SUCCESS [17:36
min]
[INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
17.501 s]
[INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
10.763 s]
[INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
 6.457 s]
[INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
 5.572 s]
[INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
30.051 s]
[INFO] Apache Log4j Web ................................... SUCCESS [
12.471 s]
[INFO] Apache Log4j Tag Library ........................... SUCCESS [
25.134 s]
[INFO] Apache Log4j JMX GUI ............................... SUCCESS [
 3.526 s]
[INFO] Apache Log4j Samples ............................... SUCCESS [
 0.216 s]
[INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
 3.948 s]
[INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
 2.687 s]
[INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
 5.618 s]
[INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
 4.575 s]
[INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
 4.819 s]
[INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
32.496 s]
[INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
 5.426 s]
[INFO] Apache Log4j OSGi .................................. FAILURE [
 6.967 s]
[INFO] Apache Log4j BOM ................................... SKIPPED
[INFO] Apache Log4j NoSQL ................................. SKIPPED
[INFO] Apache Log4J Performance Tests ..................... SKIPPED
[INFO] Apache Log4j Streaming Interface ................... SKIPPED
[INFO] Apache Log4j JUL Adapter ........................... SKIPPED
[INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
[INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
[INFO] ------------------------------------------------------------
------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------
------------
[INFO] Total time: 21:33 min
[INFO] Finished at: 2016-12-13T08:14:16+09:00
[INFO] Final Memory: 38M/276M
[INFO] ------------------------------------------------------------
------------


On Mon, Dec 12, 2016 at 7:13 AM, Remko Popma <re...@gmail.com> wrote:

> I can take a look later but need to get ready for work now.
>
> Sent from my iPhone
>
> On 12 Dec 2016, at 7:09, Matt Sicker <bo...@gmail.com> wrote:
>
> The patch added in LOG4J2-1664 should fix that issue Remko was seeing. I'm
> not around a development machine to test it out, but I looked at the patch
> and it should address the issue I believe.
>
> On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:
>
>> Since we're not relying on any newer APIs, there's no need to upgrade the
>> OSGi API dependencies themselves, but testing with newer frameworks would
>> be good. I still have a todo item somewhere about trying out the pax-exam
>> OSGi testing framework for something in Commons, though I haven't used OSGi
>> professionally in a while, now, so I keep forgetting about it. (it's
>> usually hard to convince people to embrace physical modularity like OSGi or
>> Jigsaw when they're used to writing things without that assumption in place)
>>
>> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com>
>> wrote:
>>
>>> I wonder if we should also update the versions of the OSGi containers we
>>> test with...
>>>
>>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>>
>>>> Actually probably caused by
>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>> java.nio.channels.OverlappingFileLockException
>>>>
>>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>>>> wrote:
>>>>
>>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>>
>>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>>
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>> back to default.
>>>>>  java.lang.ClassCastException: Cannot cast
>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>
>>>>>
>>>>> Full stacktrace:
>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>> configuration: logging only errors to the console.
>>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to
>>>>> lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>>> java.lang.Exception: Unable to lock bundle cache:
>>>>> java.nio.channels.OverlappingFileLockException
>>>>>         at org.apache.felix.framework.cac
>>>>> he.BundleCache.<init>(BundleCache.java:176)
>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>>         at org.apache.logging.log4j.osgi.
>>>>> tests.junit.OsgiRule.before(OsgiRule.java:63)
>>>>>         at org.junit.rules.ExternalResour
>>>>> ce$1.evaluate(ExternalResource.java:46)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59
>>>>> sec <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>>>> tests.felix.FelixLoadApiBundleTest
>>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<<
>>>>> ERROR!
>>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>>> java.nio.channels.OverlappingFileLockException
>>>>>
>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>>> configuration: logging only errors to the console.
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>> back to default.
>>>>>  java.lang.ClassCastException: Cannot cast
>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>         at org.apache.logging.log4j.util.
>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>         at org.apache.logging.log4j.util.
>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>         at org.apache.logging.log4j.core.
>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>> actory.java:97)
>>>>>         at org.apache.logging.log4j.core.
>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>         at sun.reflect.NativeConstructorA
>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>         at sun.reflect.NativeConstructorA
>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingConstruc
>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>>>>         at java.lang.reflect.Constructor.
>>>>> newInstance(Constructor.java:422)
>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>         at org.apache.logging.log4j.LogMa
>>>>> nager.<clinit>(LogManager.java:94)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccess
>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAc
>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.apache.logging.log4j.osgi.
>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>         at org.apache.logging.log4j.osgi.
>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>> stractLoadBundleTest.java:224)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccess
>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAc
>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.junit.runners.model.Framew
>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>         at org.junit.internal.runners.mod
>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>         at org.junit.runners.model.Framew
>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>         at org.junit.internal.runners.sta
>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>         at org.junit.internal.runners.sta
>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>         at org.junit.rules.ExternalResour
>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>>> back to default.
>>>>>  java.lang.ClassCastException: Cannot cast
>>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>         at org.apache.logging.log4j.util.
>>>>> LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>         at org.apache.logging.log4j.util.
>>>>> LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>         at org.apache.logging.log4j.core.
>>>>> impl.Log4jContextFactory.createContextSelector(Log4jContextF
>>>>> actory.java:97)
>>>>>         at org.apache.logging.log4j.core.
>>>>> impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>         at sun.reflect.NativeConstructorA
>>>>> ccessorImpl.newInstance0(Native Method)
>>>>>         at sun.reflect.NativeConstructorA
>>>>> ccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingConstruc
>>>>> torAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
>>>>>         at java.lang.reflect.Constructor.
>>>>> newInstance(Constructor.java:422)
>>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>>         at org.apache.logging.log4j.LogMa
>>>>> nager.<clinit>(LogManager.java:94)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccess
>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAc
>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.apache.logging.log4j.osgi.
>>>>> tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>         at org.apache.logging.log4j.osgi.
>>>>> tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(Ab
>>>>> stractLoadBundleTest.java:224)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccess
>>>>> orImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAc
>>>>> cessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.junit.runners.model.Framew
>>>>> orkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>         at org.junit.internal.runners.mod
>>>>> el.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>         at org.junit.runners.model.Framew
>>>>> orkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>         at org.junit.internal.runners.sta
>>>>> tements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>         at org.junit.internal.runners.sta
>>>>> tements.RunBefores.evaluate(RunBefores.java:26)
>>>>>         at org.junit.rules.ExternalResour
>>>>> ce$1.evaluate(ExternalResource.java:48)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4C
>>>>> lassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner
>>>>> .access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner
>>>>> $2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.juni
>>>>> t4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.boot
>>>>> er.ForkedBooter.main(ForkedBooter.java:121)
>>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162
>>>>> sec - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBu
>>>>> ndleTest
>>>>>
>>>>> Results :
>>>>>
>>>>> Tests in error:
>>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>>>>> creating bu...
>>>>>
>>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>>
>>>>> [INFO] ------------------------------------------------------------
>>>>> ------------
>>>>> [INFO] Reactor Summary:
>>>>> [INFO]
>>>>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>>>>  1.128 s]
>>>>> [INFO] Apache Log4j API ................................... SUCCESS [
>>>>> 28.171 s]
>>>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>>>> [16:07 min]
>>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>>>>> 17.317 s]
>>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>>>>> 13.112 s]
>>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>>>>  6.675 s]
>>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>>>>  6.340 s]
>>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>>>>> 42.596 s]
>>>>> [INFO] Apache Log4j Web ................................... SUCCESS [
>>>>> 17.932 s]
>>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>>>>> 32.874 s]
>>>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>>>>  5.310 s]
>>>>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>>>>  0.285 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>>>>  5.531 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>>>>  3.135 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>>>>  6.186 s]
>>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>>>>  5.262 s]
>>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>>>>  5.167 s]
>>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>>>>> 35.346 s]
>>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>>>>  5.523 s]
>>>>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>>>>  6.002 s]
>>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>>> [INFO] ------------------------------------------------------------
>>>>> ------------
>>>>> [INFO] BUILD FAILURE
>>>>> [INFO] ------------------------------------------------------------
>>>>> ------------
>>>>> [INFO] Total time: 20:13 min
>>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>>> [INFO] Final Memory: 39M/379M
>>>>>
>>>>
>>>>
>>
>>
>> --
>> Matt Sicker <bo...@gmail.com>
>>
>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>
>

Re: Build fails in OSGi module

Posted by Remko Popma <re...@gmail.com>.
I can take a look later but need to get ready for work now. 

Sent from my iPhone

> On 12 Dec 2016, at 7:09, Matt Sicker <bo...@gmail.com> wrote:
> 
> The patch added in LOG4J2-1664 should fix that issue Remko was seeing. I'm not around a development machine to test it out, but I looked at the patch and it should address the issue I believe.
> 
>> On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:
>> Since we're not relying on any newer APIs, there's no need to upgrade the OSGi API dependencies themselves, but testing with newer frameworks would be good. I still have a todo item somewhere about trying out the pax-exam OSGi testing framework for something in Commons, though I haven't used OSGi professionally in a while, now, so I keep forgetting about it. (it's usually hard to convince people to embrace physical modularity like OSGi or Jigsaw when they're used to writing things without that assumption in place)
>> 
>>> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com> wrote:
>>> I wonder if we should also update the versions of the OSGi containers we test with...
>>> 
>>>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>>> Actually probably caused by 
>>>> Caused by: java.lang.Exception: Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException
>>>> 
>>>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com> wrote:
>>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>> 
>>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>> 
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
>>>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
>>>>> 
>>>>> 
>>>>> Full stacktrace:
>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
>>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>>> java.lang.Exception: Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException
>>>>>         at org.apache.felix.framework.cache.BundleCache.<init>(BundleCache.java:176)
>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(OsgiRule.java:63)
>>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
>>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec <<< FAILURE! - in org.apache.logging.log4j.osgi.tests.felix.FelixLoadApiBundleTest
>>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.tests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<< ERROR!
>>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>>> Caused by: java.lang.Exception: Unable to lock bundle cache: java.nio.channels.OverlappingFileLockException
>>>>> 
>>>>> ERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console.
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
>>>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
>>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>         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)
>>>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
>>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back to default.
>>>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector to org.apache.logging.log4j.core.selector.ContextSelector
>>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(LoaderUtil.java:201)
>>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOfProperty(LoaderUtil.java:226)
>>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.createContextSelector(Log4jContextFactory.java:97)
>>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init>(Log4jContextFactory.java:58)
>>>>>         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)
>>>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java:94)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.log(AbstractLoadBundleTest.java:95)
>>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
>>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
>>>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
>>>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
>>>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
>>>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
>>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:48)
>>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
>>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
>>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
>>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
>>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:367)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:274)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:238)
>>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:161)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:290)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:242)
>>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:121)
>>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162 sec - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBundleTest
>>>>> 
>>>>> Results :
>>>>> 
>>>>> Tests in error:
>>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext $B"d(B Bundle Error creating bu...
>>>>> 
>>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>> 
>>>>> [INFO] ------------------------------------------------------------------------
>>>>> [INFO] Reactor Summary:
>>>>> [INFO]
>>>>> [INFO] Apache Log4j 2 ..................................... SUCCESS [  1.128 s]
>>>>> [INFO] Apache Log4j API ................................... SUCCESS [ 28.171 s]
>>>>> [INFO] Apache Log4j Core .................................. SUCCESS [16:07 min]
>>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [ 17.317 s]
>>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [ 13.112 s]
>>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [  6.675 s]
>>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [  6.340 s]
>>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [ 42.596 s]
>>>>> [INFO] Apache Log4j Web ................................... SUCCESS [ 17.932 s]
>>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [ 32.874 s]
>>>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [  5.310 s]
>>>>> [INFO] Apache Log4j Samples ............................... SUCCESS [  0.285 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [  5.531 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [  3.135 s]
>>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [  6.186 s]
>>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [  5.262 s]
>>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [  5.167 s]
>>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [ 35.346 s]
>>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [  5.523 s]
>>>>> [INFO] Apache Log4j OSGi .................................. FAILURE [  6.002 s]
>>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>>> [INFO] ------------------------------------------------------------------------
>>>>> [INFO] BUILD FAILURE
>>>>> [INFO] ------------------------------------------------------------------------
>>>>> [INFO] Total time: 20:13 min
>>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>>> [INFO] Final Memory: 39M/379M
>>>> 
>> 
>> 
>> 
>> -- 
>> Matt Sicker <bo...@gmail.com>
> 
> 
> 
> -- 
> Matt Sicker <bo...@gmail.com>

Re: Build fails in OSGi module

Posted by Matt Sicker <bo...@gmail.com>.
The patch added in LOG4J2-1664 should fix that issue Remko was seeing. I'm
not around a development machine to test it out, but I looked at the patch
and it should address the issue I believe.

On 11 December 2016 at 13:42, Matt Sicker <bo...@gmail.com> wrote:

> Since we're not relying on any newer APIs, there's no need to upgrade the
> OSGi API dependencies themselves, but testing with newer frameworks would
> be good. I still have a todo item somewhere about trying out the pax-exam
> OSGi testing framework for something in Commons, though I haven't used OSGi
> professionally in a while, now, so I keep forgetting about it. (it's
> usually hard to convince people to embrace physical modularity like OSGi or
> Jigsaw when they're used to writing things without that assumption in place)
>
> On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com> wrote:
>
>> I wonder if we should also update the versions of the OSGi containers we
>> test with...
>>
>> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>>
>>> Actually probably caused by
>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>> java.nio.channels.OverlappingFileLockException
>>>
>>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>>> wrote:
>>>
>>>> The build failed three times in a row on my Windows 10 machine now.
>>>>
>>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>>
>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>> back to default.
>>>>  java.lang.ClassCastException: Cannot cast
>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>
>>>>
>>>> Full stacktrace:
>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>> configuration: logging only errors to the console.
>>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to
>>>> lock bundle cache: java.nio.channels.OverlappingFileLockException)
>>>> java.lang.Exception: Unable to lock bundle cache:
>>>> java.nio.channels.OverlappingFileLockException
>>>>         at org.apache.felix.framework.cache.BundleCache.<init>(BundleCa
>>>> che.java:176)
>>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(Os
>>>> giRule.java:63)
>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>>> .java:46)
>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325
>>>> )
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:78)
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:57)
>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>>> 71)
>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>>> :288)
>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>>> 58)
>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>>> 268)
>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>>> t4Provider.java:367)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>>> erun(JUnit4Provider.java:274)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>>> et(JUnit4Provider.java:238)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>>> 4Provider.java:161)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>>> InSameClassLoader(ForkedBooter.java:290)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>>> cess(ForkedBooter.java:242)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>>> ter.java:121)
>>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59
>>>> sec <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>>> tests.felix.FelixLoadApiBundleTest
>>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<< ERROR!
>>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>>> java.nio.channels.OverlappingFileLockException
>>>>
>>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>>> configuration: logging only errors to the console.
>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>> back to default.
>>>>  java.lang.ClassCastException: Cannot cast
>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>>> f(LoaderUtil.java:201)
>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>>> fProperty(LoaderUtil.java:226)
>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>>>> eContextSelector(Log4jContextFactory.java:97)
>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>>>> >(Log4jContextFactory.java:58)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>>> Method)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>>>> ConstructorAccessorImpl.java:62)
>>>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>>>> legatingConstructorAccessorImpl.java:45)
>>>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>>>> 22)
>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java
>>>> :94)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>> ssorImpl.java:62)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>> thodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>>>> og(AbstractLoadBundleTest.java:95)
>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>>>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>> ssorImpl.java:62)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>> thodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>>> FrameworkMethod.java:50)
>>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>>>> ectiveCallable.java:12)
>>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>>>> ameworkMethod.java:47)
>>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>>>> InvokeMethod.java:17)
>>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
>>>> nBefores.java:26)
>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>>> .java:48)
>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325
>>>> )
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:78)
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:57)
>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>>> 71)
>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>>> :288)
>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>>> 58)
>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>>> 268)
>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>>> t4Provider.java:367)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>>> erun(JUnit4Provider.java:274)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>>> et(JUnit4Provider.java:238)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>>> 4Provider.java:161)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>>> InSameClassLoader(ForkedBooter.java:290)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>>> cess(ForkedBooter.java:242)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>>> ter.java:121)
>>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling
>>>> back to default.
>>>>  java.lang.ClassCastException: Cannot cast
>>>> org.apache.logging.log4j.core.osgi.BundleContextSelector to
>>>> org.apache.logging.log4j.core.selector.ContextSelector
>>>>         at java.lang.Class.cast(Class.java:3369)
>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>>> f(LoaderUtil.java:201)
>>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>>> fProperty(LoaderUtil.java:226)
>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>>>> eContextSelector(Log4jContextFactory.java:97)
>>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>>>> >(Log4jContextFactory.java:58)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>>> Method)
>>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>>>> ConstructorAccessorImpl.java:62)
>>>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>>>> legatingConstructorAccessorImpl.java:45)
>>>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>>>> 22)
>>>>         at java.lang.Class.newInstance(Class.java:442)
>>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java
>>>> :94)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>> ssorImpl.java:62)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>> thodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>>>> og(AbstractLoadBundleTest.java:95)
>>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>>>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>>> ssorImpl.java:62)
>>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>>> thodAccessorImpl.java:43)
>>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>>> FrameworkMethod.java:50)
>>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>>>> ectiveCallable.java:12)
>>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>>>> ameworkMethod.java:47)
>>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>>>> InvokeMethod.java:17)
>>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
>>>> nBefores.java:26)
>>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>>> .java:48)
>>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325
>>>> )
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:78)
>>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>>> 4ClassRunner.java:57)
>>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>>> 71)
>>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>>> :288)
>>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>>> 58)
>>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>>> 268)
>>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>>> t4Provider.java:367)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>>> erun(JUnit4Provider.java:274)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>>> et(JUnit4Provider.java:238)
>>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>>> 4Provider.java:161)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>>> InSameClassLoader(ForkedBooter.java:290)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>>> cess(ForkedBooter.java:242)
>>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>>> ter.java:121)
>>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162
>>>> sec - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBu
>>>> ndleTest
>>>>
>>>> Results :
>>>>
>>>> Tests in error:
>>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>>>> creating bu...
>>>>
>>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>>
>>>> [INFO] ------------------------------------------------------------
>>>> ------------
>>>> [INFO] Reactor Summary:
>>>> [INFO]
>>>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>>>  1.128 s]
>>>> [INFO] Apache Log4j API ................................... SUCCESS [
>>>> 28.171 s]
>>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>>> [16:07 min]
>>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>>>> 17.317 s]
>>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>>>> 13.112 s]
>>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>>>  6.675 s]
>>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>>>  6.340 s]
>>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>>>> 42.596 s]
>>>> [INFO] Apache Log4j Web ................................... SUCCESS [
>>>> 17.932 s]
>>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>>>> 32.874 s]
>>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>>>  5.310 s]
>>>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>>>  0.285 s]
>>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>>>  5.531 s]
>>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>>>  3.135 s]
>>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>>>  6.186 s]
>>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>>>  5.262 s]
>>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>>>  5.167 s]
>>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>>>> 35.346 s]
>>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>>>  5.523 s]
>>>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>>>  6.002 s]
>>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>>> [INFO] ------------------------------------------------------------
>>>> ------------
>>>> [INFO] BUILD FAILURE
>>>> [INFO] ------------------------------------------------------------
>>>> ------------
>>>> [INFO] Total time: 20:13 min
>>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>>> [INFO] Final Memory: 39M/379M
>>>>
>>>
>>>
>
>
> --
> Matt Sicker <bo...@gmail.com>
>



-- 
Matt Sicker <bo...@gmail.com>

Re: Build fails in OSGi module

Posted by Matt Sicker <bo...@gmail.com>.
Since we're not relying on any newer APIs, there's no need to upgrade the
OSGi API dependencies themselves, but testing with newer frameworks would
be good. I still have a todo item somewhere about trying out the pax-exam
OSGi testing framework for something in Commons, though I haven't used OSGi
professionally in a while, now, so I keep forgetting about it. (it's
usually hard to convince people to embrace physical modularity like OSGi or
Jigsaw when they're used to writing things without that assumption in place)

On 11 December 2016 at 13:04, Gary Gregory <ga...@gmail.com> wrote:

> I wonder if we should also update the versions of the OSGi containers we
> test with...
>
> On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:
>
>> Actually probably caused by
>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>> java.nio.channels.OverlappingFileLockException
>>
>> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
>> wrote:
>>
>>> The build failed three times in a row on my Windows 10 machine now.
>>>
>>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>>
>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>>> to default.
>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>>> to org.apache.logging.log4j.core.selector.ContextSelector
>>>
>>>
>>> Full stacktrace:
>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>> configuration: logging only errors to the console.
>>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock
>>> bundle cache: java.nio.channels.OverlappingFileLockException)
>>> java.lang.Exception: Unable to lock bundle cache:
>>> java.nio.channels.OverlappingFileLockException
>>>         at org.apache.felix.framework.cache.BundleCache.<init>(BundleCa
>>> che.java:176)
>>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(Os
>>> giRule.java:63)
>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>> .java:46)
>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:78)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:57)
>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>> 71)
>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>> :288)
>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>> 58)
>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>> 268)
>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>> t4Provider.java:367)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>> erun(JUnit4Provider.java:274)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>> et(JUnit4Provider.java:238)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>> 4Provider.java:161)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>> InSameClassLoader(ForkedBooter.java:290)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>> cess(ForkedBooter.java:242)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>> ter.java:121)
>>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec
>>> <<< FAILURE! - in org.apache.logging.log4j.osgi.
>>> tests.felix.FelixLoadApiBundleTest
>>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<< ERROR!
>>> org.osgi.framework.BundleException: Error creating bundle cache.
>>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>>> java.nio.channels.OverlappingFileLockException
>>>
>>> ERROR StatusLogger No log4j2 configuration file found. Using default
>>> configuration: logging only errors to the console.
>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>>> to default.
>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>>> to org.apache.logging.log4j.core.selector.ContextSelector
>>>         at java.lang.Class.cast(Class.java:3369)
>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>> f(LoaderUtil.java:201)
>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>> fProperty(LoaderUtil.java:226)
>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>>> eContextSelector(Log4jContextFactory.java:97)
>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>>> >(Log4jContextFactory.java:58)
>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>> Method)
>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>>> ConstructorAccessorImpl.java:62)
>>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>>> legatingConstructorAccessorImpl.java:45)
>>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>>> 22)
>>>         at java.lang.Class.newInstance(Class.java:442)
>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java
>>> :94)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>> ssorImpl.java:62)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>> thodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>>> og(AbstractLoadBundleTest.java:95)
>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>> ssorImpl.java:62)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>> thodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>> FrameworkMethod.java:50)
>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>>> ectiveCallable.java:12)
>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>>> ameworkMethod.java:47)
>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>>> InvokeMethod.java:17)
>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
>>> nBefores.java:26)
>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>> .java:48)
>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:78)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:57)
>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>> 71)
>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>> :288)
>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>> 58)
>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>> 268)
>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>> t4Provider.java:367)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>> erun(JUnit4Provider.java:274)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>> et(JUnit4Provider.java:238)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>> 4Provider.java:161)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>> InSameClassLoader(ForkedBooter.java:290)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>> cess(ForkedBooter.java:242)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>> ter.java:121)
>>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>>> to default.
>>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>>> to org.apache.logging.log4j.core.selector.ContextSelector
>>>         at java.lang.Class.cast(Class.java:3369)
>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>> f(LoaderUtil.java:201)
>>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>>> fProperty(LoaderUtil.java:226)
>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>>> eContextSelector(Log4jContextFactory.java:97)
>>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>>> >(Log4jContextFactory.java:58)
>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>>> Method)
>>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>>> ConstructorAccessorImpl.java:62)
>>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>>> legatingConstructorAccessorImpl.java:45)
>>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>>> 22)
>>>         at java.lang.Class.newInstance(Class.java:442)
>>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.java
>>> :94)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>> ssorImpl.java:62)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>> thodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>>> og(AbstractLoadBundleTest.java:95)
>>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>>> ssorImpl.java:62)
>>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>>> thodAccessorImpl.java:43)
>>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>>> FrameworkMethod.java:50)
>>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>>> ectiveCallable.java:12)
>>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>>> ameworkMethod.java:47)
>>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>>> InvokeMethod.java:17)
>>>         at org.junit.internal.runners.statements.RunBefores.evaluate(Ru
>>> nBefores.java:26)
>>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>>> .java:48)
>>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:78)
>>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>>> 4ClassRunner.java:57)
>>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>>> 71)
>>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.java
>>> :288)
>>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>>> 58)
>>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>>> 268)
>>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>>> t4Provider.java:367)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>>> erun(JUnit4Provider.java:274)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>>> et(JUnit4Provider.java:238)
>>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>>> 4Provider.java:161)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>>> InSameClassLoader(ForkedBooter.java:290)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>>> cess(ForkedBooter.java:242)
>>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>>> ter.java:121)
>>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162
>>> sec - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBu
>>> ndleTest
>>>
>>> Results :
>>>
>>> Tests in error:
>>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>>> creating bu...
>>>
>>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>>
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] Reactor Summary:
>>> [INFO]
>>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>>  1.128 s]
>>> [INFO] Apache Log4j API ................................... SUCCESS [
>>> 28.171 s]
>>> [INFO] Apache Log4j Core .................................. SUCCESS
>>> [16:07 min]
>>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>>> 17.317 s]
>>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>>> 13.112 s]
>>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>>  6.675 s]
>>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>>  6.340 s]
>>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>>> 42.596 s]
>>> [INFO] Apache Log4j Web ................................... SUCCESS [
>>> 17.932 s]
>>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>>> 32.874 s]
>>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>>  5.310 s]
>>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>>  0.285 s]
>>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>>  5.531 s]
>>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>>  3.135 s]
>>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>>  6.186 s]
>>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>>  5.262 s]
>>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>>  5.167 s]
>>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>>> 35.346 s]
>>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>>  5.523 s]
>>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>>  6.002 s]
>>> [INFO] Apache Log4j BOM ................................... SKIPPED
>>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] BUILD FAILURE
>>> [INFO] ------------------------------------------------------------
>>> ------------
>>> [INFO] Total time: 20:13 min
>>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>>> [INFO] Final Memory: 39M/379M
>>>
>>
>>


-- 
Matt Sicker <bo...@gmail.com>

Re: Build fails in OSGi module

Posted by Gary Gregory <ga...@gmail.com>.
I wonder if we should also update the versions of the OSGi containers we
test with...

On Dec 11, 2016 2:49 AM, "Remko Popma" <re...@gmail.com> wrote:

> Actually probably caused by
> Caused by: java.lang.Exception: Unable to lock bundle cache:
> java.nio.channels.OverlappingFileLockException
>
> On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com>
> wrote:
>
>> The build failed three times in a row on my Windows 10 machine now.
>>
>> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>>
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>
>>
>> Full stacktrace:
>> ERROR StatusLogger No log4j2 configuration file found. Using default
>> configuration: logging only errors to the console.
>> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock
>> bundle cache: java.nio.channels.OverlappingFileLockException)
>> java.lang.Exception: Unable to lock bundle cache:
>> java.nio.channels.OverlappingFileLockException
>>         at org.apache.felix.framework.cache.BundleCache.<init>(BundleCa
>> che.java:176)
>>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(Os
>> giRule.java:63)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:46)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec
>> <<< FAILURE! - in org.apache.logging.log4j.osgi.
>> tests.felix.FelixLoadApiBundleTest
>> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.t
>> ests.felix.FelixLoadApiBundleTest)  Time elapsed: 0.012 sec  <<< ERROR!
>> org.osgi.framework.BundleException: Error creating bundle cache.
>> Caused by: java.lang.Exception: Unable to lock bundle cache:
>> java.nio.channels.OverlappingFileLockException
>>
>> ERROR StatusLogger No log4j2 configuration file found. Using default
>> configuration: logging only errors to the console.
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>         at java.lang.Class.cast(Class.java:3369)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> f(LoaderUtil.java:201)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> fProperty(LoaderUtil.java:226)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>> eContextSelector(Log4jContextFactory.java:97)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>> >(Log4jContextFactory.java:58)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>> ConstructorAccessorImpl.java:62)
>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>> legatingConstructorAccessorImpl.java:45)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>> 22)
>>         at java.lang.Class.newInstance(Class.java:442)
>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.
>> java:94)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>> og(AbstractLoadBundleTest.java:95)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> FrameworkMethod.java:50)
>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>> ectiveCallable.java:12)
>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>> ameworkMethod.java:47)
>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>> InvokeMethod.java:17)
>>         at org.junit.internal.runners.statements.RunBefores.evaluate(
>> RunBefores.java:26)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:48)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
>> to default.
>>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
>> to org.apache.logging.log4j.core.selector.ContextSelector
>>         at java.lang.Class.cast(Class.java:3369)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> f(LoaderUtil.java:201)
>>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceO
>> fProperty(LoaderUtil.java:226)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.creat
>> eContextSelector(Log4jContextFactory.java:97)
>>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<init
>> >(Log4jContextFactory.java:58)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> Method)
>>         at sun.reflect.NativeConstructorAccessorImpl.newInstance(Native
>> ConstructorAccessorImpl.java:62)
>>         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(De
>> legatingConstructorAccessorImpl.java:45)
>>         at java.lang.reflect.Constructor.newInstance(Constructor.java:4
>> 22)
>>         at java.lang.Class.newInstance(Class.java:442)
>>         at org.apache.logging.log4j.LogManager.<clinit>(LogManager.
>> java:94)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.l
>> og(AbstractLoadBundleTest.java:95)
>>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.t
>> estSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAcce
>> ssorImpl.java:62)
>>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMe
>> thodAccessorImpl.java:43)
>>         at java.lang.reflect.Method.invoke(Method.java:497)
>>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
>> FrameworkMethod.java:50)
>>         at org.junit.internal.runners.model.ReflectiveCallable.run(Refl
>> ectiveCallable.java:12)
>>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(Fr
>> ameworkMethod.java:47)
>>         at org.junit.internal.runners.statements.InvokeMethod.evaluate(
>> InvokeMethod.java:17)
>>         at org.junit.internal.runners.statements.RunBefores.evaluate(
>> RunBefores.java:26)
>>         at org.junit.rules.ExternalResource$1.evaluate(ExternalResource
>> .java:48)
>>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:78)
>>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit
>> 4ClassRunner.java:57)
>>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:
>> 71)
>>         at org.junit.runners.ParentRunner.runChildren(ParentRunner.
>> java:288)
>>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:
>> 58)
>>         at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:
>> 268)
>>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUni
>> t4Provider.java:367)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithR
>> erun(JUnit4Provider.java:274)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestS
>> et(JUnit4Provider.java:238)
>>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit
>> 4Provider.java:161)
>>         at org.apache.maven.surefire.booter.ForkedBooter.invokeProvider
>> InSameClassLoader(ForkedBooter.java:290)
>>         at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInPro
>> cess(ForkedBooter.java:242)
>>         at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBoo
>> ter.java:121)
>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162 sec
>> - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBundleTest
>>
>> Results :
>>
>> Tests in error:
>>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
>> creating bu...
>>
>> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>>
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>>  1.128 s]
>> [INFO] Apache Log4j API ................................... SUCCESS [
>> 28.171 s]
>> [INFO] Apache Log4j Core .................................. SUCCESS
>> [16:07 min]
>> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
>> 17.317 s]
>> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
>> 13.112 s]
>> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>>  6.675 s]
>> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>>  6.340 s]
>> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
>> 42.596 s]
>> [INFO] Apache Log4j Web ................................... SUCCESS [
>> 17.932 s]
>> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
>> 32.874 s]
>> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>>  5.310 s]
>> [INFO] Apache Log4j Samples ............................... SUCCESS [
>>  0.285 s]
>> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>>  5.531 s]
>> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>>  3.135 s]
>> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>>  6.186 s]
>> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>>  5.262 s]
>> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>>  5.167 s]
>> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
>> 35.346 s]
>> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>>  5.523 s]
>> [INFO] Apache Log4j OSGi .................................. FAILURE [
>>  6.002 s]
>> [INFO] Apache Log4j BOM ................................... SKIPPED
>> [INFO] Apache Log4j NoSQL ................................. SKIPPED
>> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
>> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
>> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
>> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
>> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] BUILD FAILURE
>> [INFO] ------------------------------------------------------------
>> ------------
>> [INFO] Total time: 20:13 min
>> [INFO] Finished at: 2016-12-11T19:22:07+09:00
>> [INFO] Final Memory: 39M/379M
>>
>
>

Re: Build fails in OSGi module

Posted by Remko Popma <re...@gmail.com>.
Actually probably caused by
Caused by: java.lang.Exception: Unable to lock bundle cache:
java.nio.channels.OverlappingFileLockException

On Sun, Dec 11, 2016 at 7:30 PM, Remko Popma <re...@gmail.com> wrote:

> The build failed three times in a row on my Windows 10 machine now.
>
> FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext
>
> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
> to default.
>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
> to org.apache.logging.log4j.core.selector.ContextSelector
>
>
> Full stacktrace:
> ERROR StatusLogger No log4j2 configuration file found. Using default
> configuration: logging only errors to the console.
> ERROR: Error creating bundle cache. (java.lang.Exception: Unable to lock
> bundle cache: java.nio.channels.OverlappingFileLockException)
> java.lang.Exception: Unable to lock bundle cache: java.nio.channels.
> OverlappingFileLockException
>         at org.apache.felix.framework.cache.BundleCache.<init>(
> BundleCache.java:176)
>         at org.apache.felix.framework.Felix.init(Felix.java:689)
>         at org.apache.felix.framework.Felix.init(Felix.java:624)
>         at org.apache.logging.log4j.osgi.tests.junit.OsgiRule.before(
> OsgiRule.java:63)
>         at org.junit.rules.ExternalResource$1.evaluate(
> ExternalResource.java:46)
>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:78)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:57)
>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>         at org.junit.runners.ParentRunner.runChildren(
> ParentRunner.java:288)
>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>         at org.junit.runners.ParentRunner$2.evaluate(
> ParentRunner.java:268)
>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
> JUnit4Provider.java:367)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeWithRerun(JUnit4Provider.java:274)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeTestSet(JUnit4Provider.java:238)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
> JUnit4Provider.java:161)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> invokeProviderInSameClassLoader(ForkedBooter.java:290)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> runSuitesInProcess(ForkedBooter.java:242)
>         at org.apache.maven.surefire.booter.ForkedBooter.main(
> ForkedBooter.java:121)
> Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.59 sec
> <<< FAILURE! - in org.apache.logging.log4j.osgi.tests.felix.
> FelixLoadApiBundleTest
> testSimpleLogInAnOsgiContext(org.apache.logging.log4j.osgi.tests.felix.FelixLoadApiBundleTest)
>  Time elapsed: 0.012 sec  <<< ERROR!
> org.osgi.framework.BundleException: Error creating bundle cache.
> Caused by: java.lang.Exception: Unable to lock bundle cache:
> java.nio.channels.OverlappingFileLockException
>
> ERROR StatusLogger No log4j2 configuration file found. Using default
> configuration: logging only errors to the console.
> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
> to default.
>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
> to org.apache.logging.log4j.core.selector.ContextSelector
>         at java.lang.Class.cast(Class.java:3369)
>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(
> LoaderUtil.java:201)
>         at org.apache.logging.log4j.util.LoaderUtil.
> newCheckedInstanceOfProperty(LoaderUtil.java:226)
>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.
> createContextSelector(Log4jContextFactory.java:97)
>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<
> init>(Log4jContextFactory.java:58)
>         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)
>         at org.apache.logging.log4j.LogManager.<clinit>(
> LogManager.java:94)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.
> log(AbstractLoadBundleTest.java:95)
>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.
> testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:50)
>         at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:12)
>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:47)
>         at org.junit.internal.runners.statements.InvokeMethod.
> evaluate(InvokeMethod.java:17)
>         at org.junit.internal.runners.statements.RunBefores.
> evaluate(RunBefores.java:26)
>         at org.junit.rules.ExternalResource$1.evaluate(
> ExternalResource.java:48)
>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:78)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:57)
>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>         at org.junit.runners.ParentRunner.runChildren(
> ParentRunner.java:288)
>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>         at org.junit.runners.ParentRunner$2.evaluate(
> ParentRunner.java:268)
>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
> JUnit4Provider.java:367)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeWithRerun(JUnit4Provider.java:274)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeTestSet(JUnit4Provider.java:238)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
> JUnit4Provider.java:161)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> invokeProviderInSameClassLoader(ForkedBooter.java:290)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> runSuitesInProcess(ForkedBooter.java:242)
>         at org.apache.maven.surefire.booter.ForkedBooter.main(
> ForkedBooter.java:121)
> ERROR StatusLogger Unable to create custom ContextSelector. Falling back
> to default.
>  java.lang.ClassCastException: Cannot cast org.apache.logging.log4j.core.osgi.BundleContextSelector
> to org.apache.logging.log4j.core.selector.ContextSelector
>         at java.lang.Class.cast(Class.java:3369)
>         at org.apache.logging.log4j.util.LoaderUtil.newCheckedInstanceOf(
> LoaderUtil.java:201)
>         at org.apache.logging.log4j.util.LoaderUtil.
> newCheckedInstanceOfProperty(LoaderUtil.java:226)
>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.
> createContextSelector(Log4jContextFactory.java:97)
>         at org.apache.logging.log4j.core.impl.Log4jContextFactory.<
> init>(Log4jContextFactory.java:58)
>         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)
>         at org.apache.logging.log4j.LogManager.<clinit>(
> LogManager.java:94)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.
> log(AbstractLoadBundleTest.java:95)
>         at org.apache.logging.log4j.osgi.tests.AbstractLoadBundleTest.
> testSimpleLogInAnOsgiContext(AbstractLoadBundleTest.java:224)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(
> NativeMethodAccessorImpl.java:62)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(
> DelegatingMethodAccessorImpl.java:43)
>         at java.lang.reflect.Method.invoke(Method.java:497)
>         at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
> FrameworkMethod.java:50)
>         at org.junit.internal.runners.model.ReflectiveCallable.run(
> ReflectiveCallable.java:12)
>         at org.junit.runners.model.FrameworkMethod.invokeExplosively(
> FrameworkMethod.java:47)
>         at org.junit.internal.runners.statements.InvokeMethod.
> evaluate(InvokeMethod.java:17)
>         at org.junit.internal.runners.statements.RunBefores.
> evaluate(RunBefores.java:26)
>         at org.junit.rules.ExternalResource$1.evaluate(
> ExternalResource.java:48)
>         at org.junit.rules.RunRules.evaluate(RunRules.java:20)
>         at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:78)
>         at org.junit.runners.BlockJUnit4ClassRunner.runChild(
> BlockJUnit4ClassRunner.java:57)
>         at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
>         at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
>         at org.junit.runners.ParentRunner.runChildren(
> ParentRunner.java:288)
>         at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
>         at org.junit.runners.ParentRunner$2.evaluate(
> ParentRunner.java:268)
>         at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.execute(
> JUnit4Provider.java:367)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeWithRerun(JUnit4Provider.java:274)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.
> executeTestSet(JUnit4Provider.java:238)
>         at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(
> JUnit4Provider.java:161)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> invokeProviderInSameClassLoader(ForkedBooter.java:290)
>         at org.apache.maven.surefire.booter.ForkedBooter.
> runSuitesInProcess(ForkedBooter.java:242)
>         at org.apache.maven.surefire.booter.ForkedBooter.main(
> ForkedBooter.java:121)
> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.162 sec
> - in org.apache.logging.log4j.osgi.tests.equinox.EquinoxLoadApiBundleTest
>
> Results :
>
> Tests in error:
>   FelixLoadApiBundleTest.testSimpleLogInAnOsgiContext ≫ Bundle Error
> creating bu...
>
> Tests run: 6, Failures: 0, Errors: 1, Skipped: 0
>
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache Log4j 2 ..................................... SUCCESS [
>  1.128 s]
> [INFO] Apache Log4j API ................................... SUCCESS [
> 28.171 s]
> [INFO] Apache Log4j Core .................................. SUCCESS
> [16:07 min]
> [INFO] Apache Log4j 1.x Compatibility API ................. SUCCESS [
> 17.317 s]
> [INFO] Apache Log4j SLF4J Binding ......................... SUCCESS [
> 13.112 s]
> [INFO] Apache Log4j to SLF4J Adapter ...................... SUCCESS [
>  6.675 s]
> [INFO] Apache Log4j Commons Logging Bridge ................ SUCCESS [
>  6.340 s]
> [INFO] Apache Log4j Flume Bridge .......................... SUCCESS [
> 42.596 s]
> [INFO] Apache Log4j Web ................................... SUCCESS [
> 17.932 s]
> [INFO] Apache Log4j Tag Library ........................... SUCCESS [
> 32.874 s]
> [INFO] Apache Log4j JMX GUI ............................... SUCCESS [
>  5.310 s]
> [INFO] Apache Log4j Samples ............................... SUCCESS [
>  0.285 s]
> [INFO] Apache Log4j Samples: Flume - Common ............... SUCCESS [
>  5.531 s]
> [INFO] Apache Log4j Samples: Flume - Remote ............... SUCCESS [
>  3.135 s]
> [INFO] Apache Log4j Samples: Flume - Embedded ............. SUCCESS [
>  6.186 s]
> [INFO] Apache Log4j Samples: Configuration ................ SUCCESS [
>  5.262 s]
> [INFO] Apache Log4j Samples: LoggerProperties ............. SUCCESS [
>  5.167 s]
> [INFO] Apache Log4j Scala 2.11 wrapper for Log4j API ...... SUCCESS [
> 35.346 s]
> [INFO] Apache Log4j Samples: Scala API .................... SUCCESS [
>  5.523 s]
> [INFO] Apache Log4j OSGi .................................. FAILURE [
>  6.002 s]
> [INFO] Apache Log4j BOM ................................... SKIPPED
> [INFO] Apache Log4j NoSQL ................................. SKIPPED
> [INFO] Apache Log4J Performance Tests ..................... SKIPPED
> [INFO] Apache Log4j Streaming Interface ................... SKIPPED
> [INFO] Apache Log4j JUL Adapter ........................... SKIPPED
> [INFO] Apache Log4j Liquibase Binding ..................... SKIPPED
> [INFO] Apache Log4j Scala 2.10 wrapper for Log4j API ...... SKIPPED
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] BUILD FAILURE
> [INFO] ------------------------------------------------------------
> ------------
> [INFO] Total time: 20:13 min
> [INFO] Finished at: 2016-12-11T19:22:07+09:00
> [INFO] Final Memory: 39M/379M
>