Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 3.0.1, EE-3.0.0.GA
-
Fix Version/s: 3.1, EE-3.0.0.GA_P01
-
Component/s: Framework
-
Labels:None
-
Environment:Chrome, Firefox, IE9, IBM WebSpere 8, MyFaces 2.0
-
Assignee Priority:P1
Description
When I deploy attached sample on Websphere 8 with build in MyFaces 2.0 library everything work just fine.
Note that based on the IBM documentation over here: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Ftcws_sharedlib.html)
Only the default JSF implementation (based on MyFaces) is supported for use with CDI.
I believe this is due to the fact that WebSphere 8 is using Apache OpenWebBeans CDI implementation which is of course compatible with MyFaces, but does not like Mojarra JSF libraries.
When I deploy the same sample with ICEfaces libraries and use WebSpere 8 Myfaces 2.0 implementation, time stamps from all beans are not rendered which basically mean that information is not pulled from the beans at all.
Provided sample has been taken from the IBM site over here:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.samples.doc%2Finfo%2Fae%2Fae%2Fsample_cdi.html
I then modified it to use regular JSF components only, so the main page looks like this:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Basic Sample - Date and Time Display</title>
</h:head>
<h:body>
<h:panelGrid>
<h:outputText value="Date and time will be obtained during web page creation using an Application scoped managed bean, a
Session Scoped managed bean, and a Request scoped Producer Method. This time is the time when the object
was first accessed.
For the Application scoped managed bean the time when it was first accessed should always be the same for
the life of the application. For the Session scoped bean the time when it was first accessed should be the
same until the session is invalidated. For the Request scoped Producer method the time should be different
for each Request of the page."/>
</h:panelGrid>
<h:panelGrid columns="2">
<h:outputText value="Application Scope. This Application was first accessed at->"/>
<h:outputText value="#{timeApplicationScope.date}"/>
<h:outputText value="Session Scope. This Session was first accessed at->"/>
<h:outputText value="#{timeSessionScope.date}"/>
<h:outputText value="Request Scoped Producer. This Request was first accessed at ->"/>
<h:outputText value="#{dateFromProducer.date}"/>
</h:panelGrid>
<a href='index.jsf'>Press here to Refresh this page.</a> Request Scoped Producer Method time should change.
<p></p>
<a href='sLogger.jsf'>Press here to see log of when the Request Scoped Producer Method bean Disposer was called.</a>
</h:body>
</html>
Note that all beans in this example are CDI enabled.
When deployed on Glassfish 3.1 this sample work with or without ICEfaces libraries just fine.
Also note that when you add ICEfaces librararies to the attached sample a web.xml file modification will be required to reflect this change.
Both web.xml variations attached.
System error logs are attached as well for deployment with ICEfaces libraries.
Note that based on the IBM documentation over here: http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.base.doc%2Finfo%2Faes%2Fae%2Ftcws_sharedlib.html)
Only the default JSF implementation (based on MyFaces) is supported for use with CDI.
I believe this is due to the fact that WebSphere 8 is using Apache OpenWebBeans CDI implementation which is of course compatible with MyFaces, but does not like Mojarra JSF libraries.
When I deploy the same sample with ICEfaces libraries and use WebSpere 8 Myfaces 2.0 implementation, time stamps from all beans are not rendered which basically mean that information is not pulled from the beans at all.
Provided sample has been taken from the IBM site over here:
http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.samples.doc%2Finfo%2Fae%2Fae%2Fsample_cdi.html
I then modified it to use regular JSF components only, so the main page looks like this:
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html">
<h:head>
<title>Basic Sample - Date and Time Display</title>
</h:head>
<h:body>
<h:panelGrid>
<h:outputText value="Date and time will be obtained during web page creation using an Application scoped managed bean, a
Session Scoped managed bean, and a Request scoped Producer Method. This time is the time when the object
was first accessed.
For the Application scoped managed bean the time when it was first accessed should always be the same for
the life of the application. For the Session scoped bean the time when it was first accessed should be the
same until the session is invalidated. For the Request scoped Producer method the time should be different
for each Request of the page."/>
</h:panelGrid>
<h:panelGrid columns="2">
<h:outputText value="Application Scope. This Application was first accessed at->"/>
<h:outputText value="#{timeApplicationScope.date}"/>
<h:outputText value="Session Scope. This Session was first accessed at->"/>
<h:outputText value="#{timeSessionScope.date}"/>
<h:outputText value="Request Scoped Producer. This Request was first accessed at ->"/>
<h:outputText value="#{dateFromProducer.date}"/>
</h:panelGrid>
<a href='index.jsf'>Press here to Refresh this page.</a> Request Scoped Producer Method time should change.
<p></p>
<a href='sLogger.jsf'>Press here to see log of when the Request Scoped Producer Method bean Disposer was called.</a>
</h:body>
</html>
Note that all beans in this example are CDI enabled.
When deployed on Glassfish 3.1 this sample work with or without ICEfaces libraries just fine.
Also note that when you add ICEfaces librararies to the attached sample a web.xml file modification will be required to reflect this change.
Both web.xml variations attached.
System error logs are attached as well for deployment with ICEfaces libraries.
Issue Links
- duplicates
-
ICE-8217 @EJB Injection not working on WAS8 with JSF 2.1.3+
- Open
I believe this is a duplicate of JIRA ICE-8217