[jboss-jira] [JBoss JIRA] Commented: (JBAS-6842) Unwanted deployment of the shared STLBs

jaikiran pai (JIRA) jira-events at lists.jboss.org
Mon Oct 5 03:29:49 EDT 2009


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

jaikiran pai commented on JBAS-6842:
------------------------------------

A bit more details - The OptAnnotationMetaDataDeployer uses the AnnotationEnvironment to look for annotations on classes. The AnnotationEnvironment in the deployment unit is set by the org.jboss.deployers.vfs.plugins.annotations.FilteredAnnotationEnvironmentDeployer which does *not* take into account that the shared-ejbs.jar belongs to the EAR/lib folder of the unit:

protected URL[] getUrls(VFSDeploymentUnit unit) throws Exception
   {
      List<VirtualFile> classpath = unit.getClassPath();
      if (classpath != null && classpath.isEmpty() == false)
      {
         List<URL> urls = new ArrayList<URL>();
         VirtualFile root = unit.getRoot();
         for (VirtualFile cp : classpath)
         {
            VirtualFile check = cp;
            while(check != null && check.equals(root) == false)
               check = check.getParent();

            if (check != null)
               urls.add(cp.toURL());
         }
         if (urls.isEmpty() == false)
         {
            if (log.isTraceEnabled())
               log.trace("Explicit urls: " + urls);

            return urls.toArray(new URL[urls.size()]);
         }
      }
      return new URL[0];
   }


 Effectively it includes classes in that jar for annotation scanning. The Annotation environment deployer is a generic deployer and not specific to EJB3 deployments. IMO, this deployer should be aware of "library-directory" of an deployment (ex: for .ear the default library-directory is "lib"). By definition a library-directory contains only libraries and hence should not be scanned for annotations. So probably, the Annotation environment deployer needs to filter out the library-directory classes during AnnotationEnvironment creation.


> Unwanted deployment of the shared STLBs
> ---------------------------------------
>
>                 Key: JBAS-6842
>                 URL: https://jira.jboss.org/jira/browse/JBAS-6842
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Deployers, EJB3
>    Affects Versions: JBossAS-5.0.1.GA, JBossAS-5.1.0.GA
>            Reporter: Miroslav Havram
>            Assignee: jaikiran pai
>         Attachments: JBAS-6842.zip
>
>
> STLBs from the EAR's lib are deployed even if they are explicitly excluded from deployment.
> More information can be found on the related forum topic.

-- 
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