-
1. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
jrantav Dec 18, 2012 7:25 AM (in response to ralfoeldi)This was discussed in (among other things) this thread: https://community.jboss.org/thread/177379?tstart=0
Summary from there:
Yes, 7.1.1 way no longer works.
With the change you've done it should work, but it is recommended to use valid OSGi manifests.
-
2. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
ralfoeldi Dec 18, 2012 7:40 AM (in response to jrantav)Hi Jarkko,
thanks for the answer. I usually do search before posting a question and have read the thread and it does not solve the problem.
As for your suggestion to use a valid OSGI Manifest: how?
If I deploy the EJB Jar with a valid OSGi manifest inside of an EAR file, it gets deployed as an OSGi Bundle, but all SLSB, annotations, etc. are not recognized and not deployed.
I need the SLSB, EntityManagers etc. for transaction handling. Otherwise I could dump JBoss and use Felix.
Does anybody have a working, real world example (sorry, the test cases don't do it) of a Maven POM/build that deploys an EAR that needs access to OSGi Bundles?
Greetings from Switzerland
Rainer
-
3. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
jrantav Dec 18, 2012 8:23 AM (in response to ralfoeldi)Hi,
This is my own test code that does that, and works for 7.2:
.ejb pom: https://github.com/eis/jboss-7.2-osgi-blueprint-gemini-poc/blob/master/noosgi-ejb/pom.xml
.war pom: https://github.com/eis/jboss-7.2-osgi-blueprint-gemini-poc/blob/master/osgi-web-app-ejb/pom.xml
I am deploying a stateless session bean in a separate module (with OSGi manifest), and annotations are normally recognized. EJB is in turn referring to OSGi service.
-Jarkko
-
4. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
ralfoeldi Dec 18, 2012 8:38 AM (in response to jrantav)Hi Jarkko,
thanks for the code. I'll have to look into it tommorrow. Too much christmas shopping to do today :-)
Greetings from Bern
Rainer
-
5. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
thomas.diesler Dec 21, 2012 4:49 AM (in response to ralfoeldi)Here is the theory ...
Any deployment in AS7 has a deployment name which can be referenced from a Dependencies clause in the Manifest. This would be hard-wired modularity with jboss-modules propriatary syntax. In OSGi terminology, it would be Require-Bundle sematics. In 7.2.x we removed the bundle version from the generated deployment name, which unifies bundle deployments with any other deployment name. The module reference in the Dependencies clause should still work as long as you give it the right deployment name.
In 7.2.x we also unified the deployment unit (DU) processing such that it should no longer make a difference from that subsystem processing point of view whether a deployment is an OSGi bundle or not. Specifically, we only branch out in the deployment unit processor (DUP) chain when the module dependencies need to be determined and the actual module (which is essentially the ClassLoader) is created. Once the Module/ClassLoader is there, processing of the DU should continue regardless of the deployment type.
Rainer, I'm interested in your use case - perhaps we can work together in the new year to get this sorted. Ultimately it should be possible to add OSGi modularity/services to any deployment type that is supported in AS7.
-
6. Re: JBoss 7.2.0 ALPHA1 - Acessing OSGi Bundles from EJB/EAR
ralfoeldi Jan 15, 2013 6:07 AM (in response to thomas.diesler)Hi Thomas,
long, long ago (2004) we built a "OSGi inside Websphere" system that allowed us to configure a service stack depending on user identity. Think different tax codes, rates, compliance rules, etc. for different countries. User A got a different stack, than User B. The overall application just "pulled" the appropriate service impls or instances. If lucky, adding a country (market) could be reduced to adding a new service configuration.
Right now I have a project where I would like to use some of these concepts. Generic data services (User A gets data from legacy system D, User B gets data from standard JPA impl.), authentication/authorization with the same flexibility etc.
After a too long Christmas/New Year/Skiing break :-) I'll see if I can get this up and running.
Greetings from Zürich
Rainer