JSF 2 Annotations with Websphere 7 (JEE5, JAVA 1.6)

Posted by gerges on Stack Overflow See other posts from Stack Overflow or by gerges
Published on 2010-05-17T15:50:17Z Indexed on 2010/05/17 16:00 UTC
Read the original article Hit count: 693

Filed under:
|
|
|
|

Hey all,

I'm currently writing a simple JSF 2 app for WAS 7. When I define the bean via the faces-config.xml, everything works great

<managed-bean>
     <managed-bean-name>personBean</managed-bean-name>
     <managed-bean-class>com.prototype.beans.PersonBean</managed-bean-class>
     <managed-bean-scope>request</managed-bean-scope>
</managed-bean>

When I try to use the annotations below instead, the app failes.

package com.prototype.beans;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

@ManagedBean(name="personBean")
@RequestScoped
public class PersonBean {
....
}

I've set the WAS classloader to Parent Last, and verified in the logs that Mojarra 2.x is loading.

[5/17/10 10:46:59:399 CDT] 00000009 config        I   Initializing Mojarra 2.0.2 (FCS b10) for context '/JSFPrototype'

However, when I try to use the app (which had worked with XML based config) I see the following

[5/17/10 10:48:08:491 CDT] 00000016 lifecycle     W   /pages/inputname.jsp(16,7) '#{personBean.personName}' Target Unreachable, identifier 'personBean' resolved to null
    org.apache.jasper.el.JspPropertyNotFoundException: /pages/inputname.jsp(16,7) '#{personBean.personName}' Target Unreachable, identifier 'personBean' resolved to null

Anyone know whats going wrong?

© Stack Overflow or respective owner

Related posts about jsf2

Related posts about websphere