Re: Apache Tamaya and pax-exam problems

2018-06-25 Thread luke
Hey Dominik,
I think you might have two bundles exporting same class in two different 
versions or another issue:

Caused by: java.util.ServiceConfigurationError:
org.apache.tamaya.spi.PropertyConverter: Provider
org.apache.tamaya.collections.ArrayListConverter not a subtype

I suppose these types are compatible. Another thing that ServiceLoader usage 
under OSGi might (and most likely will) have different behaviour than in 
regular deployments due to class loader visibility.

Pozdrawiam
Ɓukasz

> On 22 Jun 2018, at 12:18, Dominik Marciniszyn  
> wrote:
> 
> Hi,
> I'm trying to test my bundle which uses apache tamaya. I'm using recommended
> technology for this pax-exam.
> I created the abstract class which setup karaf test container based on
> pax-exam documentation. Problem shows up when
> I'm trying to test method which uses apache tamaya. Logs shows me an error:
> 
> 2018-06-22T10:34:38,292 | ERROR | pool-1-thread-2  | BootFeaturesInstaller
>
> | 10 - org.apache.karaf.features.core - 4.1.5 | Error installing boot
> features
> org.apache.karaf.features.internal.util.MultiException: Error restarting
> bundles:
>   Exception in org.apache.tamaya.core.OSGIActivator.start() of bundle
> org.apache.tamaya.core.
>   at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:902)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1248)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1(FeaturesServiceImpl.java:1147)
> ~[?:?]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
>   at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [?:?]
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [?:?]
>   at java.lang.Thread.run(Thread.java:745) [?:?]
>   Suppressed: org.osgi.framework.BundleException: Exception in
> org.apache.tamaya.core.OSGIActivator.start() of bundle
> org.apache.tamaya.core.
>   at
> org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:800)
> ~[?:?]
>   at
> org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729)
> ~[?:?]
>   at
> org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:933)
> ~[?:?]
>   at
> org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
> ~[?:?]
>   at org.eclipse.osgi.container.Module.doStart(Module.java:581) 
> ~[?:?]
>   at org.eclipse.osgi.container.Module.start(Module.java:449) 
> ~[?:?]
>   at
> org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383)
> ~[?:?]
>   at
> org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1361)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:894)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1248)
> ~[?:?]
>   at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1(FeaturesServiceImpl.java:1147)
> ~[?:?]
>   at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
> [?:?]
>   at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
> [?:?]
>   at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
> [?:?]
>   at java.lang.Thread.run(Thread.java:745) [?:?]
>   Caused by: java.util.ServiceConfigurationError:
> org.apache.tamaya.spi.PropertyConverter: Provider
> org.apache.tamaya.collections.ArrayListConverter not a subtype
>   at java.util.ServiceLoader.fail(ServiceLoader.java:239) ~[?:?]
>   at java.util.ServiceLoader.access$300(ServiceLoader.java:185) 
> ~[?:?]
>   at
> java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
> ~[?:?]
>   at 
> java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
> ~[?:?]
>   at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[?:?]
>   at
> org.apache.tamaya.core.internal.OSGIServiceContext.getServices(OSGIServiceContext.java:108)
> ~[?:?]
>   at
> org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder.getDefaultPropertyConverters(DefaultConfigurationContextBuilder.java:378)
> ~[?:?]
>   at
> org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder.addDefaultPropertyConverters(DefaultConfigurationContextBuilder.java:171)
> ~[?:?]
>   at
> 

Apache Tamaya and pax-exam problems

2018-06-22 Thread Dominik Marciniszyn
Hi,
I'm trying to test my bundle which uses apache tamaya. I'm using recommended
technology for this pax-exam.
I created the abstract class which setup karaf test container based on
pax-exam documentation. Problem shows up when
I'm trying to test method which uses apache tamaya. Logs shows me an error:

2018-06-22T10:34:38,292 | ERROR | pool-1-thread-2  | BootFeaturesInstaller  
 
| 10 - org.apache.karaf.features.core - 4.1.5 | Error installing boot
features
org.apache.karaf.features.internal.util.MultiException: Error restarting
bundles:
Exception in org.apache.tamaya.core.OSGIActivator.start() of bundle
org.apache.tamaya.core.
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:902)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1248)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1(FeaturesServiceImpl.java:1147)
~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
Suppressed: org.osgi.framework.BundleException: Exception in
org.apache.tamaya.core.OSGIActivator.start() of bundle
org.apache.tamaya.core.
at
org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:800)
~[?:?]
at
org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:729)
~[?:?]
at
org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:933)
~[?:?]
at
org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:309)
~[?:?]
at org.eclipse.osgi.container.Module.doStart(Module.java:581) 
~[?:?]
at org.eclipse.osgi.container.Module.start(Module.java:449) 
~[?:?]
at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:383)
~[?:?]
at
org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:402)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.startBundle(FeaturesServiceImpl.java:1361)
~[?:?]
at
org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:894)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1248)
~[?:?]
at
org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$1(FeaturesServiceImpl.java:1147)
~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
[?:?]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[?:?]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.util.ServiceConfigurationError:
org.apache.tamaya.spi.PropertyConverter: Provider
org.apache.tamaya.collections.ArrayListConverter not a subtype
at java.util.ServiceLoader.fail(ServiceLoader.java:239) ~[?:?]
at java.util.ServiceLoader.access$300(ServiceLoader.java:185) 
~[?:?]
at
java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
~[?:?]
at 
java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
~[?:?]
at java.util.ServiceLoader$1.next(ServiceLoader.java:480) ~[?:?]
at
org.apache.tamaya.core.internal.OSGIServiceContext.getServices(OSGIServiceContext.java:108)
~[?:?]
at
org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder.getDefaultPropertyConverters(DefaultConfigurationContextBuilder.java:378)
~[?:?]
at
org.apache.tamaya.spisupport.DefaultConfigurationContextBuilder.addDefaultPropertyConverters(DefaultConfigurationContextBuilder.java:171)
~[?:?]
at
org.apache.tamaya.spisupport.DefaultConfigurationBuilder.addDefaultPropertyConverters(DefaultConfigurationBuilder.java:103)
~[?:?]
at 
org.apache.tamaya.core.OSGIActivator.start(OSGIActivator.java:52)
~[?:?]
at
org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:779)
~[?:?]
at
org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)
~[?:?]
at java.security.AccessController.doPrivileged(Native Method) 
~[?:?]
at
org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:772)
~[?:?]
... 15 more

I've