Bug 988899 - CDI @Named bean in a static module not found from a JSF page
Summary: CDI @Named bean in a static module not found from a JSF page
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: CDI/Weld
Version: 6.1.1
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ER6
: EAP 6.2.0
Assignee: Stuart Douglas
QA Contact: Marek Schmidt
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-07-26 16:04 UTC by Marek Schmidt
Modified: 2013-12-15 16:55 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-15 16:55:52 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer module and test.war (20.00 KB, application/x-tar)
2013-07-26 16:04 UTC, Marek Schmidt
no flags Details

Description Marek Schmidt 2013-07-26 16:04:21 UTC
Created attachment 778823 [details]
reproducer module and test.war

Description of problem:

Having a static module org.jboss.test.namedModule with

@Named("greeter")
public class Greeter {
	public String getGreeting() {
		return "Hello, world!";
	}
}

and a test.war depending on the module

Dependencies: org.jboss.test.namedModule meta-inf

with a home.xhtml page:

   <h:body>
	<h1>Greeting: #{greeter.greeting}</h1>
   </h:body>

on

http://127.0.0.1:8080/test/home.jsf

doesn't show the "Hello, world!" greeting and the "greeter" is null.
 

Version-Release number of selected component (if applicable):
EAP 6.1.0, EAP 6.1.1.ER3

How reproducible:
Always

Steps to Reproduce:

See the attached module to put into modules and deployment into standalone/deployments, or run a test from an experimental internal git:

git clone git://git.engineering.redhat.com/users/maschmid/weld-module-tests.git
cd weld-module-tests

unzip jboss-eap-6.1.1.ER3.zip 
export JBOSS_HOME=jboss-eap-6.1/

mvn clean verify -Darquillian=jbossas-managed-7 -Dtest=NamedModuleTest


Additional info:

The test passes on WildFly 8.0.0.Alpha3.

Comment 1 Stuart Douglas 2013-10-01 11:39:02 UTC
Root cause is that CDI won't activate if there in only 1 beans.xml in the app in WEB-INF/beans.xml and WEB-INF/classes does not exist. 

Pull request:

https://github.com/jbossas/jboss-eap/pull/498

Comment 6 Marek Schmidt 2013-10-17 13:03:46 UTC
Verified on EAP 6.2.0.ER6


Note You need to log in before you can comment on or make changes to this bug.