[jboss-as7-dev] Invalid assumption across most subsystem deployments

Thomas Diesler thomas.diesler at jboss.com
Wed Feb 1 10:04:10 EST 2012


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-as7-dev/attachments/20120201/05c6086c/attachment.html 


More information about the jboss-as7-dev mailing list