Re: Startup timing Windows vs. Mac

2018-11-20 Thread Oleg Cohen
Hi JB,

Thank you for the clarification. I think the bundle load time on Windows was 
affected by a large number of services in the component. I don’t know exactly 
the reason, but how the OSGi container processes the bundle on startup was much 
slower on Windows because I had a large number of services. I reworked my 
architecture to reduce the number of service components and the startup time 
went down quite a bit.

Thank you,
Oleg 

> On Nov 20, 2018, at 11:55 PM, Jean-Baptiste Onofré  wrote:
> 
> Hi Oleg,
> 
> bundle:update is roughly equivalent to bundle:stop, bundle:uninstall,
> bundle:install, bundle:start. It gets the "new" bundle version from the
> bundle location (that you can see with bundle:list -l).
> 
> Nothing suspicious in the bundle activator that could explain it takes
> time to stop/start on windows ?
> 
> Regards
> JB
> 
> On 21/11/2018 04:36, Oleg Cohen wrote:
>> Hi JB,
>> 
>> I don’t think the antivirus is an issue in my case.
>> 
>> I did disable Windows Defender. My test case is with a single bundle
>> that is installed via this command:
>> 
>> install reference:file://$eclipse_projects/sample.bundle.a 
>> 
>> > >
>> 
>> The location $eclipse_projects points to the local file system where
>> Eclipse projects for bundles reside.
>> 
>> From Active state I run command *update sample.bundle.a*
>> 
>> I see that the entire bundle start part of the update consists of two
>> parts. Right after the activation process starts I see a delay. No
>> logging occurs, even with the log level set to TRACE. Then log output
>> starts showing initialization of my bundle’s components/services.
>> 
>> The latter part runs quick on both Windows and Mac and take about 1 sec.
>> However, the former part that is silent and takes about 5 sec on Mac and
>> 20 sec on Windows. So, 4 times slower on Windows. 
>> 
>> What happens with the bundle at the start? Are files copied? I do
>> suspect it has something to do with the file IO.
>> 
>> Thank you,
>> Oleg
>> 
>> 
>>> On Nov 20, 2018, at 10:57 AM, Jean-Baptiste Onofré >> >> wrote:
>>> 
>>> Yes, first, please try with the antivirus disabled.
>>> 
>>> Regards
>>> JB
>>> 
>>> On 20/11/2018 16:26, Oleg Cohen wrote:
 Hi JB,
 
 Yes, it is Windows. It is exactly the same set of bundles and the
 same Maven repository. Yes, there is Antivirus. I can try testing
 with disabling it temporarily.
 
 How can I see what is being resolved/checked/updated/downloaded? I do
 notice that Karaf has these long pauses. I am sure I can run pretty
 much against the local repo.
 
 I would appreciate any pointers on how to speed up the startup!
 
 Best regards,
 Oleg
 
> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré  
> >> wrote:
> 
> Hi Oleg,
> 
> So Windows is longer than Mac (not surprising ;)).
> 
> Did you check in term of bundles resolution ? Do the two systems use the
> same Maven repository and network to resolve the artifacts.
> 
> I already saw such issue due to the Windows antivirus: it verified any
> artifacts downloaded by Karaf and it takes time.
> 
> Do you have antivirus on the Windows system ?
> 
> Regards
> JB
> 
> On 19/11/2018 21:12, Oleg Cohen wrote:
>> Greetings,
>> 
>> I have two systems: one Mac and one Windows. I have noticed that
>> exactly the same application with a number of bundles, both 3rd
>> party and my own, take significantly longer (1.5 vs 6 mins) on
>> Windows compared to Mac. Both systems are pretty powerful and have
>> similar resources. I was wondering if anybody has noticed the same.
>> What would be the best way to analyze the startup performance and
>> identify bottlenecks?
>> 
>> Thank you,
>> Oleg
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org  
> >
> http://blog.nanthrax.net 
> Talend - http://www.talend.com 
 
>>> 
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbono...@apache.org  
>>> >
>>> http://blog.nanthrax.net 
>>> Talend - http://www.talend.com 
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org 
> http://blog.nanthrax.net 
> Talend - http://www.talend.com 


Re: Startup timing Windows vs. Mac

2018-11-20 Thread Jean-Baptiste Onofré
Hi Oleg,

bundle:update is roughly equivalent to bundle:stop, bundle:uninstall,
bundle:install, bundle:start. It gets the "new" bundle version from the
bundle location (that you can see with bundle:list -l).

