An OSGi bundle has a lifecycle of
* INSTALLED
* RESOLVED
* ACTIVE
* RESOLVED
* UNINSTALLED
The classloader is created as part of the bundle resolution phase.
Specifically, the OSGi resolver determines on the basis of OSGi metadata
a consistent wiring between the installed bundles. It is therefore
incorrect to create a jboss module definition for an OSGi bundle at
deploy time.
The fundamental question is: Are you deploying an OSGi bundle or not? If
it is an OSGi bundle, it should be treated as such (i.e. it is not an
AS7 module deployment). The OSGi enterprise spec support the notion of
OSGi web application bundles (WAB). A WAB may have file extension *.war,
it would still be a bundle deployment.
#1 Do we have an issue with the OSGi layer not handling a bundle
deployment correctly?
#2 Do we have an issue with some AS7 DUP that does not account for the
possibility that a deployment is an OSGi bundle?
DUPs that cannot handle OSGi bundles should check for the OSGI_MANIFEST
attachment
if (deploymentUnit.hasAttachment(Attachments.OSGI_MANIFEST)) {
return;
}
cheers
-thomas
On 08/21/2011 09:08 AM, Jaikiran Pai wrote:
While looking at a user reported bug in AS7, I noticed that a user
deployment can be missing a MODULE attachment. My understanding so far
was that each deployment will *always* have a MODULE attached to it. But
looking at the code, I see that some deployments are skipped while
creating and attaching the modules. Specifically, if a deployment
contains a OSGi Manifest, then the module creation and attachment is
skipped for that module
https://github.com/jbossas/jboss-as/blob/master/server/src/main/java/org/...
Why is that the case? Aren't deployments which contain OSGi Manifest
supposed to be processed by other deployers (for example a EJB
annotation processing deployer)?
-Jaikiran
_______________________________________________
jboss-as7-dev mailing list
jboss-as7-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
--
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx