Invalid assumption across most subsystem deployments

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Invalid assumption across most subsystem deployments

Thomas Diesler
Folks,

here is a friendly reminder that your DUPs must take OSGi deployments into consideration. So if you mark a given DU as of type foo, you must make sure that foo is also supported as an OSGi bundle deployment.

I constantly fix DUPs that assume that every deployment is a module deployment. Here is the latest one
Caused by: java.lang.NullPointerException
    at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:101)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

Generally, I don't mind fixing those since I cannot assume that you even know/care what an OSGi bundle deployment is ;-)

However, on our way to x.y.z.Final we probably want to avoid these basic errors.

What do you need to do is to check that a given DU does not contain a valid OSGi Manifest before you mark it as "your type"
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if(deploymentUnit.hasAttachment(Attachments.OSGI_MANIFEST)) {
            return;
        }
        if(deploymentUnit.getName().toLowerCase().endsWith(WAR_EXTENSION)) {
            DeploymentTypeMarker.setType(DeploymentType.WAR, deploymentUnit);
        }
    }
Please take a minute to review your "entry point" DUP and make sure it ignores OSGi deployments if you are not prepared to handle them.

cheers
-thomas




-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx 

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev
Reply | Threaded
Open this post in threaded view
|

Re: Invalid assumption across most subsystem deployments

Thomas Diesler
I might add that in the long run this distinction will disappear as I work on integration at the bottom most layer.

On 02/01/2012 04:04 PM, Thomas Diesler wrote:
Folks,

here is a friendly reminder that your DUPs must take OSGi deployments into consideration. So if you mark a given DU as of type foo, you must make sure that foo is also supported as an OSGi bundle deployment.

I constantly fix DUPs that assume that every deployment is a module deployment. Here is the latest one
Caused by: java.lang.NullPointerException
    at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:101)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113)

Generally, I don't mind fixing those since I cannot assume that you even know/care what an OSGi bundle deployment is ;-)

However, on our way to x.y.z.Final we probably want to avoid these basic errors.

What do you need to do is to check that a given DU does not contain a valid OSGi Manifest before you mark it as "your type"
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if(deploymentUnit.hasAttachment(Attachments.OSGI_MANIFEST)) {
            return;
        }
        if(deploymentUnit.getName().toLowerCase().endsWith(WAR_EXTENSION)) {
            DeploymentTypeMarker.setType(DeploymentType.WAR, deploymentUnit);
        }
    }
Please take a minute to review your "entry point" DUP and make sure it ignores OSGi deployments if you are not prepared to handle them.

cheers
-thomas




-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx 


_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev

-- 
xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Thomas Diesler
JBoss OSGi Lead
JBoss, a division of Red Hat
xxxxxxxxxxxxxxxxxxxxxxxxxxxx 

_______________________________________________
jboss-as7-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/jboss-as7-dev