Nothing suspicious in the bundle activator that could explain it takes
time to stop/start on windows ?

Regards
JB

On 21/11/2018 04:36, Oleg Cohen wrote:
> Hi JB,
> 
> I don’t think the antivirus is an issue in my case.
> 
> I did disable Windows Defender. My test case is with a single bundle
> that is installed via this command:
> 
> install reference:file://$eclipse_projects/sample.bundle.a
> 
> 
> The location $eclipse_projects points to the local file system where
> Eclipse projects for bundles reside.
> 
> From Active state I run command *update sample.bundle.a*
> 
> I see that the entire bundle start part of the update consists of two
> parts. Right after the activation process starts I see a delay. No
> logging occurs, even with the log level set to TRACE. Then log output
> starts showing initialization of my bundle’s components/services.
> 
> The latter part runs quick on both Windows and Mac and take about 1 sec.
> However, the former part that is silent and takes about 5 sec on Mac and
> 20 sec on Windows. So, 4 times slower on Windows. 
> 
> What happens with the bundle at the start? Are files copied? I do
> suspect it has something to do with the file IO.
> 
> Thank you,
> Oleg
> 
> 
>> On Nov 20, 2018, at 10:57 AM, Jean-Baptiste Onofré > > wrote:
>>
>> Yes, first, please try with the antivirus disabled.
>>
>> Regards
>> JB
>>
>> On 20/11/2018 16:26, Oleg Cohen wrote:
>>> Hi JB,
>>>
>>> Yes, it is Windows. It is exactly the same set of bundles and the
>>> same Maven repository. Yes, there is Antivirus. I can try testing
>>> with disabling it temporarily.
>>>
>>> How can I see what is being resolved/checked/updated/downloaded? I do
>>> notice that Karaf has these long pauses. I am sure I can run pretty
>>> much against the local repo.
>>>
>>> I would appreciate any pointers on how to speed up the startup!
>>>
>>> Best regards,
>>> Oleg
>>>
 On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré >>> > wrote:

 Hi Oleg,

 So Windows is longer than Mac (not surprising ;)).

 Did you check in term of bundles resolution ? Do the two systems use the
 same Maven repository and network to resolve the artifacts.

 I already saw such issue due to the Windows antivirus: it verified any
 artifacts downloaded by Karaf and it takes time.

 Do you have antivirus on the Windows system ?

 Regards
 JB

 On 19/11/2018 21:12, Oleg Cohen wrote:
> Greetings,
>
> I have two systems: one Mac and one Windows. I have noticed that
> exactly the same application with a number of bundles, both 3rd
> party and my own, take significantly longer (1.5 vs 6 mins) on
> Windows compared to Mac. Both systems are pretty powerful and have
> similar resources. I was wondering if anybody has noticed the same.
> What would be the best way to analyze the startup performance and
> identify bottlenecks?
>
> Thank you,
> Oleg
>

 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org 
 http://blog.nanthrax.net
 Talend - http://www.talend.com
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbono...@apache.org 
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Startup timing Windows vs. Mac

2018-11-20 Thread Oleg Cohen
I’d like to add that this bundle has many classes and a large number of 
services.

> On Nov 20, 2018, at 10:36 PM, Oleg Cohen  wrote:
> 
> Hi JB,
> 
> I don’t think the antivirus is an issue in my case.
> 
> I did disable Windows Defender. My test case is with a single bundle that is 
> installed via this command:
> 
> install reference:file://$eclipse_projects/sample.bundle.a 
> 
> 
> The location $eclipse_projects points to the local file system where Eclipse 
> projects for bundles reside.
> 
> From Active state I run command update sample.bundle.a
> 
> I see that the entire bundle start part of the update consists of two parts. 
> Right after the activation process starts I see a delay. No logging occurs, 
> even with the log level set to TRACE. Then log output starts showing 
> initialization of my bundle’s components/services.
> 
> The latter part runs quick on both Windows and Mac and take about 1 sec. 
> However, the former part that is silent and takes about 5 sec on Mac and 20 
> sec on Windows. So, 4 times slower on Windows. 
> 
> What happens with the bundle at the start? Are files copied? I do suspect it 
> has something to do with the file IO.
> 
> Thank you,
> Oleg
> 
> 
>> On Nov 20, 2018, at 10:57 AM, Jean-Baptiste Onofré > > wrote:
>> 
>> Yes, first, please try with the antivirus disabled.
>> 
>> Regards
>> JB
>> 
>> On 20/11/2018 16:26, Oleg Cohen wrote:
>>> Hi JB,
>>> 
>>> Yes, it is Windows. It is exactly the same set of bundles and the same 
>>> Maven repository. Yes, there is Antivirus. I can try testing with disabling 
>>> it temporarily. 
>>> 
>>> How can I see what is being resolved/checked/updated/downloaded? I do 
>>> notice that Karaf has these long pauses. I am sure I can run pretty much 
>>> against the local repo.
>>> 
>>> I would appreciate any pointers on how to speed up the startup!
>>> 
>>> Best regards,
>>> Oleg
>>> 
 On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré >>> > wrote:
 
 Hi Oleg,
 
 So Windows is longer than Mac (not surprising ;)).
 
 Did you check in term of bundles resolution ? Do the two systems use the
 same Maven repository and network to resolve the artifacts.
 
 I already saw such issue due to the Windows antivirus: it verified any
 artifacts downloaded by Karaf and it takes time.
 
 Do you have antivirus on the Windows system ?
 
 Regards
 JB
 
 On 19/11/2018 21:12, Oleg Cohen wrote:
> Greetings,
> 
> I have two systems: one Mac and one Windows. I have noticed that exactly 
> the same application with a number of bundles, both 3rd party and my own, 
> take significantly longer (1.5 vs 6 mins) on Windows compared to Mac. 
> Both systems are pretty powerful and have similar resources. I was 
> wondering if anybody has noticed the same. What would be the best way to 
> analyze the startup performance and identify bottlenecks?
> 
> Thank you,
> Oleg
> 
 
 -- 
 Jean-Baptiste Onofré
 jbono...@apache.org 
 http://blog.nanthrax.net
 Talend - http://www.talend.com
>>> 
>> 
>> -- 
>> Jean-Baptiste Onofré
>> jbono...@apache.org 
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 



Re: Startup timing Windows vs. Mac

2018-11-20 Thread Oleg Cohen
Hi JB,

I don’t think the antivirus is an issue in my case.

I did disable Windows Defender. My test case is with a single bundle that is 
installed via this command:

install reference:file://$eclipse_projects/sample.bundle.a 


The location $eclipse_projects points to the local file system where Eclipse 
projects for bundles reside.

From Active state I run command update sample.bundle.a

I see that the entire bundle start part of the update consists of two parts. 
Right after the activation process starts I see a delay. No logging occurs, 
even with the log level set to TRACE. Then log output starts showing 
initialization of my bundle’s components/services.

The latter part runs quick on both Windows and Mac and take about 1 sec. 
However, the former part that is silent and takes about 5 sec on Mac and 20 sec 
on Windows. So, 4 times slower on Windows. 

What happens with the bundle at the start? Are files copied? I do suspect it 
has something to do with the file IO.

Thank you,
Oleg


> On Nov 20, 2018, at 10:57 AM, Jean-Baptiste Onofré  wrote:
> 
> Yes, first, please try with the antivirus disabled.
> 
> Regards
> JB
> 
> On 20/11/2018 16:26, Oleg Cohen wrote:
>> Hi JB,
>> 
>> Yes, it is Windows. It is exactly the same set of bundles and the same Maven 
>> repository. Yes, there is Antivirus. I can try testing with disabling it 
>> temporarily. 
>> 
>> How can I see what is being resolved/checked/updated/downloaded? I do notice 
>> that Karaf has these long pauses. I am sure I can run pretty much against 
>> the local repo.
>> 
>> I would appreciate any pointers on how to speed up the startup!
>> 
>> Best regards,
>> Oleg
>> 
>>> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré  
>>> wrote:
>>> 
>>> Hi Oleg,
>>> 
>>> So Windows is longer than Mac (not surprising ;)).
>>> 
>>> Did you check in term of bundles resolution ? Do the two systems use the
>>> same Maven repository and network to resolve the artifacts.
>>> 
>>> I already saw such issue due to the Windows antivirus: it verified any
>>> artifacts downloaded by Karaf and it takes time.
>>> 
>>> Do you have antivirus on the Windows system ?
>>> 
>>> Regards
>>> JB
>>> 
>>> On 19/11/2018 21:12, Oleg Cohen wrote:
 Greetings,
 
 I have two systems: one Mac and one Windows. I have noticed that exactly 
 the same application with a number of bundles, both 3rd party and my own, 
 take significantly longer (1.5 vs 6 mins) on Windows compared to Mac. Both 
 systems are pretty powerful and have similar resources. I was wondering if 
 anybody has noticed the same. What would be the best way to analyze the 
 startup performance and identify bottlenecks?
 
 Thank you,
 Oleg
 
