[GLASSFISH-15009] Weld JSF Permalink Example : Failure Created: 06/Dec/10  Updated: 21/Mar/13  Resolved: 21/Mar/13

Status: Closed
Project: glassfish
Component/s: cdi
Affects Version/s: None
Fix Version/s: 4.0

Type: Bug Priority: Minor
Reporter: rogerk Assignee: jjsnyder83
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Status Whiteboard:

weld-int-required


 Description   

See: http://java.net/jira/browse/GLASSFISH-13182

The application has beans.xml here:
WEB-INF/classes/META-INF/beans.xml

However, the GlassFish Weld Integration module expects beans.xml to be under WEB-INF:
WEB-NF/beans.xml

I haven't checked the Weld specification in a while, so if WEB-INF/classes/META-INF/beans.xml is a valid location,
then the GlassFish Weld Integration module will have to be modified to accommodate this location.
The workaround for now would be to just put beans.xml under WEB-INF directly:
WEB-NF/beans.xml
[ Show » ]
rogerk added a comment - 06/Dec/10 11:49 AM Ok - the problem is as follows... The application has beans.xml here: WEB-INF/classes/META-INF/beans.xml However, the GlassFish Weld Integration module expects beans.xml to be under WEB-INF: WEB-NF/beans.xml I haven't checked the Weld specification in a while, so if WEB-INF/classes/META-INF/beans.xml is a valid location, then the GlassFish Weld Integration module will have to be modified to accommodate this location. The workaround for now would be to just put beans.xml under WEB-INF directly: WEB-NF/beans.xml



 Comments   
Comment by Sivakumar Thyagarajan [ 07/Dec/10 ]

As per Section 12.1 of CDI 1.0 specification:
> • The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the WEB-INF directory of the war.
> • A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory.

So, the usage of WEB-INF/classes/META-INF/beans.xml doesn't sound right. Making this fix, solves the issue
move the file (in weld-core): from
examples/jsf/permalink/src/main/resources/META-INF/beans.xml
to
examples/jsf/permalink/src/main/webapp/WEB-INF/beans.xml

I am clarifying if this scenario is valid and will close the bug after I undestand if this is a portable usage scenario.

Comment by Sivakumar Thyagarajan [ 07/Dec/10 ]

As per Section 12.1 of CDI 1.0 specification:
> • The WEB-INF/classes directory of a war is a bean archive if there is a file named beans.xml in the WEB-INF directory of the war.
> • A directory in the JVM classpath is a bean archive if it has a file named beans.xml in the META-INF directory.

So, this is an non-portable usage scenario. I have raised https://jira.jboss.org/browse/WELD-780 to get this fixed in Weld jsf/permalink examples. I have also raised a RFE in GlassFish to support this scenario http://java.net/jira/browse/GLASSFISH-15018

Comment by Sivakumar Thyagarajan [ 07/Dec/10 ]

Marking this as Weld-int-required as we have raised https://jira.jboss.org/browse/WELD-780 to get this fixed in Weld jsf/permalink examples.

Comment by Sivakumar Thyagarajan [ 17/Dec/10 ]

Marking this issue as minor as the fix is needed in a weld sample and it is easy to make this change by the developer.

Comment by mojavelinux [ 26/Jan/11 ]

I have submitted a patch to the Weld issue.

Your understanding of the location for beans.xml is correct. The example was in error.

Despite the correction, its still necessary to put a second beans.xml on the classpath (src/main/resources/META-INF) when deploying with the embedded Jetty Maven plugin because of how it arranges the deployment.

Comment by Tom Mueller [ 06/Mar/12 ]

Bulk update to change fix version to "not determined" for all issues still open but with a fix version for a released version.

Comment by Sivakumar Thyagarajan [ 10/Dec/12 ]

Transferring to JJ Snyder

Comment by tlcksnyder [ 21/Mar/13 ]

Issue fixed as of weld-1.1.10.Final. Successfully tested with 1.1.10 final in GF 3.1.2, and Weld 2.0.0Beta6 in GF 4.

Generated at Sun Dec 11 01:36:31 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.