[jboss-jira] [JBoss JIRA] Commented: (JBAS-7976) jboss-app.xml is not parsed when no application.xml is provided

Ales Justin (JIRA) jira-events at lists.jboss.org
Mon May 3 06:31:05 EDT 2010


    [ https://jira.jboss.org/jira/browse/JBAS-7976?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12528601#action_12528601 ] 

Ales Justin commented on JBAS-7976:
-----------------------------------

OK, fixed/hacked merge.
As Ear contents deployer only creates modules, this should be fine.
Can you try it out?

   protected void createMetaData(DeploymentUnit unit, String name, String suffix) throws DeploymentException
   {
      EarMetaData specMetaData = unit.getAttachment(EarMetaData.class);
      JBossAppMetaData metaData = unit.getAttachment(JBossAppMetaData.class); // from ear contents deployer

      // do parse
      super.createMetaData(unit, name, suffix);
      // new parsed metadata
      JBossAppMetaData parsed = unit.getAttachment(JBossAppMetaData.class);
      if (metaData != null && parsed != null)
      {
         ModulesMetaData mmd = metaData.getModules();
         if (mmd != null && mmd.isEmpty() == false)
         {
            ModulesMetaData parsedMMD = parsed.getModules();
            if (parsedMMD == null)
            {
               parsedMMD = new ModulesMetaData();
               parsed.setModules(parsedMMD);
            }
            parsedMMD.merge(parsedMMD, mmd);
         }
      }
      // parsed is the one we use after merged modules
      metaData = parsed;

      if(specMetaData == null && metaData == null)
         return;

      // If there no JBossMetaData was created from a jboss-app.xml, create one
      if (metaData == null)
         metaData = new JBossAppMetaData();

      // Create a merged view
      JBossAppMetaData mergedMetaData = new JBossAppMetaData();
      mergedMetaData.merge(metaData, specMetaData);
      // Set the merged as the output
      unit.getTransientManagedObjects().addAttachment(JBossAppMetaData.class, mergedMetaData);
      // Keep the raw parsed metadata as well
      unit.addAttachment("Raw"+JBossAppMetaData.class.getName(), metaData, JBossAppMetaData.class);
      // Pass the ear callByValue setting
      if (isCallByValue())
         unit.addAttachment("EAR.callByValue", Boolean.TRUE, Boolean.class);
      //Pass the unauthenticated identity
      if (this.unauthenticatedIdentity != null)
         unit.addAttachment("EAR.unauthenticatedIdentity", this.unauthenticatedIdentity, String.class);
   }


> jboss-app.xml is not parsed when no application.xml is provided
> ---------------------------------------------------------------
>
>                 Key: JBAS-7976
>                 URL: https://jira.jboss.org/jira/browse/JBAS-7976
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Deployers
>    Affects Versions: 6.0.0.M2
>            Reporter: Alessio Soldano
>            Assignee: Ales Justin
>             Fix For: 6.0.0.CR1
>
>         Attachments: [JBAS-7976]__#2.patch, [JBAS-7976]__fix_JBossAppParsing_deployer_.patch
>
>
> JBossAppParsingDeployers does not actually parse jboss-app.xml when no application.xml descriptor is provided. In that case, the EARContentsDeployer creates a JBoss50AppMetaData instance and attach that to the deployment unit. Later JBossAppParsingDeployer (actually AbstractParsingDeployerWithOutput::createMetaData(DeploymentUnit unit, Set<String> names, String suffix, String key)) finds the metadata are already there and returns without doing the actual parse.
> A consequence of this is that, for instance, a security domain declared in jboss-app.xml is not picked up.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list