>>> 
>>> -- 
>>> Jean-Baptiste Onofré
>>> jbono...@apache.org
>>> http://blog.nanthrax.net
>>> Talend - http://www.talend.com
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



Re: Blueprint, DS and CDI State of the Art...

2018-11-20 Thread David Jencks
As I noted previously the OSGI CDI reference implementation is at Apache Aries 
and I believe differs significantly from Guillaume’s implementation in 
philosophy.

David Jencks 

Sent from my iPhone

> On Nov 20, 2018, at 10:14 AM, Ranx  wrote:
> 
> It appears that Fuse 7 is supporting PAX CDI and that changes my assessment
> of all this. 
> 
> The OSGi Alliance has been positively glacial in approving the specification
> (six years now) but that appears to be about to change. Hopefully they adopt
> Guillaume's implementation as the reference standard and when the final spec
> drops a few tweaks are made to PAX CDI for final.
> 
> I'm not sure why it has taken so long and having CDI with DS for service
> annotation while also being able to use the standard annotations for
> internal bundle wiring is long past due. 
> 
> That Red Hat is supporting CDI means I don't have to worry about
> recommending it to my clients. That it appears that the OSGi Alliance is
> about to sign off on the standard is even more exciting. 
> 
> 
> 
> --
> Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Running Camel in a Karaf OSGi container

2018-11-20 Thread Ranx
The Camel Java DSL works fine with Blueprint in Karaf. One simply bootstraps
the RouteBuilder in Blueprint and then references in the Camel context of
the Blueprint file. I think the problem is that documentation is inadequate.
And, as Camel, Karaf, etc. changed over time documentation became krufty.

Essentially if one limits the use of Blueprint to configuration, OSGi
services export and reference, and bootstrap of Camel routes it is just
fine.

As soon as one starts using XML as a programming language the problems
begin.



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


Re: Blueprint, DS and CDI State of the Art...

2018-11-20 Thread Ranx
It appears that Fuse 7 is supporting PAX CDI and that changes my assessment
of all this. 

The OSGi Alliance has been positively glacial in approving the specification
(six years now) but that appears to be about to change. Hopefully they adopt
Guillaume's implementation as the reference standard and when the final spec
drops a few tweaks are made to PAX CDI for final.

I'm not sure why it has taken so long and having CDI with DS for service
annotation while also being able to use the standard annotations for
internal bundle wiring is long past due. 

That Red Hat is supporting CDI means I don't have to worry about
recommending it to my clients. That it appears that the OSGi Alliance is
about to sign off on the standard is even more exciting. 



--
Sent from: http://karaf.922171.n3.nabble.com/Karaf-User-f930749.html


RE: Startup timing Windows vs. Mac

2018-11-20 Thread Leschke, Scott
I can't speak to Karaf explicitly but there have been huge issues with both 
antivirus and disk encryption overhead in the Windows environment here.  
Encryption can really slow things down. All our laptops and desktops are 
encrypted on the fly.

While most have SSDs now, I have an old desktop that I no longer use with a 
hard drive that became effectively unusable.

-Original Message-
From: Jean-Baptiste Onofré [mailto:j...@nanthrax.net] 
Sent: Tuesday, November 20, 2018 9:57 AM
To: user@karaf.apache.org
Subject: Re: Startup timing Windows vs. Mac

Yes, first, please try with the antivirus disabled.

Regards
JB

