Just to be sure, I totally remove the whole "bundle-example" project, 
leaving only the "bundle-example-impl" (I also removed the artifact from my 
maven repository just to be sure).
Pax exam still gives the same error though. :(

On Thursday, April 6, 2017 at 3:52:28 PM UTC+2, Massimo Bono wrote:
>
> Ehm... that one is totallly my fault. In my first test I separated 
> interface from module implementation. Since I couldn't test it, I thought 
> simplifying the project might solve the issue. 
> As you can see in *microsi-root/pom.xml* that project is *not used  at 
> all*:
>
> <modules>
>
> <!-- <module>examples/bundle-example</module>-->
> <module>examples/bundle-example-impl</module>
> <module>examples/itest-bundle-example</module>
>
> </modules>
>
> Clearly, even removing the interface bundle and moving the 
> BundleExample.java into bundle-example-impl project didn't solve the issue. 
> :(
> Do you have another idea of what I might be missing?
> On Thursday, April 6, 2017 at 3:25:36 PM UTC+2, Christian Schneider wrote:
>>
>> No .. that looks fine .. I guess I was just blind :-)
>>
>> I think the the problem is about where the service interface comes from. 
>> The BundleExample interface is present in the bundle-example bundle as well 
>> as in the bundle-example-impl bundle.
>> The service is created based on the interface from bundle-example-impl 
>> but the itest depends on the bundle-example bundle. So I guess they see 
>> different interfaces.
>>
>>
>> Christian
>>
>> On 06.04.2017 15:00, Massimo Bono wrote:
>>
>> I thought by installing SCR bundle I was be able to exploit DS service. 
>>
>> Are you telling me that:
>>
>> CoreOptions.mavenBundle().groupId("org.apache.felix").artifactId("
>>> org.apache.felix.scr").version("2.0.8"),
>>
>>
>> is not sufficient to exploit DS? 
>>
>> On Thursday, April 6, 2017 at 2:25:44 PM UTC+2, Christian Schneider 
>> wrote: 
>>>
>>> In your BundleExample impl you use declarative services but you do not 
>>> install the scr bundle in your test config. So your bundle is installed but 
>>> the @Component will not do anything.
>>> So TestBundleExayou can not inject the service because there is no such 
>>> service published in the runtime.
>>>
>>> Christian
>>>
>>> On 06.04.2017 14:14, Massimo Bono wrote:
>>>
>>> Hello to all! 
>>>
>>> I'm learning OSGi technology and I discover pax exam 4.
>>>
>>> I've tried to follow the guide lines at Getting Started with OSGi Tests 
>>> <https://ops4j1.jira.com/wiki/display/PAXEXAM4/Getting+Started+with+OSGi+Tests>
>>>  and OSGi Containers 
>>> <https://ops4j1.jira.com/wiki/display/PAXEXAM4/OSGi+Containers>. 
>>> However, it seems I can't start the testing.
>>> The error is the following one:
>>>
>>> simpleGreetingImplCheck(com.massimobono.microsi.examples.bundleexample.TestBundleExampleImpl):
>>>  
>>>> gave up waiting for service 
>>>> com.massimobono.microsi.examples.bundleexample.BundleExample
>>>> test(com.massimobono.microsi.examples.bundleexample.TestBundleExampleImpl):
>>>>  
>>>> gave up waiting for service 
>>>> com.massimobono.microsi.examples.bundleexample.BundleExample
>>>
>>>
>>> It seems that pax exam starts correctly, but fails to inject 
>>> bundle-example (a "hello world" bundle I'm testing).
>>>
>>> I'm putting all the source code here 
>>> <https://github.com/Koldar/pax-exam-test>.
>>> Furthermore, here some additional information:
>>>
>>>
>>>    1. I'm using Java 1.8.0_121;
>>>    2. The OSGi implementation chosen is 5.6.2; 
>>>    3. I'm using maven and I'm using the one available via m2e Eclipse 
>>>    plugin (m2e version 1.7); 
>>>    4. Eclipse version is 4.6.0 (Neon); 
>>>    5. Pax exam version is 4; 
>>>
>>> If you look at the POM of the test (itest-bundle-example), you'll notice 
>>> I've added other dependencies aside those cite in Osgi Containers 
>>> <https://ops4j1.jira.com/wiki/display/PAXEXAM4/OSGi+Containers>. I've 
>>> added them because I got other errors before getting stuck on the "gave up 
>>> waiting" one.
>>>
>>>
>>>    - *org.ops4j.pax.exam:pax-exam-container-native:4.10.0*: I've added 
>>>    it because otherwise Pax complained with "No TestContainer 
>>> implementation 
>>>    in Classpath"; 
>>>    - 
>>>    - *org.ops4j.pax.exam:pax-exam-link-assembly:4.10.0*: I've added it 
>>>    because otherwise Pax complained with "Problem starting test container"; 
>>>
>>>
>>> If you look at the log maven generates (see attachment maven.log) you'll 
>>> see that the platform correctly *resolve and install* my bundle:
>>>
>>> 14:05:05.895 [main] DEBUG org.ops4j.pax.url.mvn.internal.Connection - 
>>> *Resolving 
>>> *
>>> [mvn:com.massimobono.microsi.examples/bundle-example-impl/0.0.1-SNAPSHOT]
>>> 14:05:05.897 [main] DEBUG 
>>> shaded.org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider - 
>>> Using manager PaxLocalRepositoryManager with priority 0.0 for 
>>> E:\Users\massi\.m2\repository
>>> 14:05:05.919 [main] DEBUG 
>>> org.ops4j.pax.url.mvn.internal.AetherBasedResolver - *Resolved 
>>> *(com.massimobono.microsi.examples:bundle-example-impl:jar:0.0.1-SNAPSHOT) 
>>> as 
>>> E:\Users\massi\.m2\repository\com\massimobono\microsi\examples\bundle-example-impl\0.0.1-SNAPSHOT\bundle-example-impl-0.0.1-SNAPSHOT.jar
>>> 14:05:05.922 [main] DEBUG 
>>> org.ops4j.pax.exam.nat.internal.NativeTestContainer - + *Install *(start@3) 
>>> MavenArtifactUrlReference{groupId='com.massimobono.microsi.examples', 
>>> artifactId='bundle-example-impl', version='0.0.1-SNAPSHOT', type='null'}
>>>
>>> If I comment out the "@Inject" annotation, everything works, so I think 
>>> I configured wrongly pax exam.
>>>
>>> Waiting for any kind reply!
>>>
>>> -- 
>>> -- 
>>> ------------------
>>> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>>>
>>> --- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "OPS4J" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to ops4j+un...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>>
>>>
>>> -- 
>>> Christian Schneiderhttp://www.liquid-reality.de
>>>
>>> Open Source Architecthttp://www.talend.com
>>>
>>> -- 
>> -- 
>> ------------------
>> OPS4J - http://www.ops4j.org - op...@googlegroups.com
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "OPS4J" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to ops4j+un...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>> -- 
>> Christian Schneiderhttp://www.liquid-reality.de
>>
>> Open Source Architecthttp://www.talend.com
>>
>>

-- 
-- 
------------------
OPS4J - http://www.ops4j.org - ops4j@googlegroups.com

--- 
You received this message because you are subscribed to the Google Groups 
"OPS4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to ops4j+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to