jsf2.0 seam3.0 FacesContext.getCurrentInstance() return null in ejb3.0 project please help me thanks
===

![this is my project image

][1]
  [1]: http://i.stack.imgur.com/8fR4y.jpg



    ejb project 
    
    java code :
    
        public abstract class AbstractEntityMBean extends AbstractBaseMBean {
        	
        	private static final long serialVersionUID = 1L;
        	
        	private static final String TABLE_RRN = "tableRrn";
        	
        	@Inject
        	private ADManager adManager;
        	
        	private Long tableRrn;
        	private ADTable adTable;
        	private List<ADField> adFields;
        	private List<ADTab> adTabs;
        	private Map<String, ADField> adFieldMap;
        	private Map<String, ADRefTable> adRefTableMap;
        	
        	private EntityLazyDataModel dataModel;
        	
            @PostConstruct
            public void init() {
            	try {
        	    	if (tableRrn == null) {
        				ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
        				String tableRrnStr = context.getRequestParameterMap().get(TABLE_RRN);
        				if (tableRrnStr != null && tableRrnStr.trim().length() > 0) {
        					tableRrn = Long.parseLong(tableRrnStr);
        				}
        			}
        			if (getAdTable() == null || !getAdTable().getObjectRrn().equals(tableRrn)) {
        				setAdTable(adManager.getADTable(tableRrn));
        				setAdTabs(getAdTable().getTabs());
        				setAdFields(getAdTable().getFields());
        				//初始化Label
        				for (ADTab adTab : getAdTabs()) {
        					adTab.setDisplayLable(I18nUtil.getI18nMessage(getAdTable(), "label"));
        				}
        				for (ADField adField : getAdFields()) {
        					adField.setDisplayLabel(I18nUtil.getI18nMessage(getAdTable(), "label"));
        				}
        			}
        			Class clazz = Class.forName(adTable.getModelClass());
        			setDataModel(new EntityLazyDataModel(clazz, 
        					adTable.getInitWhereClause(), adTable.getWhereClause(), adTable.getOrderByClause()));
        			
        			setEntity(this.create());
            	} catch (Exception e) {	
            		ExceptionHandlerManager.syncHandleException(e);
        		}
            }
        
        
        -----------
        
        
        ejb project java code 2:
        
        @Named
        @ViewScoped
        public class EntityMBean extends AbstractEntityMBean {
        
        	private static final long serialVersionUID = 1L;
        	
        	
        }
        
        web project java code :
        
        
        import java.util.Map;
        
        import javax.faces.context.ExternalContext;
        import javax.faces.context.FacesContext;
        import javax.inject.Inject;
        import javax.inject.Named;
        
        import com.glory.fwweb.activeentity.bean.EntityMBean;
        @Named
        public class TableTest {
        	
        	@Inject
        	private EntityMBean entityMBean;
        	
        	
        	public String queryTable(){
        		@SuppressWarnings("unused")
        		ExternalContext context = FacesContext.getCurrentInstance().getExternalContext();
        		System.out.println("xxx");
        //		entityMBean.setTableRrn(1L);
        		return "home";
        	}
        	
        	public String saveTable(){
        		return null;
        	}
        }
        
        
        
        web project xhtml  code :
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml"
              xmlns:ui="http://java.sun.com/jsf/facelets"
              xmlns:h="http://java.sun.com/jsf/html"
              xmlns:f="http://java.sun.com/jsf/core"
              xmlns:uiform="http://java.sun.com/jsf/composite/fwweb/ui">
        <f:view>
            <ui:insert name="metadata"/>
            <h:head>
                <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
                <title>test</title>
                <link rel="shortcut icon" href="#{request.contextPath}/favicon.ico"/>
        
                <ui:insert name="head"/>
            </h:head>
        	<h:body>
        		<h:form>
        		<h:button value="test"/>
        	<h:commandButton value="search" action="#{tableTest.queryTable()}" />
        		</h:form>
            </h:body>
        </f:view>
        </html>
        
        
        
        error 500:
        
        javax.servlet.ServletException: WELD-000049 Unable to invoke [method] @PostConstruct public com.glory.fwweb.activeentity.bean.AbstractEntityMBean.init() on com.glory.fwweb.activeentity.bean.EntityMBean@115ae0
        	javax.faces.webapp.FacesServlet.service(FacesServlet.java:606)
        	org.jboss.weld.servlet.ConversationPropagationFilter.doFilter(ConversationPropagationFilter.java:62)
        	com.ocpsoft.pretty.PrettyFilter.doFilter(PrettyFilter.java:126)
        
        
        root cause 
        
        org.jboss.weld.exceptions.WeldException: WELD-000049 Unable to invoke [method] @PostConstruct public com.glory.fwweb.activeentity.bean.AbstractEntityMBean.init() on com.glory.fwweb.activeentity.bean.EntityMBean@115ae0
        	org.jboss.weld.bean.AbstractClassBean.defaultPostConstruct(AbstractClassBean.java:518)
        	org.jboss.weld.bean.ManagedBean$ManagedBeanInjectionTarget.postConstruct(ManagedBean.java:174)
        	org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:291)
        	 
        ...............
        
        java.lang.reflect.InvocationTargetException
        	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
        ...............
        
        java.lang.NullPointerException
        	com.glory.fwweb.exception.ExceptionHandlerManager.handleException(ExceptionHandlerManager.java:46)
        	com.glory.fwweb.exception.ExceptionHandlerManager.syncHandleException(ExceptionHandlerManager.java:130)
        	com.glory.fwweb.activeentity.bean.AbstractEntityMBean.init(AbstractEntityMBean.java:75)
        	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        	sun.reflect.DelegatingMethodAccessorImpl
    
    .invoke(DelegatingMethodAccessorImpl.java:25)

-----------------------------------------------------------------------




please help me  why  FacesContext.getCurrentInstance() return null  in AbstractEntityMBean.java ?

if i take AbstractEntityMBean.java in web project  it isn't null,  please for help me!!! thanks a lot;


please how to do for this , let  FacesContext.getCurrentInstance()  hava value;