On 20/11/2018 16:26, Oleg Cohen wrote:
> Hi JB,
> 
> Yes, it is Windows. It is exactly the same set of bundles and the same Maven 
> repository. Yes, there is Antivirus. I can try testing with disabling it 
> temporarily. 
> 
> How can I see what is being resolved/checked/updated/downloaded? I do notice 
> that Karaf has these long pauses. I am sure I can run pretty much against the 
> local repo.
> 
> I would appreciate any pointers on how to speed up the startup!
> 
> Best regards,
> Oleg
> 
>> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré  wrote:
>>
>> Hi Oleg,
>>
>> So Windows is longer than Mac (not surprising ;)).
>>
>> Did you check in term of bundles resolution ? Do the two systems use the
>> same Maven repository and network to resolve the artifacts.
>>
>> I already saw such issue due to the Windows antivirus: it verified any
>> artifacts downloaded by Karaf and it takes time.
>>
>> Do you have antivirus on the Windows system ?
>>
>> Regards
>> JB
>>
>> On 19/11/2018 21:12, Oleg Cohen wrote:
>>> Greetings,
>>>
>>> I have two systems: one Mac and one Windows. I have noticed that exactly 
>>> the same application with a number of bundles, both 3rd party and my own, 
>>> take significantly longer (1.5 vs 6 mins) on Windows compared to Mac. Both 
>>> systems are pretty powerful and have similar resources. I was wondering if 
>>> anybody has noticed the same. What would be the best way to analyze the 
>>> startup performance and identify bottlenecks?
>>>
>>> Thank you,
>>> Oleg
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Startup timing Windows vs. Mac

2018-11-20 Thread Jean-Baptiste Onofré
Yes, first, please try with the antivirus disabled.

Regards
JB

On 20/11/2018 16:26, Oleg Cohen wrote:
> Hi JB,
> 
> Yes, it is Windows. It is exactly the same set of bundles and the same Maven 
> repository. Yes, there is Antivirus. I can try testing with disabling it 
> temporarily. 
> 
> How can I see what is being resolved/checked/updated/downloaded? I do notice 
> that Karaf has these long pauses. I am sure I can run pretty much against the 
> local repo.
> 
> I would appreciate any pointers on how to speed up the startup!
> 
> Best regards,
> Oleg
> 
>> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré  wrote:
>>
>> Hi Oleg,
>>
>> So Windows is longer than Mac (not surprising ;)).
>>
>> Did you check in term of bundles resolution ? Do the two systems use the
>> same Maven repository and network to resolve the artifacts.
>>
>> I already saw such issue due to the Windows antivirus: it verified any
>> artifacts downloaded by Karaf and it takes time.
>>
>> Do you have antivirus on the Windows system ?
>>
>> Regards
>> JB
>>
>> On 19/11/2018 21:12, Oleg Cohen wrote:
>>> Greetings,
>>>
>>> I have two systems: one Mac and one Windows. I have noticed that exactly 
>>> the same application with a number of bundles, both 3rd party and my own, 
>>> take significantly longer (1.5 vs 6 mins) on Windows compared to Mac. Both 
>>> systems are pretty powerful and have similar resources. I was wondering if 
>>> anybody has noticed the same. What would be the best way to analyze the 
>>> startup performance and identify bottlenecks?
>>>
>>> Thank you,
>>> Oleg
>>>
>>
>> -- 
>> Jean-Baptiste Onofré
>> jbono...@apache.org
>> http://blog.nanthrax.net
>> Talend - http://www.talend.com
> 

-- 
Jean-Baptiste Onofré
jbono...@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com


Re: Startup timing Windows vs. Mac

2018-11-20 Thread Oleg Cohen
Hi JB,

Yes, it is Windows. It is exactly the same set of bundles and the same Maven 
repository. Yes, there is Antivirus. I can try testing with disabling it 
temporarily. 

How can I see what is being resolved/checked/updated/downloaded? I do notice 
that Karaf has these long pauses. I am sure I can run pretty much against the 
local repo.

I would appreciate any pointers on how to speed up the startup!

Best regards,
Oleg

> On Nov 20, 2018, at 12:12 AM, Jean-Baptiste Onofré  wrote:
> 
> Hi Oleg,
> 
> So Windows is longer than Mac (not surprising ;)).
> 
> Did you check in term of bundles resolution ? Do the two systems use the
> same Maven repository and network to resolve the artifacts.
> 
> I already saw such issue due to the Windows antivirus: it verified any
> artifacts downloaded by Karaf and it takes time.
> 
> Do you have antivirus on the Windows system ?
> 
> Regards
> JB
> 
> On 19/11/2018 21:12, Oleg Cohen wrote:
>> Greetings,
>> 
>> I have two systems: one Mac and one Windows. I have noticed that exactly the 
>> same application with a number of bundles, both 3rd party and my own, take 
>> significantly longer (1.5 vs 6 mins) on Windows compared to Mac. Both 
>> systems are pretty powerful and have similar resources. I was wondering if 
>> anybody has noticed the same. What would be the best way to analyze the 
>> startup performance and identify bottlenecks?
>> 
>> Thank you,
>> Oleg
>> 
> 
> -- 
> Jean-Baptiste Onofré
> jbono...@apache.org
> http://blog.nanthrax.net
> Talend - http://www.talend.com



