[cdi-dev] [JBoss JIRA] (CDI-533) Bean Deployment archive conflicts between section 5 and section 12

Jozef Hartinger (JIRA) issues at jboss.org
Wed Jun 3 01:22:02 EDT 2015


    [ https://issues.jboss.org/browse/CDI-533?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13073487#comment-13073487 ] 

Jozef Hartinger commented on CDI-533:
-------------------------------------

I don't think there is a conflict actually:

Section 5.1 says:

{quote}
Beans and their clients may be deployed in modules in a module architecture such as the Java EE environment. In a module architecture, certain modules are considered bean archives. In the Java EE module architecture, any Java EE module or library is a module. The Java EE module or library is a bean archive if it contains a beans.xml file.
{quote}

It basically says that a bean archive is either a Java EE module or a library jar.

Let's use an example
{noformat}
app.ear
|-- web1.war
|    |-- WEB-INF/classes
|    |-- WEB-INF/lib
|        |-- weblib1.jar
|        |-- weblib2.jar
|-- ejb1.jar
|-- lib/
|    |-- earlib1.jar
{noformat}

According to section 5.1 we (possibly) have the following bean archives:
* web1.war and ejb1.jar which are modules
* weblib1.jar, weblib2.jar and earlib1.jar are library jars

On top of 5.1, section 12.1 defines what it means for a module to be a bean archive. More specifically it says:
{quote}
When determining which archives are bean archives, the container must consider:
* Library jars, EJB jars or application client jars
* The WEB-INF/classes directory of a war
* Directories in the JVM classpath
{quote}

The *The WEB-INF/classes directory of a war* is important here. It defines what it means specifically for a web module to be a bean archive. It defines that the web1.war, as a bean archive, only contains classes located under the _WEB-INF/classes_ directory.

Therefore, in our application we have the following bean archives:
* web1.war (contains WEB-INF/classes only) and ejb1.jar which are modules
* weblib1.jar, weblib2.jar and earlib1.jar which are library jars

Therefore, there is no overlap as library jars are handled separately (by 5.1 and 12.1) and the bean archive for a web module is defined to contain classes from _WEB-INF/classes_ only.

> Bean Deployment archive conflicts between section 5 and section 12
> ------------------------------------------------------------------
>
>                 Key: CDI-533
>                 URL: https://issues.jboss.org/browse/CDI-533
>             Project: CDI Specification Issues
>          Issue Type: Clarification
>          Components: Packaging and Deployment
>    Affects Versions: 1.2.Final
>         Environment: n/a
>            Reporter: Emily Jiang
>
> In CDI1.2 spec, the definition for bean archive are conflicting between section 5 and section 12;
> In section 5, 
> Beans and their clients may be deployed in modules in a module architecture such as the Java EE environment. In a module architecture, certain modules are considered bean archives. In the Java EE module architecture, any Java EE module or library is a module. The Java EE module or library is a bean archive if it contains a beans.xml file. 
> This section talks about the bean deployment on the module or library level. It indicates one web module (may contain web-inf\lib etc) is a single bean archive. The smallest unit is a module or a lib.
> While in section 12:
> When determining which archives are bean archives, the container must consider:
> • Library jars, EJB jars or application client jars
> • The WEB-INF/classes directory of a war
> • Directories in the JVM classpath
> It indicates each jar should be a bean archive. The smallest unit is a jar.
> I started this conversation with Mark, Jozef, Antoine, Romain. The correct implementation is section 12. So section 5 needs to be reworked.
> All conversation is on the cdi-dev mailing list. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)



More information about the cdi-dev mailing list