users@glassfish.java.net

Re: _at_Resource for MailSession in JSF Container

From: <glassfish_at_javadesktop.org>
Date: Sun, 16 Dec 2007 19:45:03 PST

Hi Dmitry,

Can you check if your managed bean has been properly configured as a managed bean. Otherwise, injections in that class will simply be ignored.

Check WEB-INF/faces-config.xml for these lines:

<faces-config version="1.2"
    xmlns="http://java.sun.com/xml/ns/javaee"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_1_2.xsd">

    <managed-bean>
        <managed-bean-name>yourBean</managed-bean-name>
        <managed-bean-class>com.xxx.xxx.YourBean</managed-bean-class>
        <managed-bean-scope>request</managed-bean-scope>
    </managed-bean>

Also check your web.xml. It should use servlet version 2.5 to support annotation processing:

<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <context-param>
        <param-name>javax.faces.CONFIG_FILES</param-name>
        <param-value>/WEB-INF/faces-config.xml</param-value>
    </context-param>

-cheng
[Message sent by forum member 'cf126330' (cf126330)]

http://forums.java.net/jive/thread.jspa?messageID=250332