RE: Hmm, that's new. Felix Fileinstall

2018-11-20 Thread Leschke, Scott
I'm curious if anybody else has seen the following?  Is this new and expected 
behavior?

Scott

From: Leschke, Scott [mailto:slesc...@medline.com]
Sent: Friday, November 16, 2018 3:46 PM
To: user@karaf.apache.org
Subject: Hmm, that's new. Felix Fileinstall

Question.  I've been running v 4.2.1 under Java 10.0.2 for a while in my test 
environment and everything has been working as expected.  Recently though, it 
appeared that fileinstall wasn't picking up that .jar and .cfg files we being 
changed via hot deploy.

I tried various things to get it to work but finally thought I'd do a fresh 
install of 4.2.1 to see if that might clear things up. To install, I run a 
PowerShell script that unzips the apache-karaf-4.2.1.zip file, installs the 
features I need and then I change where Karaf's hot deploy folder is by 
replacing etc/org.apache.felix.fileinstall-deploy.cfg with my own file, 
org.apache.felix.fileinstall-bam.cfg.

My application deploy folder is a hierarchy rooted at the folder "BAM" 
(Business Activity Monitoring) that has 3 subfolders in it,
runtime (for bundles (jars) the app is dependent on), datasources (where I keep 
the .cfgs that contain the org.ops4j.datasource-*.cfg files the app needs), and 
systems which is another folder hierarchy containing .cfg files and subfolders 
containing files associated with a system.

After the install, I'm seeing some "pseudo" bundles with the names and versions 
shown below.

C__BAM_runtime   0.0.0
C__BAM_datasources   0.0.0
Wrap_jardir_C__BAM_systems 0

I've rerun the install a few times with some varying results.  In one case, the 
last name was in line with the others and was shown as C__BAM_systems.  In 
another case, none of those bundles existed at all?  Thoughts?

Windows Server 2016 BTW.  Sorry for the copius detail but I'm trying to be 
clear as to what I'm seeing.

Scott


Pax Exam + Karaf + Conditional Packages

2018-11-20 Thread Massimo Bono
Hello,

I want to test an OSGi bundle built with bnd using conditional-packages via
pax-exam. The conditional-package allows the bundle to use some utility
classes (e.g., like from https://stackoverflow.com/a/39500621/1887602)

The test is setup like the following:

@Test
public void exampleTest() {
UtilityClass.foo(this.wiredService)
}

where:
 - wiredService is a service which has been injected via @javax.Inject;
 - UtilityClass is the class which has been bundled in the jar with the
conditional-package.

The test container I'm using is Karaf.

When testing the application, Osgi alerts me that it cannot find the class
"x.y.z.UtilityClass".

So my question is: how can I retrieve conditional-package classes using
pax-exam?

Here's the (anonymized) stack trace:

java.lang.ClassNotFoundException:  x.y.z.UtilityClass  not found by
> PAXEXAM-PROBE-1ac529cd-015d-4378-a3fa-f4cef4789ef8 [75]
> at
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1639)
> at
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
> at
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2053)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> at  x.y.z.TestOsgiCommon.test00(TestOsgiCommon.java:271)
> 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:498)
> 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.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at
> org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runLeafWithRetry(ContainerTestRunner.java:97)
> at
> org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChildWithRetry(ContainerTestRunner.java:84)
> at
> org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:75)
> at
> org.ops4j.pax.exam.invoker.junit.internal.ContainerTestRunner.runChild(ContainerTestRunner.java:43)
> 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.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
> at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
> at
> org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.invokeViaJUnit(JUnitProbeInvoker.java:124)
> at
> org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.findAndInvoke(JUnitProbeInvoker.java:97)
> at
> org.ops4j.pax.exam.invoker.junit.internal.JUnitProbeInvoker.call(JUnitProbeInvoker.java:73)
> 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:498)
> at
> org.ops4j.pax.exam.rbc.internal.RemoteBundleContextImpl.remoteCall(RemoteBundleContextImpl.java:85)
> 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:498)
> at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:324)
> at sun.rmi.transport.Transport$1.run(Transport.java:200)
> at sun.rmi.transport.Transport$1.run(Transport.java:197)
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
> at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
> at
> sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:683)
> at java.security.AccessController.doPrivileged(Native Method)
> at
>