lefou / pojosr

A service registry that enables OSGi style service registry programs
5 stars 2 forks source link

POJOsr does not work with Apache Aries 1.0.0 Blueprint #6

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
We have been using pojosr with success at Apache Camel. It allows our end users 
much easier to migrate and use OSGi blueprint.

For example we have a Camel Test Kit, which is JUnit based. This allows people 
to write plain junit tests for their Camel apps.

We have a camel-test-blueprint component that uses JUnit and POJOsr. So from 
end user point of view, they can test blueprint XML file apps in a very easy 
way.

This works fine with POJOSr 0.1.6 and 0.1.8 (recently upgraded). As well with 
OSGI 4.2 and 4.3.
However when we upgraded from Apache Aries 0.3 to 1.0, then it fails.

We don't get much error details. As it just hangs waiting for the CamelContext 
to be available in the service registry. Which never happens.

java.lang.RuntimeException: Gave up waiting for service 
(objectClass=org.apache.camel.CamelContext)
    at org.apache.camel.test.blueprint.CamelBlueprintHelper.getOsgiService(CamelBlueprintHelper.java:198)

When downgrading to Apache Aries 0.3, then it works again.

Will dig a bit deeper. I checked the POJOsr source code and it dont offer any 
tests of itself etc.

Original issue reported on code.google.com by claus.ib...@gmail.com on 26 Oct 2012 at 7:43

GoogleCodeExporter commented 9 years ago
Is there an easy way for me to reproduce the issue?

Original comment by karlpauls on 26 Oct 2012 at 12:21

GoogleCodeExporter commented 9 years ago
As a first thought, assuming aries 1.0 does use the new 4.3 api, it is possible 
that they use features I didn't implement. Again, if you could point me to a 
reproducible example (or send me one by mail) I can see whats going on. 

Original comment by karlpauls on 26 Oct 2012 at 12:49

GoogleCodeExporter commented 9 years ago
Yeah when i get back in the office mid next week i can zip a project that 
reproduces the issue

Original comment by claus.ib...@gmail.com on 26 Oct 2012 at 4:01

GoogleCodeExporter commented 9 years ago
You can create a new project from Maven to reproduce the issue

I am using Maven 3.0.4 and JDK 1.6

mvn archetype:generate
type "camel" to filter to only show camel related
pick the camel-archetype-blueprint
enter details for the project

cd the project
mvn install

will compile and test. This works fine with 0.3 of Aries Blueprint.
If you upgrade Aries to 1.0.0 then it hangs.

You would need to add <dependency> for aries which you can see from mvn 
dependency:tree.

I have attached a file where you can easily switch between Aries 0.3 and 1.0.0 
to reproduce the issue. Its the blue.zip file. 

Original comment by claus.ib...@gmail.com on 30 Oct 2012 at 11:00

Attachments:

GoogleCodeExporter commented 9 years ago
You need to use Camel 2.10.2 release which is the latest official release.

Original comment by claus.ib...@gmail.com on 30 Oct 2012 at 11:00

GoogleCodeExporter commented 9 years ago
Well, i can see that the test is failing. I'll try to debug it, however, it 
looks like things are working pretty much...

I can see that the message that the test is expecting is send - just not 
received or something. In fact, the debug log of camel locks exactly the same 
up to the point where it with 0.3 is enough to send one message and with 1.0.0 
five messages are send but apparently don't satisfy the test. 

Are you sure that this is a pojosr issue and not a an issue with 1.0.0 and your 
test support? Feel free to try to catch me on skype (karlpauls) if you want to 
discuss it some more. I'll try to look into it.

Original comment by karlpauls on 30 Oct 2012 at 3:41

GoogleCodeExporter commented 9 years ago

Original comment by karlpauls on 30 Oct 2012 at 3:41

GoogleCodeExporter commented 9 years ago
Ok, i have an idea what might be going on. Its related to missing 4.3 stuff - 
I'll try to get to it asap. 

Original comment by karlpauls on 31 Oct 2012 at 12:10

GoogleCodeExporter commented 9 years ago
Ah great. I have not either had time to debug what happens, but great to know 
you are on track.

Original comment by claus.ib...@gmail.com on 31 Oct 2012 at 1:12

GoogleCodeExporter commented 9 years ago
I have it working now. Test passes and my other stuff seems to work as well. 

Required to implement some new features for supporting all the 4.3 event hooks 
which I mostly ignored but aries blueprint seems to use them starting with 
1.0.0.  Took me a while to figure that out as it wasn't super easy to see what 
was going. 

I'll try to clean it up and commit it tonight or tomorrow morning. I hope you 
can test the snapshot a bit more with whatever you have but if it is working 
I'll cut a 0.2.0 release on the weekend.

Original comment by karlpauls on 31 Oct 2012 at 2:45

GoogleCodeExporter commented 9 years ago
I pushed my changes. It seems to work for me. At least the test is now passing 
with aries blueprint 1.0.0. 

Please let me know if this is working for you (in this case and maybe in the 
others you have). 

I deployed a new snapshot so you should be able to get 0.1.9-SNAPSHOT from 
maven, otherwise you can find it here:

https://oss.sonatype.org/content/repositories/snapshots/com/googlecode/pojosr/de
.kalpatec.pojosr.framework/0.1.9-SNAPSHOT/de.kalpatec.pojosr.framework-0.1.9-201
21031.213336-2.jar

Original comment by karlpauls on 31 Oct 2012 at 9:36

GoogleCodeExporter commented 9 years ago
Karl, thanks a lot for helping with this.

I tried the 0.1.9-SNAPSHOT and it works with Aries 1.0.0 and OSGi 4.2.0. I will 
try with OSGi 4.3.0 also.

Original comment by claus.ib...@gmail.com on 1 Nov 2012 at 6:27

GoogleCodeExporter commented 9 years ago
Works also with OSGi 4.3.0

Original comment by claus.ib...@gmail.com on 1 Nov 2012 at 7:31

GoogleCodeExporter commented 9 years ago
Ok, good. I'll wait until the weekend but if nothing else comes up I'll do a 
0.2.0 release which should be available next week then.

Original comment by karlpauls on 1 Nov 2012 at 12:32

GoogleCodeExporter commented 9 years ago

Original comment by karlpauls on 1 Nov 2012 at 2:11

GoogleCodeExporter commented 9 years ago

Original comment by karlpauls on 4 Nov 2012 at 8:08